diff options
author | Imagination Technologies Ltd <gpl-support@imgtec.com> | 2011-07-07 19:16:26 +0100 |
---|---|---|
committer | Rebecca Schultz Zavin <rebecca@android.com> | 2011-07-11 17:03:21 -0700 |
commit | ee6f8c4f76688cfcc949fb91066b9faa507685a5 (patch) | |
tree | 2029b582c7c68aca1b9b02dc495e8948ec1f480c /drivers/gpu | |
parent | f8601b516878023731fc3500ee12e714dfe2eb5b (diff) | |
download | kernel_samsung_tuna-ee6f8c4f76688cfcc949fb91066b9faa507685a5.zip kernel_samsung_tuna-ee6f8c4f76688cfcc949fb91066b9faa507685a5.tar.gz kernel_samsung_tuna-ee6f8c4f76688cfcc949fb91066b9faa507685a5.tar.bz2 |
gpu: pvr: Update to DDK 1.8.18.791
File descriptors representing exported device memory are now backed by
the original meminfo for their entire lifetime (fixes IPGear 14352).
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/pvr/devicemem.c | 90 | ||||
-rw-r--r-- | drivers/gpu/pvr/module.c | 34 | ||||
-rw-r--r-- | drivers/gpu/pvr/pdump.c | 2 | ||||
-rw-r--r-- | drivers/gpu/pvr/pvr_bridge_k.c | 15 | ||||
-rw-r--r-- | drivers/gpu/pvr/pvrversion.h | 32 | ||||
-rw-r--r-- | drivers/gpu/pvr/servicesint.h | 15 |
6 files changed, 130 insertions, 58 deletions
diff --git a/drivers/gpu/pvr/devicemem.c b/drivers/gpu/pvr/devicemem.c index bdd6dcb..79324ad 100644 --- a/drivers/gpu/pvr/devicemem.c +++ b/drivers/gpu/pvr/devicemem.c @@ -426,7 +426,7 @@ static PVRSRV_ERROR AllocDeviceMem(IMG_HANDLE hDevCookie, return (PVRSRV_OK); } -static PVRSRV_ERROR FreeDeviceMem2(PVRSRV_KERNEL_MEM_INFO *psMemInfo, IMG_BOOL bFromAllocator) +static PVRSRV_ERROR FreeDeviceMem2(PVRSRV_KERNEL_MEM_INFO *psMemInfo, PVRSRV_FREE_CALLBACK_ORIGIN eCallbackOrigin) { BM_HANDLE hBuffer; @@ -438,13 +438,21 @@ static PVRSRV_ERROR FreeDeviceMem2(PVRSRV_KERNEL_MEM_INFO *psMemInfo, IMG_BOOL b hBuffer = psMemInfo->sMemBlk.hBuffer; - if (bFromAllocator) - BM_Free(hBuffer, psMemInfo->ui32Flags); - else - BM_FreeExport(hBuffer, psMemInfo->ui32Flags); + switch(eCallbackOrigin) + { + case PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR: + BM_Free(hBuffer, psMemInfo->ui32Flags); + break; + case PVRSRV_FREE_CALLBACK_ORIGIN_IMPORTER: + BM_FreeExport(hBuffer, psMemInfo->ui32Flags); + break; + default: + break; + } - if ((psMemInfo->pvSysBackupBuffer) && bFromAllocator) + if (psMemInfo->pvSysBackupBuffer && + eCallbackOrigin == PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR) { OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, psMemInfo->uAllocSize, psMemInfo->pvSysBackupBuffer, IMG_NULL); @@ -716,9 +724,10 @@ static PVRSRV_ERROR FlushKernelOps(PVRSRV_SYNC_DATA *psSyncData) } #endif -static PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo, - IMG_UINT32 ui32Param, - IMG_BOOL bFromAllocator) +IMG_EXPORT +PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo, + IMG_UINT32 ui32Param, + PVRSRV_FREE_CALLBACK_ORIGIN eCallbackOrigin) { PVRSRV_ERROR eError = PVRSRV_OK; @@ -728,39 +737,38 @@ static PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo, psMemInfo->ui32RefCount--; - if(((psMemInfo->ui32Flags & PVRSRV_MEM_EXPORTED) != 0) && (bFromAllocator == IMG_TRUE)) + if (psMemInfo->ui32RefCount == 0) { + if((psMemInfo->ui32Flags & PVRSRV_MEM_EXPORTED) != 0) + { #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hMemInfo = 0; + IMG_SID hMemInfo = 0; #else - IMG_HANDLE hMemInfo = IMG_NULL; + IMG_HANDLE hMemInfo = IMG_NULL; #endif - - eError = PVRSRVFindHandle(KERNEL_HANDLE_BASE, - &hMemInfo, - psMemInfo, - PVRSRV_HANDLE_TYPE_MEM_INFO); - if(eError != PVRSRV_OK) - { - PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: can't find exported meminfo in the global handle list")); - return eError; - } + + eError = PVRSRVFindHandle(KERNEL_HANDLE_BASE, + &hMemInfo, + psMemInfo, + PVRSRV_HANDLE_TYPE_MEM_INFO); + if(eError != PVRSRV_OK) + { + PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: can't find exported meminfo in the global handle list")); + return eError; + } - - eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, - hMemInfo, - PVRSRV_HANDLE_TYPE_MEM_INFO); - if(eError != PVRSRV_OK) - { - PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: PVRSRVReleaseHandle failed for exported meminfo")); - return eError; + + eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + hMemInfo, + PVRSRV_HANDLE_TYPE_MEM_INFO); + if(eError != PVRSRV_OK) + { + PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: PVRSRVReleaseHandle failed for exported meminfo")); + return eError; + } } - } - - if (psMemInfo->ui32RefCount == 0) - { #if defined (PVRSRV_FLUSH_KERNEL_OPS_LAST_ONLY) if (psMemInfo->psKernelSyncInfo) { @@ -796,7 +804,7 @@ static PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo, if (eError == PVRSRV_OK) { - eError = FreeDeviceMem2(psMemInfo, bFromAllocator); + eError = FreeDeviceMem2(psMemInfo, eCallbackOrigin); } return eError; @@ -810,7 +818,8 @@ static PVRSRV_ERROR FreeDeviceMemCallBack(IMG_PVOID pvParam, PVR_UNREFERENCED_PARAMETER(bDummy); - return FreeMemCallBackCommon(psMemInfo, ui32Param, IMG_TRUE); + return FreeMemCallBackCommon(psMemInfo, ui32Param, + PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR); } @@ -1008,7 +1017,8 @@ static PVRSRV_ERROR UnwrapExtMemoryCallBack(IMG_PVOID pvParam, PVR_UNREFERENCED_PARAMETER(bDummy); - return FreeMemCallBackCommon(psMemInfo, ui32Param, IMG_TRUE); + return FreeMemCallBackCommon(psMemInfo, ui32Param, + PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR); } @@ -1293,7 +1303,8 @@ static PVRSRV_ERROR UnmapDeviceMemoryCallBack(IMG_PVOID pvParam, } - eError = FreeMemCallBackCommon(psMapData->psSrcMemInfo, 0, IMG_FALSE); + eError = FreeMemCallBackCommon(psMapData->psSrcMemInfo, 0, + PVRSRV_FREE_CALLBACK_ORIGIN_IMPORTER); OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_MAP_DEVICE_MEM_DATA), psMapData, IMG_NULL); @@ -1535,7 +1546,8 @@ static PVRSRV_ERROR UnmapDeviceClassMemoryCallBack(IMG_PVOID pvParam, OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_MAPINFO), psDCMapInfo, IMG_NULL); - return FreeMemCallBackCommon(psMemInfo, ui32Param, IMG_TRUE); + return FreeMemCallBackCommon(psMemInfo, ui32Param, + PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR); } diff --git a/drivers/gpu/pvr/module.c b/drivers/gpu/pvr/module.c index 1acbc36..1cb9adf 100644 --- a/drivers/gpu/pvr/module.c +++ b/drivers/gpu/pvr/module.c @@ -484,6 +484,7 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile) #endif { PVRSRV_FILE_PRIVATE_DATA *psPrivateData; + int err = 0; LinuxLockMutex(&gPVRSRVLock); @@ -498,6 +499,31 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile) list_del(&psPrivateData->sDRMAuthListItem); #endif + if(psPrivateData->hKernelMemInfo) + { + PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo; + + + if(PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_PVOID *)&psKernelMemInfo, + psPrivateData->hKernelMemInfo, + PVRSRV_HANDLE_TYPE_MEM_INFO) != PVRSRV_OK) + { + PVR_DPF((PVR_DBG_ERROR, "%s: Failed to look up export handle", __FUNCTION__)); + err = -EFAULT; + goto err_unlock; + } + + + if(FreeMemCallBackCommon(psKernelMemInfo, 0, + PVRSRV_FREE_CALLBACK_ORIGIN_EXTERNAL) != PVRSRV_OK) + { + PVR_DPF((PVR_DBG_ERROR, "%s: FreeMemCallBackCommon failed", __FUNCTION__)); + err = -EFAULT; + goto err_unlock; + } + } + gui32ReleasePID = psPrivateData->ui32OpenPID; PVRSRVProcessDisconnect(psPrivateData->ui32OpenPID); @@ -512,10 +538,12 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile) #endif } +err_unlock: LinuxUnLockMutex(&gPVRSRVLock); - -#if !defined(SUPPORT_DRI_DRM) - return 0; +#if defined(SUPPORT_DRI_DRM) + return; +#else + return err; #endif } diff --git a/drivers/gpu/pvr/pdump.c b/drivers/gpu/pvr/pdump.c index 99c6dc3..13d9b0d 100644 --- a/drivers/gpu/pvr/pdump.c +++ b/drivers/gpu/pvr/pdump.c @@ -431,7 +431,7 @@ IMG_VOID PDumpInit(IMG_VOID) } PDUMPCOMMENT("Driver Product Name: %s", VS_PRODUCT_NAME); - PDUMPCOMMENT("Driver Product Version: %s (%s)", PVRVERSION_STRING, PVRVERSION_FILE); + PDUMPCOMMENT("Driver Product Version: %s (%s)", PVRVERSION_STRING, PVRVERSION_FAMILY); PDUMPCOMMENT("Start of Init Phase"); } diff --git a/drivers/gpu/pvr/pvr_bridge_k.c b/drivers/gpu/pvr/pvr_bridge_k.c index e433269..ab70f04 100644 --- a/drivers/gpu/pvr/pvr_bridge_k.c +++ b/drivers/gpu/pvr/pvr_bridge_k.c @@ -376,6 +376,21 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM *psExportDeviceMemOUT = (PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM *)psBridgePackageKM->pvParamOut; PVRSRV_FILE_PRIVATE_DATA *psPrivateData = PRIVATE_DATA(pFile); + PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo; + + + if(PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_PVOID *)&psKernelMemInfo, + psExportDeviceMemOUT->hMemInfo, + PVRSRV_HANDLE_TYPE_MEM_INFO) != PVRSRV_OK) + { + PVR_DPF((PVR_DBG_ERROR, "%s: Failed to look up export handle", __FUNCTION__)); + err = -EFAULT; + goto unlock_and_return; + } + + + psKernelMemInfo->ui32RefCount++; psPrivateData->hKernelMemInfo = psExportDeviceMemOUT->hMemInfo; #if defined(SUPPORT_MEMINFO_IDS) diff --git a/drivers/gpu/pvr/pvrversion.h b/drivers/gpu/pvr/pvrversion.h index 215313b..456b89e 100644 --- a/drivers/gpu/pvr/pvrversion.h +++ b/drivers/gpu/pvr/pvrversion.h @@ -22,28 +22,30 @@ * Imagination Technologies Ltd. <gpl-support@imgtec.com> * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK * - ******************************************************************************/ +*/ /**************************************************************************/ #ifndef _PVRVERSION_H_ #define _PVRVERSION_H_ -#include "staticversion.h" +#define PVR_STR(X) #X +#define PVR_STR2(X) PVR_STR(X) -#define PVRVERSION_BRANCHNAME "pj:1.8.18" -#define PVRVERSION_BUILD 791 -#define PVRVERSION_BSCONTROL "Internal" +#define PVRVERSION_MAJ 1 +#define PVRVERSION_MIN 8 +#define PVRVERSION_BRANCH 18 -#define PVRVERSION_STRING "1.8.18.791" +#define PVRVERSION_FAMILY "eurasiacon.pj" +#define PVRVERSION_BRANCHNAME "1.8.18" +#define PVRVERSION_BUILD 829 +#define PVRVERSION_BSCONTROL "Unknown" -#define PVRVERSION_FILE "eurasiacon.pj" +#define PVRVERSION_STRING "1.8.18." PVR_STR2(PVRVERSION_BUILD) +#define PVRVERSION_STRING_SHORT "1.8.18." PVR_STR2(PVRVERSION_BUILD) -#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd." +#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved." -#define PVRVERSION_MM32B "1.8.18.791" - -#define PVRVERSION_BUILD_LO 791 -#define PVRVERSION_BUILD_HI 18 - - -#endif +#define PVRVERSION_BUILD_HI 18 +#define PVRVERSION_BUILD_LO 829 +#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO) +#endif /* _PVRVERSION_H_ */ diff --git a/drivers/gpu/pvr/servicesint.h b/drivers/gpu/pvr/servicesint.h index ff2c3bd..66bb7da 100644 --- a/drivers/gpu/pvr/servicesint.h +++ b/drivers/gpu/pvr/servicesint.h @@ -304,6 +304,21 @@ typedef struct PVRSRV_CLIENT_DEVICECLASS_INFO_TAG } PVRSRV_CLIENT_DEVICECLASS_INFO; +typedef enum +{ + PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR, + PVRSRV_FREE_CALLBACK_ORIGIN_IMPORTER, + PVRSRV_FREE_CALLBACK_ORIGIN_EXTERNAL, +} +PVRSRV_FREE_CALLBACK_ORIGIN; + + +IMG_IMPORT +PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo, + IMG_UINT32 ui32Param, + PVRSRV_FREE_CALLBACK_ORIGIN eCallbackOrigin); + + #ifdef INLINE_IS_PRAGMA #pragma inline(PVRSRVGetWriteOpsPending) #endif |