From 9690bba696be2139f8c8f85badfe04cc4a8e8bb3 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Fri, 4 Nov 2011 14:27:46 +0200 Subject: [PATCH] gfx: pvr: Split 3D paramter heap to shared and per context 1.7 user space assumes that 3D paramter heap is split to shared and per context heaps. We have to add that to kernel heap setup to support the new DDK. Signed-off-by: Imre Deak Signed-off-by: Pauli Nieminen Signed-off-by: Kirill A. Shutemov --- drivers/staging/mrst/pvr/include4/sgxapi_km.h | 11 ++++--- .../mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c | 37 ++++++++++++---------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/drivers/staging/mrst/pvr/include4/sgxapi_km.h b/drivers/staging/mrst/pvr/include4/sgxapi_km.h index 6d84e12..518ef10 100644 --- a/drivers/staging/mrst/pvr/include4/sgxapi_km.h +++ b/drivers/staging/mrst/pvr/include4/sgxapi_km.h @@ -51,18 +51,19 @@ extern "C" { #define SGX_PDSPIXEL_CODEDATA_HEAP_ID 6 #define SGX_PDSVERTEX_CODEDATA_HEAP_ID 7 #define SGX_SYNCINFO_HEAP_ID 8 -#define SGX_3DPARAMETERS_HEAP_ID 9 +#define SGX_SHARED_3DPARAMETERS_HEAP_ID 9 +#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID 10 #if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP) -#define SGX_GENERAL_MAPPING_HEAP_ID 10 +#define SGX_GENERAL_MAPPING_HEAP_ID 11 #endif #if defined(SGX_FEATURE_2D_HARDWARE) -#define SGX_2D_HEAP_ID 11 +#define SGX_2D_HEAP_ID 12 #else #if defined(FIX_HW_BRN_26915) -#define SGX_CGBUFFER_HEAP_ID 12 +#define SGX_CGBUFFER_HEAP_ID 13 #endif #endif -#define SGX_MAX_HEAP_ID 13 +#define SGX_MAX_HEAP_ID 14 #if defined(SGX543) || defined(SGX544) || defined(SGX554) #define SGX_USE_CODE_SEGMENT_RANGE_BITS 23 diff --git a/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c b/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c index c3080ad..7d6dd1c 100644 --- a/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c +++ b/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c @@ -1864,28 +1864,33 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode) psDeviceMemoryHeap++; - - psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_3DPARAMETERS_HEAP_ID); - psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_3DPARAMETERS_HEAP_BASE; - psDeviceMemoryHeap->ui32HeapSize = SGX_3DPARAMETERS_HEAP_SIZE; - psDeviceMemoryHeap->pszName = "3DParameters"; - psDeviceMemoryHeap->pszBSName = "3DParameters BS"; -#if defined(SUPPORT_PERCONTEXT_PB) + psDeviceMemoryHeap->ui32HeapID = HEAP_ID(PVRSRV_DEVICE_TYPE_SGX, SGX_SHARED_3DPARAMETERS_HEAP_ID); + psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_SHARED_3DPARAMETERS_HEAP_BASE; + psDeviceMemoryHeap->ui32HeapSize = SGX_SHARED_3DPARAMETERS_HEAP_SIZE; + psDeviceMemoryHeap->pszName = "Shared 3DParameters"; + psDeviceMemoryHeap->pszBSName = "Shared 3DParameters BS"; psDeviceMemoryHeap->ui32Attribs = PVRSRV_HAP_WRITECOMBINE - | PVRSRV_MEM_RAM_BACKED_ALLOCATION - | PVRSRV_HAP_SINGLE_PROCESS; - psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT; -#else - psDeviceMemoryHeap->ui32Attribs = PVRSRV_HAP_WRITECOMBINE - | PVRSRV_MEM_RAM_BACKED_ALLOCATION - | PVRSRV_HAP_MULTI_PROCESS; + | PVRSRV_MEM_RAM_BACKED_ALLOCATION + | PVRSRV_HAP_MULTI_PROCESS; psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED; -#endif - + psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE; psDeviceMemoryHeap++; + psDeviceMemoryHeap->ui32HeapID = HEAP_ID(PVRSRV_DEVICE_TYPE_SGX, SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID); + psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE; + psDeviceMemoryHeap->ui32HeapSize = SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE; + psDeviceMemoryHeap->pszName = "Percontext 3DParameters"; + psDeviceMemoryHeap->pszBSName = "Percontext 3DParameters BS"; + psDeviceMemoryHeap->ui32Attribs = PVRSRV_HAP_WRITECOMBINE + | PVRSRV_MEM_RAM_BACKED_ALLOCATION + | PVRSRV_HAP_SINGLE_PROCESS; + psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT; + + psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE; + psDeviceMemoryHeap++; + #if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP) psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_GENERAL_MAPPING_HEAP_ID); -- 2.7.4