aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdrivers/staging/ice4100/sgx535/bridged/bridged_pvr_bridge.c13
-rwxr-xr-xdrivers/staging/ice4100/sgx535/common/buffer_manager.c122
-rwxr-xr-xdrivers/staging/ice4100/sgx535/common/deviceclass.c58
-rwxr-xr-xdrivers/staging/ice4100/sgx535/common/devicemem.c178
-rwxr-xr-xdrivers/staging/ice4100/sgx535/common/queue.c22
-rwxr-xr-xdrivers/staging/ice4100/sgx535/devices/sgx/sgxinit.c10
-rwxr-xr-xdrivers/staging/ice4100/sgx535/hwdefs/sgxerrata.h1
-rwxr-xr-xdrivers/staging/ice4100/sgx535/include/buffer_manager.h5
-rwxr-xr-xdrivers/staging/ice4100/sgx535/include/kerneldisplay.h4
-rwxr-xr-xdrivers/staging/ice4100/sgx535/include/pvrversion.h4
-rwxr-xr-xdrivers/staging/ice4100/sgx535/include/servicesint.h12
-rwxr-xr-xdrivers/staging/ice4100/sgx535/include/sgx_mkif_km.h2
-rwxr-xr-xdrivers/staging/ice4100/sgx535/pvr_bridge_k.c6
-rwxr-xr-xdrivers/staging/ice4100/sgx535/system/sgx_intel_ce/graphics_pm.c38
-rwxr-xr-xdrivers/staging/ice4100/sgx535/system/sgx_intel_ce/sysconfig.c79
-rwxr-xr-xdrivers/staging/ice4100/sgx535/system/sgx_intel_ce/syslocal.h3
16 files changed, 388 insertions, 169 deletions
diff --git a/drivers/staging/ice4100/sgx535/bridged/bridged_pvr_bridge.c b/drivers/staging/ice4100/sgx535/bridged/bridged_pvr_bridge.c
index 9a74bcfe83d..8323ac289db 100755
--- a/drivers/staging/ice4100/sgx535/bridged/bridged_pvr_bridge.c
+++ b/drivers/staging/ice4100/sgx535/bridged/bridged_pvr_bridge.c
@@ -560,7 +560,6 @@ PVRSRVFreeDeviceMemBW(u32 ui32BridgeID,
{
void *hDevCookieInt;
void *pvKernelMemInfo;
- PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_FREE_DEVICEMEM);
@@ -582,19 +581,9 @@ PVRSRVFreeDeviceMemBW(u32 ui32BridgeID,
return 0;
}
- psKernelMemInfo = (PVRSRV_KERNEL_MEM_INFO *) pvKernelMemInfo;
- if (psKernelMemInfo->ui32RefCount == 1) {
- psRetOUT->eError =
+ psRetOUT->eError =
PVRSRVFreeDeviceMemKM(hDevCookieInt, pvKernelMemInfo);
- } else {
- PVR_DPF((PVR_DBG_WARNING,
- "PVRSRVFreeDeviceMemBW: mappings are open "
- "in other processes, deferring free!"));
-
- psKernelMemInfo->bPendingFree = 1;
- psRetOUT->eError = PVRSRV_OK;
- }
if (psRetOUT->eError != PVRSRV_OK) {
return 0;
diff --git a/drivers/staging/ice4100/sgx535/common/buffer_manager.c b/drivers/staging/ice4100/sgx535/common/buffer_manager.c
index af3f72437d9..cfbb9712def 100755
--- a/drivers/staging/ice4100/sgx535/common/buffer_manager.c
+++ b/drivers/staging/ice4100/sgx535/common/buffer_manager.c
@@ -490,7 +490,7 @@ ZeroBuf(BM_BUF * pBuf, BM_MAPPING * pMapping, u32 ui32Bytes, u32 ui32Flags)
return 1;
}
-static void FreeBuf(BM_BUF * pBuf, u32 ui32Flags)
+static void FreeBuf(BM_BUF * pBuf, u32 ui32Flags, int bFromAllocator)
{
BM_MAPPING *pMapping;
@@ -503,67 +503,80 @@ static void FreeBuf(BM_BUF * pBuf, u32 ui32Flags)
if (ui32Flags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR) {
- if (ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION) {
+ if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0)) {
- PVR_DPF((PVR_DBG_ERROR,
- "FreeBuf: combination of DevVAddr management and RAM backing mode unsupported"));
- } else {
+ if(ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION) {
+ PVR_DPF((PVR_DBG_ERROR,
+ "FreeBuf: combination of DevVAddr management and RAM backing mode unsupported"));
+ } else {
- OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING),
- pMapping, NULL);
- pBuf->pMapping = NULL;
+ OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING),
+ pMapping, NULL);
+ pBuf->pMapping = NULL;
+ }
}
} else {
if (pBuf->hOSMemHandle != pMapping->hOSMemHandle) {
- OSReleaseSubMemHandle(pBuf->hOSMemHandle, ui32Flags);
+ if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0)) {
+ OSReleaseSubMemHandle(pBuf->hOSMemHandle, ui32Flags);
+ }
}
if (ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION) {
- RA_Free(pBuf->pMapping->pArena, pBuf->DevVAddr.uiAddr,
- 0);
+ if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0)) {
+ PVR_ASSERT(pBuf->ui32ExportCount == 0);
+
+ RA_Free(pBuf->pMapping->pArena, pBuf->DevVAddr.uiAddr, 0);
+ }
} else {
- switch (pMapping->eCpuMemoryOrigin) {
- case hm_wrapped:
- OSUnReservePhys(pMapping->CpuVAddr,
- pMapping->uSize, ui32Flags,
- pMapping->hOSMemHandle);
- break;
- case hm_wrapped_virtaddr:
- OSUnRegisterMem(pMapping->CpuVAddr,
- pMapping->uSize, ui32Flags,
- pMapping->hOSMemHandle);
- break;
- case hm_wrapped_scatter:
- OSUnReserveDiscontigPhys(pMapping->CpuVAddr,
- pMapping->uSize,
- ui32Flags,
- pMapping->
- hOSMemHandle);
- break;
- case hm_wrapped_scatter_virtaddr:
- OSUnRegisterDiscontigMem(pMapping->CpuVAddr,
- pMapping->uSize,
- ui32Flags,
- pMapping->
- hOSMemHandle);
- break;
- default:
- break;
+ if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0)) {
+ switch (pMapping->eCpuMemoryOrigin) {
+ case hm_wrapped:
+ OSUnReservePhys(pMapping->CpuVAddr,
+ pMapping->uSize, ui32Flags,
+ pMapping->hOSMemHandle);
+ break;
+ case hm_wrapped_virtaddr:
+ OSUnRegisterMem(pMapping->CpuVAddr,
+ pMapping->uSize, ui32Flags,
+ pMapping->hOSMemHandle);
+ break;
+ case hm_wrapped_scatter:
+ OSUnReserveDiscontigPhys(pMapping->CpuVAddr,
+ pMapping->uSize,
+ ui32Flags,
+ pMapping->
+ hOSMemHandle);
+ break;
+ case hm_wrapped_scatter_virtaddr:
+ OSUnRegisterDiscontigMem(pMapping->CpuVAddr,
+ pMapping->uSize,
+ ui32Flags,
+ pMapping->
+ hOSMemHandle);
+ break;
+ default:
+ break;
+ }
}
- DevMemoryFree(pMapping);
+ if (bFromAllocator)
+ DevMemoryFree(pMapping);
- OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING),
- pMapping, NULL);
- pBuf->pMapping = NULL;
+ if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0)) {
+ OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING),
+ pMapping, NULL);
+ pBuf->pMapping = NULL;
+ }
+ }
+ if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0)) {
+ OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_BUF), pBuf, NULL);
}
}
-
- OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_BUF), pBuf, NULL);
-
}
+
PVRSRV_ERROR BM_DestroyContext_AnyCb(BM_HEAP * psBMHeap)
{
if (psBMHeap->ui32Attribs
@@ -1226,7 +1239,7 @@ BM_Wrap(void *hDevMemHeap,
if (!HASH_Insert
(psBMContext->pBufferHash, (u32) sHashAddress.uiAddr,
(u32) pBuf)) {
- FreeBuf(pBuf, uFlags);
+ FreeBuf(pBuf, uFlags, 1);
PVR_DPF((PVR_DBG_ERROR, "BM_Wrap: HASH_Insert FAILED"));
return 0;
}
@@ -1248,6 +1261,21 @@ BM_Wrap(void *hDevMemHeap,
return 1;
}
+void BM_Export (BM_HANDLE hBuf)
+{
+ BM_BUF *pBuf = (BM_BUF *)hBuf;
+
+ pBuf->ui32ExportCount++;
+}
+
+void BM_FreeExport (BM_HANDLE hBuf, u32 ui32Flags)
+{
+ BM_BUF *pBuf = (BM_BUF *)hBuf;
+
+ pBuf->ui32ExportCount--;
+ FreeBuf (pBuf, ui32Flags, 0);
+}
+
void BM_Free(BM_HANDLE hBuf, u32 ui32Flags)
{
BM_BUF *pBuf = (BM_BUF *) hBuf;
@@ -1275,7 +1303,7 @@ void BM_Free(BM_HANDLE hBuf, u32 ui32Flags)
HASH_Remove(pBuf->pMapping->pBMHeap->pBMContext->
pBufferHash, (u32) sHashAddr.uiAddr);
}
- FreeBuf(pBuf, ui32Flags);
+ FreeBuf(pBuf, ui32Flags, 1);
}
}
diff --git a/drivers/staging/ice4100/sgx535/common/deviceclass.c b/drivers/staging/ice4100/sgx535/common/deviceclass.c
index 5d68d3b36ee..011ebd155b1 100755
--- a/drivers/staging/ice4100/sgx535/common/deviceclass.c
+++ b/drivers/staging/ice4100/sgx535/common/deviceclass.c
@@ -45,6 +45,11 @@ PVRSRV_ERROR FreeDeviceID(SYS_DATA * psSysData, u32 ui32DevID);
void OSVSyncMISR(void *, int);
#endif
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+void PVRSRVFreeCommandCompletePacketKM(void *hCmdCookie,
+ int bScheduleMISR);
+#endif
+
typedef struct PVRSRV_DC_SRV2DISP_KMJTABLE_TAG *PPVRSRV_DC_SRV2DISP_KMJTABLE;
typedef struct PVRSRV_DC_BUFFER_TAG {
@@ -1152,6 +1157,8 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(void *hDeviceKM,
PVRSRV_QUEUE_INFO *psQueue;
DISPLAYCLASS_FLIP_COMMAND *psFlipCmd;
u32 i;
+ int bAddReferenceToLast = 1;
+ u16 ui16SwapCommandID = DC_FLIP_COMMAND;
u32 ui32NumSrcSyncs = 1;
PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[2];
PVRSRV_COMMAND *psCommand;
@@ -1171,15 +1178,31 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(void *hDeviceKM,
psBuffer = (PVRSRV_DC_BUFFER *) hBuffer;
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+
+ if(psDCInfo->psFuncTable->pfnQuerySwapCommandID != NULL)
+ {
+ psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
+ psBuffer->psSwapChain->hExtSwapChain,
+ psBuffer->sDeviceClassBuffer.hExtBuffer,
+ hPrivateTag,
+ &ui16SwapCommandID,
+ &bAddReferenceToLast);
+
+ }
+
+#endif
+
psQueue = psBuffer->psSwapChain->psQueue;
apsSrcSync[0] = psBuffer->sDeviceClassBuffer.psKernelSyncInfo;
- if (psBuffer->psSwapChain->psLastFlipBuffer &&
- psBuffer != psBuffer->psSwapChain->psLastFlipBuffer) {
+ if (bAddReferenceToLast &&
+ psBuffer->psSwapChain->psLastFlipBuffer &&
+ psBuffer != psBuffer->psSwapChain->psLastFlipBuffer) {
apsSrcSync[1] =
- psBuffer->psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.
- psKernelSyncInfo;
+ psBuffer->psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.
+ psKernelSyncInfo;
ui32NumSrcSyncs++;
}
@@ -1187,7 +1210,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(void *hDeviceKM,
eError = PVRSRVInsertCommandKM(psQueue,
&psCommand,
psDCInfo->ui32DeviceID,
- DC_FLIP_COMMAND,
+ ui16SwapCommandID,
0,
NULL,
ui32NumSrcSyncs,
@@ -1269,6 +1292,8 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(void *hDeviceKM, void *hSwapChainRef)
u32 ui32NumSrcSyncs = 1;
PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[2];
PVRSRV_COMMAND *psCommand;
+ int bAddReferenceToLast = 1;
+ u16 ui16SwapCommandID = DC_FLIP_COMMAND;
if (!hDeviceKM || !hSwapChainRef) {
PVR_DPF((PVR_DBG_ERROR,
@@ -1288,10 +1313,25 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(void *hDeviceKM, void *hSwapChainRef)
psQueue = psSwapChain->psQueue;
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+
+ if(psDCInfo->psFuncTable->pfnQuerySwapCommandID != NULL)
+ {
+ psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
+ psSwapChain->hExtSwapChain,
+ psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer,
+ 0,
+ &ui16SwapCommandID,
+ &bAddReferenceToLast);
+
+ }
+
+#endif
+
apsSrcSync[0] =
psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo;
- if (psSwapChain->psLastFlipBuffer) {
+ if (bAddReferenceToLast && psSwapChain->psLastFlipBuffer) {
if (apsSrcSync[0] !=
psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.
@@ -1307,7 +1347,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(void *hDeviceKM, void *hSwapChainRef)
eError = PVRSRVInsertCommandKM(psQueue,
&psCommand,
psDCInfo->ui32DeviceID,
- DC_FLIP_COMMAND,
+ ui16SwapCommandID,
0,
NULL,
ui32NumSrcSyncs,
@@ -1447,6 +1487,10 @@ int PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE * psJTable)
PVRSRVRegisterSystemISRHandler;
psJTable->pfnPVRSRVRegisterPowerDevice = PVRSRVRegisterPowerDevice;
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+ psJTable->pfnPVRSRVFreeCmdCompletePacket = &PVRSRVFreeCommandCompletePacketKM;
+#endif
+
return 1;
}
diff --git a/drivers/staging/ice4100/sgx535/common/devicemem.c b/drivers/staging/ice4100/sgx535/common/devicemem.c
index f7a38e59463..5afd85b4242 100755
--- a/drivers/staging/ice4100/sgx535/common/devicemem.c
+++ b/drivers/staging/ice4100/sgx535/common/devicemem.c
@@ -334,6 +334,38 @@ static PVRSRV_ERROR AllocDeviceMem(void *hDevCookie,
return (PVRSRV_OK);
}
+static PVRSRV_ERROR FreeDeviceMem2(PVRSRV_KERNEL_MEM_INFO *psMemInfo, int bFromAllocator)
+{
+ BM_HANDLE hBuffer;
+
+ if (!psMemInfo)
+ {
+ return PVRSRV_ERROR_INVALID_PARAMS;
+ }
+
+ hBuffer = psMemInfo->sMemBlk.hBuffer;
+
+
+ if (bFromAllocator)
+ BM_Free(hBuffer, psMemInfo->ui32Flags);
+ else
+ BM_FreeExport(hBuffer, psMemInfo->ui32Flags);
+
+
+ if ((psMemInfo->pvSysBackupBuffer) && bFromAllocator)
+ {
+
+ OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, psMemInfo->ui32AllocSize, psMemInfo->pvSysBackupBuffer, NULL);
+ psMemInfo->pvSysBackupBuffer = NULL;
+ }
+
+ if (psMemInfo->ui32RefCount == 0)
+ OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, NULL);
+
+
+ return(PVRSRV_OK);
+}
+
static PVRSRV_ERROR FreeDeviceMem(PVRSRV_KERNEL_MEM_INFO * psMemInfo)
{
BM_HANDLE hBuffer;
@@ -436,8 +468,6 @@ PVRSRV_ERROR PVRSRVAllocSyncInfoKM(void *hDevCookie,
psKernelSyncInfo->psSyncDataMemInfoKM->psKernelSyncInfo = NULL;
- psKernelSyncInfo->hResItem = NULL;
-
*ppsKernelSyncInfo = psKernelSyncInfo;
return PVRSRV_OK;
@@ -461,29 +491,39 @@ PVRSRV_ERROR PVRSRVFreeSyncInfoKM(PVRSRV_KERNEL_SYNC_INFO * psKernelSyncInfo)
return eError;
}
-static PVRSRV_ERROR FreeDeviceMemCallBack(void *pvParam, u32 ui32Param)
+static void freeWrapped(PVRSRV_KERNEL_MEM_INFO *psMemInfo)
+{
+ void *hOSWrapMem = psMemInfo->sMemBlk.hOSWrapMem;
+
+ if(psMemInfo->sMemBlk.psIntSysPAddr)
+ {
+ OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR), psMemInfo->sMemBlk.psIntSysPAddr, NULL);
+ psMemInfo->sMemBlk.psIntSysPAddr = NULL;
+ }
+
+ if(hOSWrapMem)
+ {
+ OSReleasePhysPageAddr(hOSWrapMem);
+ }
+}
+
+static PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo, u32 ui32Param, int bFromAllocator)
{
PVRSRV_ERROR eError = PVRSRV_OK;
- PVRSRV_KERNEL_MEM_INFO *psMemInfo = pvParam;
psMemInfo->ui32RefCount--;
- if (psMemInfo->ui32Flags & PVRSRV_MEM_EXPORTED) {
+ if ((psMemInfo->ui32Flags & PVRSRV_MEM_EXPORTED) &&
+ (bFromAllocator == 1)) {
void *hMemInfo = NULL;
- if (psMemInfo->ui32RefCount != 0) {
- PVR_DPF((PVR_DBG_ERROR,
- "FreeDeviceMemCallBack: mappings are open in other processes"));
- return PVRSRV_ERROR_GENERIC;
- }
-
eError = PVRSRVFindHandle(KERNEL_HANDLE_BASE,
&hMemInfo,
psMemInfo,
PVRSRV_HANDLE_TYPE_MEM_INFO);
if (eError != PVRSRV_OK) {
PVR_DPF((PVR_DBG_ERROR,
- "FreeDeviceMemCallBack: can't find exported meminfo in the global handle list"));
+ "FreeMemCallBackCommon: can't find exported meminfo in the global handle list"));
return eError;
}
@@ -492,27 +532,43 @@ static PVRSRV_ERROR FreeDeviceMemCallBack(void *pvParam, u32 ui32Param)
PVRSRV_HANDLE_TYPE_MEM_INFO);
if (eError != PVRSRV_OK) {
PVR_DPF((PVR_DBG_ERROR,
- "FreeDeviceMemCallBack: PVRSRVReleaseHandle failed for exported meminfo"));
+ "FreeMemCallBackCommon: PVRSRVReleaseHandle failed for exported meminfo"));
return eError;
}
}
- PVR_ASSERT(psMemInfo->ui32RefCount == 0);
-
- if (psMemInfo->psKernelSyncInfo) {
- psMemInfo->psKernelSyncInfo->ui32RefCount--;
+ if (psMemInfo->ui32RefCount == 0) {
+ switch(psMemInfo->memType)
+ {
- if (psMemInfo->psKernelSyncInfo->ui32RefCount == 0) {
- eError =
- PVRSRVFreeSyncInfoKM(psMemInfo->psKernelSyncInfo);
+ case PVRSRV_MEMTYPE_WRAPPED:
+ freeWrapped(psMemInfo);
+ case PVRSRV_MEMTYPE_DEVICE:
+ if (psMemInfo->psKernelSyncInfo)
+ {
+ psMemInfo->psKernelSyncInfo->ui32RefCount--;
+ if (psMemInfo->psKernelSyncInfo->ui32RefCount == 0)
+ {
+ eError = PVRSRVFreeSyncInfoKM(psMemInfo->psKernelSyncInfo);
+ }
+ }
+ case PVRSRV_MEMTYPE_DEVICECLASS:
+ break;
+ default:
+ PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: Unknown memType"));
+ return PVRSRV_ERROR_GENERIC;
}
}
- if (eError == PVRSRV_OK) {
- eError = FreeDeviceMem(psMemInfo);
- }
+ return FreeDeviceMem2(psMemInfo, bFromAllocator);
+}
- return eError;
+static PVRSRV_ERROR FreeDeviceMemCallBack(void *pvParam,
+ u32 ui32Param)
+{
+ PVRSRV_KERNEL_MEM_INFO *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
+
+ return FreeMemCallBackCommon(psMemInfo, ui32Param, 1);
}
PVRSRV_ERROR PVRSRVFreeDeviceMemKM(void *hDevCookie,
@@ -600,6 +656,8 @@ PVRSRV_ERROR _PVRSRVAllocDeviceMemKM(void *hDevCookie,
psMemInfo->ui32RefCount++;
+ psMemInfo->memType = PVRSRV_MEMTYPE_DEVICE;
+
return (PVRSRV_OK);
free_mainalloc:
@@ -646,38 +704,9 @@ PVRSRV_ERROR PVRSRVUnwrapExtMemoryKM(PVRSRV_KERNEL_MEM_INFO * psMemInfo)
static PVRSRV_ERROR UnwrapExtMemoryCallBack(void *pvParam, u32 ui32Param)
{
- PVRSRV_ERROR eError = PVRSRV_OK;
PVRSRV_KERNEL_MEM_INFO *psMemInfo = pvParam;
- void *hOSWrapMem;
-
- hOSWrapMem = psMemInfo->sMemBlk.hOSWrapMem;
-
- if (psMemInfo->psKernelSyncInfo) {
- psMemInfo->psKernelSyncInfo->ui32RefCount--;
- if (psMemInfo->psKernelSyncInfo->ui32RefCount == 0) {
- eError =
- PVRSRVFreeSyncInfoKM(psMemInfo->psKernelSyncInfo);
- }
- }
-
- if (psMemInfo->sMemBlk.psIntSysPAddr) {
- OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR),
- psMemInfo->sMemBlk.psIntSysPAddr, NULL);
- psMemInfo->sMemBlk.psIntSysPAddr = NULL;
- }
- if (eError == PVRSRV_OK) {
-
- psMemInfo->ui32RefCount--;
-
- eError = FreeDeviceMem(psMemInfo);
- }
-
- if (hOSWrapMem) {
- OSReleasePhysPageAddr(hOSWrapMem);
- }
-
- return eError;
+ return FreeMemCallBackCommon(psMemInfo, ui32Param, 1);
}
PVRSRV_ERROR PVRSRVWrapExtMemoryKM(void *hDevCookie,
@@ -839,6 +868,8 @@ PVRSRV_ERROR PVRSRVWrapExtMemoryKM(void *hDevCookie,
psMemInfo->psKernelSyncInfo->ui32RefCount++;
+ psMemInfo->memType = PVRSRV_MEMTYPE_WRAPPED;
+
psMemInfo->ui32RefCount++;
psMemInfo->sMemBlk.hResItem =
@@ -896,7 +927,7 @@ static PVRSRV_ERROR UnmapDeviceMemoryCallBack(void *pvParam, u32 ui32Param)
if (psMapData->psMemInfo->sMemBlk.psIntSysPAddr) {
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR),
- psMapData->psMemInfo->sMemBlk.psIntSysPAddr, NULL);
+ psMapData->psMemInfo->sMemBlk.psIntSysPAddr, NULL);
psMapData->psMemInfo->sMemBlk.psIntSysPAddr = NULL;
}
@@ -919,30 +950,10 @@ static PVRSRV_ERROR UnmapDeviceMemoryCallBack(void *pvParam, u32 ui32Param)
return eError;
}
- psMapData->psSrcMemInfo->ui32RefCount--;
-
- if (psMapData->psSrcMemInfo->ui32RefCount == 1 &&
- psMapData->psSrcMemInfo->bPendingFree == 1) {
-
- if (psMapData->psSrcMemInfo->sMemBlk.hResItem != NULL) {
-
- eError =
- ResManFreeResByPtr(psMapData->psSrcMemInfo->sMemBlk.
- hResItem);
- if (eError != PVRSRV_OK) {
- PVR_DPF((PVR_DBG_ERROR,
- "UnmapDeviceMemoryCallBack: Failed to free SRC meminfo"));
- PVR_DBG_BREAK;
- }
- } else {
-
- eError =
- FreeDeviceMemCallBack(psMapData->psSrcMemInfo, 0);
- }
- }
+ eError = FreeMemCallBackCommon(psMapData->psSrcMemInfo, 0, 0);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_MAP_DEVICE_MEM_DATA),
- psMapData, NULL);
+ psMapData, NULL);
return eError;
}
@@ -1067,8 +1078,14 @@ PVRSRV_ERROR PVRSRVMapDeviceMemoryKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
psMemInfo->pvSysBackupBuffer = NULL;
+ psMemInfo->ui32RefCount++;
+
psSrcMemInfo->ui32RefCount++;
+ BM_Export(psSrcMemInfo->sMemBlk.hBuffer);
+
+ psMemInfo->memType = PVRSRV_MEMTYPE_MAPPED;
+
psMapData->psMemInfo = psMemInfo;
psMapData->psSrcMemInfo = psSrcMemInfo;
@@ -1120,7 +1137,8 @@ static PVRSRV_ERROR UnmapDeviceClassMemoryCallBack(void *pvParam, u32 ui32Param)
{
PVRSRV_KERNEL_MEM_INFO *psMemInfo = pvParam;
- return FreeDeviceMem(psMemInfo);
+ return FreeMemCallBackCommon(psMemInfo, ui32Param, 1);
+
}
PVRSRV_ERROR PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
@@ -1247,6 +1265,10 @@ PVRSRV_ERROR PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
RESMAN_TYPE_DEVICECLASSMEM_MAPPING, psMemInfo, 0,
UnmapDeviceClassMemoryCallBack);
+ psMemInfo->ui32RefCount++;
+
+ psMemInfo->memType = PVRSRV_MEMTYPE_DEVICECLASS;
+
*ppsMemInfo = psMemInfo;
return PVRSRV_OK;
diff --git a/drivers/staging/ice4100/sgx535/common/queue.c b/drivers/staging/ice4100/sgx535/common/queue.c
index 10609208f07..7b653786f1d 100755
--- a/drivers/staging/ice4100/sgx535/common/queue.c
+++ b/drivers/staging/ice4100/sgx535/common/queue.c
@@ -805,6 +805,28 @@ PVRSRV_ERROR PVRSRVProcessQueues(u32 ui32CallerID, int bFlush)
return PVRSRV_OK;
}
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+void PVRSRVFreeCommandCompletePacketKM(void *CmdCookie, int bScheduleMISR)
+{
+ COMMAND_COMPLETE_DATA *psCmdCompleteData = (COMMAND_COMPLETE_DATA *)hCmdCookie;
+ SYS_DATA *psSysData;
+
+ SysAcquireData(&psSysData);
+
+ psCmdCompleteData->bInUse = 0;
+
+ PVRSRVCommandCompleteCallbacks();
+
+#if defined(SYS_USING_INTERRUPTS)
+ if(bScheduleMISR)
+ {
+ OSScheduleMISR(psSysData);
+ }
+#endif
+}
+
+#endif
+
void PVRSRVCommandCompleteKM(void *hCmdCookie, int bScheduleMISR)
{
u32 i;
diff --git a/drivers/staging/ice4100/sgx535/devices/sgx/sgxinit.c b/drivers/staging/ice4100/sgx535/devices/sgx/sgxinit.c
index 8430e1a09e5..5501ea3104d 100755
--- a/drivers/staging/ice4100/sgx535/devices/sgx/sgxinit.c
+++ b/drivers/staging/ice4100/sgx535/devices/sgx/sgxinit.c
@@ -345,15 +345,24 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO * psDevInfo)
MAKEUNIQUETAG(psSGXHostCtlMemInfo));
#endif
+#if defined(SGX_FEATURE_MULTI_EVENT_KICK)
+ OSWriteHWReg(psDevInfo->pvRegsBaseKM,
+ SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK2, 0),
+ EUR_CR_EVENT_KICK2_NOW_MASK);
+#else
*psDevInfo->pui32KernelCCBEventKicker =
(*psDevInfo->pui32KernelCCBEventKicker + 1) & 0xFF;
OSWriteHWReg(psDevInfo->pvRegsBaseKM,
SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK, 0),
EUR_CR_EVENT_KICK_NOW_MASK);
+#endif
#if defined(PDUMP)
if (bFirstTime) {
+#if defined(SGX_FEATURE_MULTI_EVENT_KICK)
+ PDUMPREG(SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK2, 0), EUR_CR_EVENT_KICK2_NOW_MASK);
+#else
psDevInfo->ui32KernelCCBEventKickerDumpVal = 1;
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
"First increment of the SGX event kicker value\n");
@@ -366,6 +375,7 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO * psDevInfo)
psKernelCCBEventKickerMemInfo));
PDUMPREG(SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK, 0),
EUR_CR_EVENT_KICK_NOW_MASK);
+#endif
bFirstTime = 0;
}
#endif
diff --git a/drivers/staging/ice4100/sgx535/hwdefs/sgxerrata.h b/drivers/staging/ice4100/sgx535/hwdefs/sgxerrata.h
index c77e1faeb29..c87701f49a3 100755
--- a/drivers/staging/ice4100/sgx535/hwdefs/sgxerrata.h
+++ b/drivers/staging/ice4100/sgx535/hwdefs/sgxerrata.h
@@ -192,6 +192,7 @@
#define FIX_HW_BRN_28011
#else
#if SGX_CORE_REV == 120
+ #define FIX_HW_BRN_26620
#define FIX_HW_BRN_28011
#else
#if SGX_CORE_REV == 121
diff --git a/drivers/staging/ice4100/sgx535/include/buffer_manager.h b/drivers/staging/ice4100/sgx535/include/buffer_manager.h
index 926d590643e..2642c687d1c 100755
--- a/drivers/staging/ice4100/sgx535/include/buffer_manager.h
+++ b/drivers/staging/ice4100/sgx535/include/buffer_manager.h
@@ -70,6 +70,7 @@ typedef struct _BM_BUF_
BM_MAPPING *pMapping;
u32 ui32RefCount;
+ u32 ui32ExportCount;
} BM_BUF;
struct _BM_HEAP_
@@ -205,6 +206,10 @@ PVRSRV_DEVICE_NODE* BM_GetDeviceNode(void * hDevMemContext);
void * BM_GetMappingHandle(PVRSRV_KERNEL_MEM_INFO *psMemInfo);
+void BM_Export(BM_HANDLE hBuf);
+
+void BM_FreeExport(BM_HANDLE hBuf, u32 ui32Flags);
+
#if defined(__cplusplus)
}
#endif
diff --git a/drivers/staging/ice4100/sgx535/include/kerneldisplay.h b/drivers/staging/ice4100/sgx535/include/kerneldisplay.h
index 941dc0378f8..e8dd3b8eff2 100755
--- a/drivers/staging/ice4100/sgx535/include/kerneldisplay.h
+++ b/drivers/staging/ice4100/sgx535/include/kerneldisplay.h
@@ -62,6 +62,7 @@ typedef PVRSRV_ERROR (*PFN_SWAP_TO_DC_BUFFER)(void *,
u32,
IMG_RECT*);
typedef PVRSRV_ERROR (*PFN_SWAP_TO_DC_SYSTEM)(void *, void *);
+typedef void (*PFN_QUERY_SWAP_COMMAND_ID)(void *, void *, void *, void *, u16*, int*);
typedef void (*PFN_SET_DC_STATE)(void *, u32);
typedef struct PVRSRV_DC_SRV2DISP_KMJTABLE_TAG
@@ -84,7 +85,7 @@ typedef struct PVRSRV_DC_SRV2DISP_KMJTABLE_TAG
PFN_SWAP_TO_DC_BUFFER pfnSwapToDCBuffer;
PFN_SWAP_TO_DC_SYSTEM pfnSwapToDCSystem;
PFN_SET_DC_STATE pfnSetDCState;
-
+ PFN_QUERY_SWAP_COMMAND_ID pfnQuerySwapCommandID;
} PVRSRV_DC_SRV2DISP_KMJTABLE;
typedef int (*PFN_ISR_HANDLER)(void*);
@@ -111,6 +112,7 @@ typedef struct PVRSRV_DC_DISP2SRV_KMJTABLE_TAG
PFN_DC_CMD_COMPLETE pfnPVRSRVCmdComplete;
PFN_DC_REGISTER_SYS_ISR pfnPVRSRVRegisterSystemISRHandler;
PFN_DC_REGISTER_POWER pfnPVRSRVRegisterPowerDevice;
+ PFN_DC_CMD_COMPLETE pfnPVRSRVFreeCmdCompletePacket;
} PVRSRV_DC_DISP2SRV_KMJTABLE, *PPVRSRV_DC_DISP2SRV_KMJTABLE;
diff --git a/drivers/staging/ice4100/sgx535/include/pvrversion.h b/drivers/staging/ice4100/sgx535/include/pvrversion.h
index 585e49b5d79..0f46d87697b 100755
--- a/drivers/staging/ice4100/sgx535/include/pvrversion.h
+++ b/drivers/staging/ice4100/sgx535/include/pvrversion.h
@@ -30,8 +30,8 @@
#define PVRVERSION_MAJ 1
#define PVRVERSION_MIN 5
#define PVRVERSION_BRANCH 15
-#define PVRVERSION_BUILD 3014
-#define PVRVERSION_STRING "1.5.15.3014"
+#define PVRVERSION_BUILD 3082
+#define PVRVERSION_STRING "1.5.15.3082"
#define PVRVERSION_FILE "eurasiacon.pj"
#endif
diff --git a/drivers/staging/ice4100/sgx535/include/servicesint.h b/drivers/staging/ice4100/sgx535/include/servicesint.h
index 3e3494555a5..759d07f995f 100755
--- a/drivers/staging/ice4100/sgx535/include/servicesint.h
+++ b/drivers/staging/ice4100/sgx535/include/servicesint.h
@@ -35,7 +35,15 @@
#define DRIVERNAME_MAXLENGTH (100)
-
+typedef enum _PVRSRV_MEMTYPE_
+{
+ PVRSRV_MEMTYPE_UNKNOWN = 0,
+ PVRSRV_MEMTYPE_DEVICE = 1,
+ PVRSRV_MEMTYPE_DEVICECLASS = 2,
+ PVRSRV_MEMTYPE_WRAPPED = 3,
+ PVRSRV_MEMTYPE_MAPPED = 4,
+}
+PVRSRV_MEMTYPE;
typedef struct _PVRSRV_KERNEL_MEM_INFO_
{
@@ -77,6 +85,8 @@ typedef struct _PVRSRV_KERNEL_MEM_INFO_
struct _PVRSRV_KERNEL_SYNC_INFO_ *psKernelSyncInfo;
+ PVRSRV_MEMTYPE memType;
+
} PVRSRV_KERNEL_MEM_INFO;
diff --git a/drivers/staging/ice4100/sgx535/include/sgx_mkif_km.h b/drivers/staging/ice4100/sgx535/include/sgx_mkif_km.h
index 6a1ed5c21b5..951341a6dea 100755
--- a/drivers/staging/ice4100/sgx535/include/sgx_mkif_km.h
+++ b/drivers/staging/ice4100/sgx535/include/sgx_mkif_km.h
@@ -289,7 +289,7 @@ typedef struct _SGXMKIF_HWDEVICE_SYNC_LIST_
#define PVRSRV_USSE_MISCINFO_MEMREAD 0x4UL
#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL 0x1UL << 31;
+#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL 0x1UL << 31
#endif
#endif
diff --git a/drivers/staging/ice4100/sgx535/pvr_bridge_k.c b/drivers/staging/ice4100/sgx535/pvr_bridge_k.c
index edca959b2cb..df57264afa8 100755
--- a/drivers/staging/ice4100/sgx535/pvr_bridge_k.c
+++ b/drivers/staging/ice4100/sgx535/pvr_bridge_k.c
@@ -247,15 +247,9 @@ unlock_and_return:
#endif
#if defined(SUPPORT_DRI_DRM)
-#if defined(INTEL_D3_CHANGES) && (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,23))
-int
-PVRSRV_BridgeDispatchKM(struct inode *pInode, struct file *pFile,
- u32 unref__ ioctlCmd, u32 arg)
-#else
int
PVRSRV_BridgeDispatchKM(struct drm_device *dev, void *arg,
struct drm_file *pFile)
-#endif
#else
int PVRSRV_BridgeDispatchKM(struct file *pFile, u32 unref__ ioctlCmd, u32 arg)
#endif
diff --git a/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/graphics_pm.c b/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/graphics_pm.c
index 6a98217b4a0..e1836177685 100755
--- a/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/graphics_pm.c
+++ b/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/graphics_pm.c
@@ -85,6 +85,20 @@ static int graphics_pm_suspend(struct pci_dev *dev, pm_message_t state)
rc = GRAPHICS_PM_ERR_FAILED;
}
+ if(GRAPHICS_PM_OK == rc)
+ {
+ icepm_ret_t icepm_rc = ICEPM_OK;
+ icepm_rc = icepm_set_power_state(GRAPHICS_PM_COMPONENT_NAME,
+ ICEPM_D3);
+ if(ICEPM_OK != icepm_rc)
+ {
+ GRAPHICS_PM_DEBUG_PRINT ("graphics_pm_suspend: icepm_set_power_state %d\n",icepm_rc);
+ rc = GRAPHICS_PM_ERR_FAILED;
+ // Ignore error from icepm_set_power_state
+ rc = GRAPHICS_PM_OK;
+ }
+ }
+
if (GRAPHICS_PM_OK == rc) {
graphics_pm_state = GRAPHICS_PM_STATE_SUSPENDED;
}
@@ -114,9 +128,25 @@ static int graphics_pm_resume(struct pci_dev *dev)
if (GRAPHICS_PM_STATE_UNINITIALIZED != graphics_pm_state) {
os_sema_get(&graphics_pm_semaphore);
if (GRAPHICS_PM_STATE_SUSPENDED == graphics_pm_state) {
- if (PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D0) !=
- PVRSRV_OK) {
- rc = GRAPHICS_PM_ERR_FAILED;
+ {
+ icepm_ret_t icepm_rc = ICEPM_OK;
+ icepm_rc = icepm_set_power_state(GRAPHICS_PM_COMPONENT_NAME,.
+ ICEPM_D0);
+ if(ICEPM_OK != icepm_rc)
+ {
+ GRAPHICS_PM_DEBUG_PRINT ("graphics_pm_resume: icepm_set_power_state %d\n",icepm_rc);
+ rc = GRAPHICS_PM_ERR_FAILED;
+ // Ignore error from icepm_set_power_state
+ rc = GRAPHICS_PM_OK;
+ }
+ }
+
+ if(GRAPHICS_PM_OK == rc).
+ {
+ if(PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D0) != PVRSRV_OK)
+ {
+ rc = GRAPHICS_PM_ERR_FAILED;
+ }
}
if (GRAPHICS_PM_OK == rc) {
@@ -134,7 +164,7 @@ static int graphics_pm_resume(struct pci_dev *dev)
ret_val = -EBUSY;
}
- GRAPHICS_PM_DEBUG_PRINT("graphics_pm_resume: Goodbye\n");
+ GRAPHICS_PM_DEBUG_PRINT ("graphics_pm_resume: Goodbye %d\n", ret_val);
return ret_val;
}
diff --git a/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/sysconfig.c b/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/sysconfig.c
index ad2d0196ae5..08363df0267 100755
--- a/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/sysconfig.c
+++ b/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/sysconfig.c
@@ -49,6 +49,8 @@
#include "graphics_pm.h"
#endif
+#include "linux/pci.h"
+
#define SYS_SGX_CLOCK_SPEED (400000000)
#define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ (100)
#define SYS_SGX_PDS_TIMER_FREQ (1000)
@@ -67,10 +69,56 @@ extern struct pci_dev *gpsPVRLDMDev;
#endif
u32 PVRSRV_BridgeDispatchKM(u32 Ioctl,
- unsigned char * pInBuf,
- u32 InBufLen,
- unsigned char * pOutBuf,
- u32 OutBufLen, u32 * pdwBytesTransferred);
+ unsigned char * pInBuf,
+ u32 InBufLen,
+ unsigned char * pOutBuf,
+ u32 OutBufLen, u32 * pdwBytesTransferred);
+
+static PVRSRV_ERROR InitSGXPCIDev(SYS_DATA *psSysData)
+{
+ SYS_SPECIFIC_DATA *psSysSpecData = (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
+
+ struct pci_dev *psPCIDev = NULL;
+ psPCIDev = pci_get_device(SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV_DEVICE_ID, NULL);
+ if (psPCIDev != NULL)
+ {
+ if (pci_enable_device(psPCIDev))
+ goto init_failed;
+
+ psSysSpecData->psSGXPCIDev = psPCIDev;
+
+ return PVRSRV_OK;
+ }
+
+init_failed:
+ psSysSpecData->psSGXPCIDev = NULL;
+ PVR_DPF((PVR_DBG_ERROR,"InitSGXPCIDev: failed to initialize the sgx PCI device!\n"));
+ return PVRSRV_ERROR_GENERIC;
+}
+
+static void DeinitSGXPCIDev(SYS_DATA *psSysData)
+{
+ SYS_SPECIFIC_DATA *psSysSpecData = (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
+
+ if (psSysSpecData->psSGXPCIDev != NULL)
+ {
+ pci_disable_device(psSysSpecData->psSGXPCIDev);
+ }
+}
+
+static PVRSRV_ERROR GetSGXPCIDevIRQ(SYS_DATA *psSysData, u32 *pui32IRQ)
+{
+ SYS_SPECIFIC_DATA *psSysSpecData = (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
+
+ if (psSysSpecData->psSGXPCIDev != NULL)
+ {
+ *pui32IRQ = psSysSpecData->psSGXPCIDev->irq;
+ return PVRSRV_OK;
+ }
+
+ return PVRSRV_ERROR_GENERIC;
+}
+
static PVRSRV_ERROR SysLocateDevices(SYS_DATA * psSysData)
{
@@ -88,14 +136,14 @@ static PVRSRV_ERROR SysLocateDevices(SYS_DATA * psSysData)
#define BAR0 0x10
-#define IRQ_LINE 0x3C
-#define IRQ_LINE_MASK 0xFF
-
ui32SGXRegBaseAddr = OSPCIReadDword(SGX_PCI_BUS,
SGX_PCI_DEV, SGX_PCI_FN, BAR0);
- ui32IRQ = OSPCIReadDword(SGX_PCI_BUS,
- SGX_PCI_DEV,
- SGX_PCI_FN, IRQ_LINE) & IRQ_LINE_MASK;
+ if(GetSGXPCIDevIRQ(psSysData, &ui32IRQ) != PVRSRV_OK)
+ {
+ PVR_DPF((PVR_DBG_ERROR, "sysLocateDevices: failed to get the pci IRQ!"));
+ return PVRSRV_ERROR_INVALID_DEVICE;
+ }
+
#endif
// This address was only ever used in the addr translation functions. We took
@@ -171,6 +219,15 @@ PVRSRV_ERROR SysInitialise(void)
SYS_SGX_ACTIVE_POWER_LATENCY_MS;
psTimingInfo->ui32uKernelFreq = SYS_SGX_PDS_TIMER_FREQ;
+ eError = InitSGXPCIDev(gpsSysData);
+ if (eError != PVRSRV_OK)
+ {
+ SysDeinitialise(gpsSysData);
+ gpsSysData = NULL;
+ return eError;
+ }
+
+
SYS_SPECIFIC_DATA_SET(&gsSysSpecificData,
SYS_SPECIFIC_DATA_ENABLE_PCINIT);
@@ -435,6 +492,8 @@ PVRSRV_ERROR SysDeinitialise(SYS_DATA * psSysData)
SysDeinitialiseCommon(gpsSysData);
+ DeinitSGXPCIDev(gpsSysData);
+
if (SYS_SPECIFIC_DATA_TEST
(psSysSpecData, SYS_SPECIFIC_DATA_ENABLE_ENVDATA)) {
eError = OSDeInitEnvData(gpsSysData->pvEnvSpecificData);
diff --git a/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/syslocal.h b/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/syslocal.h
index 121b7387587..5424d581ea1 100755
--- a/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/syslocal.h
+++ b/drivers/staging/ice4100/sgx535/system/sgx_intel_ce/syslocal.h
@@ -75,6 +75,9 @@ char *SysCreateVersionString(IMG_CPU_PHYADDR sRegRegion);
typedef struct _SYS_SPECIFIC_DATA_TAG_
{
u32 ui32SysSpecificData;
+
+ struct pci_dev *psSGXPCIDev;
+
#ifdef LDM_PCI
struct pci_dev *psPCIDev;
#endif