diff options
| author | Wengang Wu <wgw@motorola.com> | 2014-05-21 09:29:41 -0500 |
|---|---|---|
| committer | Wengang Wu <wgw@motorola.com> | 2014-05-21 09:29:41 -0500 |
| commit | 53a835f5057367679eb3db728bbdd427aab8aa8a (patch) | |
| tree | 03e5bbde7d371e885d1c67210b2b0c9bb0130d40 /drivers/gpu/pvr/services4/srvkm/env/linux/mm.h | |
| parent | 7489b569ffb64cdb998544405b6774bd43aab70b (diff) | |
| download | olio-linux-3.10-53a835f5057367679eb3db728bbdd427aab8aa8a.tar.xz olio-linux-3.10-53a835f5057367679eb3db728bbdd427aab8aa8a.zip | |
IKXCLOCK-1501 Upgrade to TI SGX Android OpenGL 1.12@2701748
Initial codes of TI SGX DDK 1.12@2701748
Change-Id: I75a8f6521968346ea1b2ea9fa54817ba186442ce
Diffstat (limited to 'drivers/gpu/pvr/services4/srvkm/env/linux/mm.h')
| -rwxr-xr-x[-rw-r--r--] | drivers/gpu/pvr/services4/srvkm/env/linux/mm.h | 146 |
1 files changed, 36 insertions, 110 deletions
diff --git a/drivers/gpu/pvr/services4/srvkm/env/linux/mm.h b/drivers/gpu/pvr/services4/srvkm/env/linux/mm.h index 6801df466e7..933420deb40 100644..100755 --- a/drivers/gpu/pvr/services4/srvkm/env/linux/mm.h +++ b/drivers/gpu/pvr/services4/srvkm/env/linux/mm.h @@ -88,7 +88,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #endif -static inline IMG_UINT32 VMallocToPhys(IMG_VOID *pCpuVAddr) +static inline IMG_UINTPTR_T VMallocToPhys(IMG_VOID *pCpuVAddr) { return (page_to_phys(vmalloc_to_page(pCpuVAddr)) + ADDR_TO_PAGE_OFFSET(pCpuVAddr)); @@ -101,7 +101,6 @@ typedef enum { LINUX_MEM_AREA_VMALLOC, LINUX_MEM_AREA_ALLOC_PAGES, LINUX_MEM_AREA_SUB_ALLOC, - LINUX_MEM_AREA_ION, #if defined(PVR_LINUX_MEM_AREA_USE_VMAP) LINUX_MEM_AREA_VMAP, #endif @@ -161,25 +160,16 @@ struct _LinuxMemArea { struct page **ppsPageList; IMG_HANDLE hBlockPageList; }sPageList; - struct _sIONTilerAlloc - { - /* Note the memory this represents _is_ implicitly - * page aligned _and_ so is its size */ - IMG_CPU_PHYADDR *pCPUPhysAddrs; - IMG_UINT32 ui32NumValidPlanes; - struct ion_handle *psIONHandle[PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES]; - IMG_UINT32 planeOffsets[PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES]; - }sIONTilerAlloc; struct _sSubAlloc { /* Note: The memory this represents is _not_ implicitly * page aligned, neither is its size */ LinuxMemArea *psParentLinuxMemArea; - IMG_UINT32 ui32ByteOffset; + IMG_UINTPTR_T uiByteOffset; }sSubAlloc; }uData; - IMG_UINT32 ui32ByteSize; /* Size of memory area */ + IMG_SIZE_T uiByteSize; /* Size of memory area */ IMG_UINT32 ui32AreaFlags; /* Flags passed at creation time */ @@ -241,16 +231,16 @@ IMG_VOID LinuxMMCleanup(IMG_VOID); * They can also be used as more concise replacements for OSAllocMem * in Linux specific code. * - * @param ui32ByteSize + * @param uByteSize * * @return ******************************************************************************/ #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS) -#define KMallocWrapper(ui32ByteSize, uFlags) _KMallocWrapper(ui32ByteSize, uFlags, __FILE__, __LINE__) +#define KMallocWrapper(uByteSize, uFlags) _KMallocWrapper(uByteSize, uFlags, __FILE__, __LINE__) #else -#define KMallocWrapper(ui32ByteSize, uFlags) _KMallocWrapper(ui32ByteSize, uFlags, NULL, 0) +#define KMallocWrapper(uByteSize, uFlags) _KMallocWrapper(uByteSize, uFlags, NULL, 0) #endif -IMG_VOID *_KMallocWrapper(IMG_UINT32 ui32ByteSize, gfp_t uFlags, IMG_CHAR *szFileName, IMG_UINT32 ui32Line); +IMG_VOID *_KMallocWrapper(IMG_SIZE_T uByteSize, gfp_t uFlags, IMG_CHAR *szFileName, IMG_UINT32 ui32Line); /*! @@ -273,17 +263,17 @@ IMG_VOID _KFreeWrapper(IMG_VOID *pvCpuVAddr, IMG_CHAR *pszFileName, IMG_UINT32 u ******************************************************************************* * @brief * - * @param ui32Bytes + * @param uBytes * @param ui32AllocFlags * * @return ******************************************************************************/ #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS) -#define VMallocWrapper(ui32Bytes, ui32AllocFlags) _VMallocWrapper(ui32Bytes, ui32AllocFlags, __FILE__, __LINE__) +#define VMallocWrapper(uiBytes, ui32AllocFlags) _VMallocWrapper(uiBytes, ui32AllocFlags, __FILE__, __LINE__) #else -#define VMallocWrapper(ui32Bytes, ui32AllocFlags) _VMallocWrapper(ui32Bytes, ui32AllocFlags, NULL, 0) +#define VMallocWrapper(uiBytes, ui32AllocFlags) _VMallocWrapper(uiBytes, ui32AllocFlags, NULL, 0) #endif -IMG_VOID *_VMallocWrapper(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AllocFlags, IMG_CHAR *pszFileName, IMG_UINT32 ui32Line); +IMG_VOID *_VMallocWrapper(IMG_SIZE_T uiBytes, IMG_UINT32 ui32AllocFlags, IMG_CHAR *pszFileName, IMG_UINT32 ui32Line); /*! @@ -306,12 +296,12 @@ IMG_VOID _VFreeWrapper(IMG_VOID *pvCpuVAddr, IMG_CHAR *pszFileName, IMG_UINT32 u ******************************************************************************* * @brief Allocates virtually contiguous pages * - * @param ui32Bytes number of bytes to reserve + * @param uBytes number of bytes to reserve * @param ui32AreaFlags Heap caching and mapping Flags * * @return Page-aligned address of virtual allocation or NULL on error ******************************************************************************/ -LinuxMemArea *NewVMallocLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags); +LinuxMemArea *NewVMallocLinuxMemArea(IMG_SIZE_T uBytes, IMG_UINT32 ui32AreaFlags); /*! @@ -329,20 +319,20 @@ IMG_VOID FreeVMallocLinuxMemArea(LinuxMemArea *psLinuxMemArea); * @brief Reserve physical IO memory and create a CPU virtual mapping for it * * @param BasePAddr - * @param ui32Bytes + * @param uiBytes * @param ui32MappingFlags * * @return ******************************************************************************/ #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS) -#define IORemapWrapper(BasePAddr, ui32Bytes, ui32MappingFlags) \ - _IORemapWrapper(BasePAddr, ui32Bytes, ui32MappingFlags, __FILE__, __LINE__) +#define IORemapWrapper(BasePAddr, uiBytes, ui32MappingFlags) \ + _IORemapWrapper(BasePAddr, uiBytes, ui32MappingFlags, __FILE__, __LINE__) #else -#define IORemapWrapper(BasePAddr, ui32Bytes, ui32MappingFlags) \ - _IORemapWrapper(BasePAddr, ui32Bytes, ui32MappingFlags, NULL, 0) +#define IORemapWrapper(BasePAddr, uiBytes, ui32MappingFlags) \ + _IORemapWrapper(BasePAddr, uiBytes, ui32MappingFlags, NULL, 0) #endif IMG_VOID *_IORemapWrapper(IMG_CPU_PHYADDR BasePAddr, - IMG_UINT32 ui32Bytes, + IMG_SIZE_T uiBytes, IMG_UINT32 ui32MappingFlags, IMG_CHAR *pszFileName, IMG_UINT32 ui32Line); @@ -353,12 +343,12 @@ IMG_VOID *_IORemapWrapper(IMG_CPU_PHYADDR BasePAddr, * @brief Reserve physical IO memory and create a CPU virtual mapping for it * * @param BasePAddr - * @param ui32Bytes + * @param uiBytes * @param ui32AreaFlags Heap caching and mapping Flags * * @return ******************************************************************************/ -LinuxMemArea *NewIORemapLinuxMemArea(IMG_CPU_PHYADDR BasePAddr, IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags); +LinuxMemArea *NewIORemapLinuxMemArea(IMG_CPU_PHYADDR BasePAddr, IMG_SIZE_T uiBytes, IMG_UINT32 ui32AreaFlags); /*! @@ -378,12 +368,12 @@ IMG_VOID FreeIORemapLinuxMemArea(LinuxMemArea *psLinuxMemArea); * @param pBasePAddr * @param pvCPUVAddr * @param bPhysContig - * @param ui32Bytes + * @param uBytes * @param ui32AreaFlags Heap caching and mapping Flags * * @return ******************************************************************************/ -LinuxMemArea *NewExternalKVLinuxMemArea(IMG_SYS_PHYADDR *pBasePAddr, IMG_VOID *pvCPUVAddr, IMG_UINT32 ui32Bytes, IMG_BOOL bPhysContig, IMG_UINT32 ui32AreaFlags); +LinuxMemArea *NewExternalKVLinuxMemArea(IMG_SYS_PHYADDR *pBasePAddr, IMG_VOID *pvCPUVAddr, IMG_SIZE_T uBytes, IMG_BOOL bPhysContig, IMG_UINT32 ui32AreaFlags); /*! @@ -420,11 +410,11 @@ IMG_VOID _IOUnmapWrapper(IMG_VOID *pvIORemapCookie, IMG_CHAR *pszFileName, IMG_U * @brief * * @param psLinuxMemArea - * @param ui32ByteOffset + * @param uByteOffset * * @return ******************************************************************************/ -struct page *LinuxMemAreaOffsetToPage(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32ByteOffset); +struct page *LinuxMemAreaOffsetToPage(LinuxMemArea *psLinuxMemArea, IMG_UINTPTR_T uByteOffset); /*! @@ -506,12 +496,12 @@ const IMG_CHAR *KMemCacheNameWrapper(LinuxKMemCache *psCache); * @brief * * @param BasePAddr - * @param ui32Bytes + * @param uiBytes * @param ui32AreaFlags Heap caching and mapping Flags * * @return ******************************************************************************/ -LinuxMemArea *NewIOLinuxMemArea(IMG_CPU_PHYADDR BasePAddr, IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags); +LinuxMemArea *NewIOLinuxMemArea(IMG_CPU_PHYADDR BasePAddr, IMG_SIZE_T uiBytes, IMG_UINT32 ui32AreaFlags); /*! @@ -529,12 +519,12 @@ IMG_VOID FreeIOLinuxMemArea(LinuxMemArea *psLinuxMemArea); ******************************************************************************* * @brief * - * @param ui32Bytes + * @param uiBytes * @param ui32AreaFlags E.g Heap caching and mapping Flags * * @return ******************************************************************************/ -LinuxMemArea *NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags); +LinuxMemArea *NewAllocPagesLinuxMemArea(IMG_SIZE_T uiBytes, IMG_UINT32 ui32AreaFlags); /*! @@ -548,83 +538,19 @@ LinuxMemArea *NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32Are IMG_VOID FreeAllocPagesLinuxMemArea(LinuxMemArea *psLinuxMemArea); -#if defined(CONFIG_ION_OMAP) - -/*! - ******************************************************************************* - * @brief - * - * @param ui32Bytes - * @param ui32AreaFlags E.g Heap caching and mapping Flags - * - * @return - ******************************************************************************/ -LinuxMemArea * -NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags, - IMG_PVOID pvPrivData, IMG_UINT32 ui32PrivDataLength); - - -/*! - ******************************************************************************* - * @brief - * - * @param psLinuxMemArea - * - * @return - ******************************************************************************/ -IMG_VOID FreeIONLinuxMemArea(LinuxMemArea *psLinuxMemArea); - -IMG_INT32 -GetIONLinuxMemAreaInfo(LinuxMemArea *psLinuxMemArea, IMG_UINT32* ui32AddressOffsets, - IMG_UINT32* ui32NumAddr); - -#else /* defined(CONFIG_ION_OMAP) */ - -static inline LinuxMemArea * -NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags, - IMG_PVOID pvPrivData, IMG_UINT32 ui32PrivDataLength) -{ - PVR_UNREFERENCED_PARAMETER(ui32Bytes); - PVR_UNREFERENCED_PARAMETER(ui32AreaFlags); - PVR_UNREFERENCED_PARAMETER(pvPrivData); - PVR_UNREFERENCED_PARAMETER(ui32PrivDataLength); - BUG(); - return IMG_NULL; -} - -static inline IMG_VOID FreeIONLinuxMemArea(LinuxMemArea *psLinuxMemArea) -{ - PVR_UNREFERENCED_PARAMETER(psLinuxMemArea); - BUG(); -} - -static inline IMG_INT32 -GetIONLinuxMemAreaInfo(LinuxMemArea *psLinuxMemArea, IMG_UINT32* ui32AddressOffsets, - IMG_UINT32* ui32NumAddr) -{ - PVR_UNREFERENCED_PARAMETER(psLinuxMemArea); - PVR_UNREFERENCED_PARAMETER(ui32AddressOffsets); - PVR_UNREFERENCED_PARAMETER(ui32NumAddr); - BUG(); - return -1; -} - -#endif /* defined(CONFIG_ION_OMAP) */ - - /*! ******************************************************************************* * @brief * * @param psParentLinuxMemArea - * @param ui32ByteOffset - * @param ui32Bytes + * @param uByteOffset + * @param uBytes * * @return ******************************************************************************/ LinuxMemArea *NewSubLinuxMemArea(LinuxMemArea *psParentLinuxMemArea, - IMG_UINT32 ui32ByteOffset, - IMG_UINT32 ui32Bytes); + IMG_UINTPTR_T uByteOffset, + IMG_SIZE_T uBytes); /*! @@ -668,14 +594,14 @@ IMG_VOID *LinuxMemAreaToCpuVAddr(LinuxMemArea *psLinuxMemArea); * @brief * * @param psLinuxMemArea - * @param ui32ByteOffset + * @param uByteOffset * * @return ******************************************************************************/ -IMG_CPU_PHYADDR LinuxMemAreaToCpuPAddr(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32ByteOffset); +IMG_CPU_PHYADDR LinuxMemAreaToCpuPAddr(LinuxMemArea *psLinuxMemArea, IMG_UINTPTR_T uByteOffset); -#define LinuxMemAreaToCpuPFN(psLinuxMemArea, ui32ByteOffset) PHYS_TO_PFN(LinuxMemAreaToCpuPAddr(psLinuxMemArea, ui32ByteOffset).uiAddr) +#define LinuxMemAreaToCpuPFN(psLinuxMemArea, uByteOffset) PHYS_TO_PFN(LinuxMemAreaToCpuPAddr(psLinuxMemArea, uByteOffset).uiAddr) /*! ******************************************************************************* |