From 6348cd002b309ba46e5835bf5083c411bf06d557 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Fri, 4 Nov 2011 14:27:47 +0200 Subject: [PATCH] gfx: pvr: Update heap address to match 1.7 DDK Heap bases and sizes were updated in 1.7 DDK. Adapt changes to the driver. Signed-off-by: Imre Deak Signed-off-by: Pauli Nieminen Signed-off-by: Kirill A. Shutemov --- .../pvr/services4/srvkm/devices/sgx/sgxconfig.h | 108 ++++++++++++++++----- 1 file changed, 82 insertions(+), 26 deletions(-) diff --git a/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxconfig.h b/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxconfig.h index f46a5c2..9d69087 100644 --- a/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxconfig.h +++ b/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxconfig.h @@ -1,6 +1,6 @@ /********************************************************************** * - * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. + * Copyright (C) Imagination Technologies Ltd. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -35,6 +35,12 @@ #define DEV_MAJOR_VERSION 1 #define DEV_MINOR_VERSION 0 +#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE) +#define SGX_KERNEL_DATA_HEAP_OFFSET 0x00001000 +#else +#define SGX_KERNEL_DATA_HEAP_OFFSET 0x00000000 +#endif + #if SGX_FEATURE_ADDRESS_SPACE_SIZE == 32 #if defined(SGX_FEATURE_2D_HARDWARE) #define SGX_2D_HEAP_BASE 0x00100000 @@ -48,14 +54,41 @@ #if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP) #define SGX_GENERAL_MAPPING_HEAP_BASE 0x08000000 - #define SGX_GENERAL_MAPPING_HEAP_SIZE (0x20000000-0x00001000) + #define SGX_GENERAL_MAPPING_HEAP_SIZE (0x08000000-0x00001000) #endif - #define SGX_GENERAL_HEAP_BASE 0x28000000 - #define SGX_GENERAL_HEAP_SIZE (0xAA000000-0x00001000) + #define SGX_GENERAL_HEAP_BASE 0x10000000 + #define SGX_GENERAL_HEAP_SIZE (0xC2000000-0x00001000) + + + #define SGX_3DPARAMETERS_HEAP_SIZE 0x10000000 + + +#if !defined(HYBRID_SHARED_PB_SIZE) + #define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1) +#endif +#if defined(SUPPORT_HYBRID_PB) + #define SGX_SHARED_3DPARAMETERS_SIZE (HYBRID_SHARED_PB_SIZE) + #define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (HYBRID_SHARED_PB_SIZE-0x00001000) + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - SGX_SHARED_3DPARAMETERS_SIZE - 0x00001000) +#else +#if defined(SUPPORT_PERCONTEXT_PB) + #define SGX_SHARED_3DPARAMETERS_SIZE 0 + #define SGX_SHARED_3DPARAMETERS_HEAP_SIZE 0 + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000) +#endif +#if defined(SUPPORT_SHARED_PB) + #define SGX_SHARED_3DPARAMETERS_SIZE SGX_3DPARAMETERS_HEAP_SIZE + #define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000) + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE 0 +#endif +#endif + + #define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0xD2000000 + + + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE) - #define SGX_3DPARAMETERS_HEAP_BASE 0xD2000000 - #define SGX_3DPARAMETERS_HEAP_SIZE (0x10000000-0x00001000) #define SGX_TADATA_HEAP_BASE 0xE2000000 #define SGX_TADATA_HEAP_SIZE (0x0D000000-0x00001000) @@ -72,19 +105,14 @@ #define SGX_PDSVERTEX_CODEDATA_HEAP_BASE 0xF2400000 #define SGX_PDSVERTEX_CODEDATA_HEAP_SIZE (0x01C00000-0x00001000) - #define SGX_KERNEL_DATA_HEAP_BASE (0xF4000000) -#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE) - #define SGX_KERNEL_DATA_HEAP_SIZE (0x05000000-0x00002000) -#else - #define SGX_KERNEL_DATA_HEAP_SIZE (0x05000000-0x00001000) -#endif + #define SGX_KERNEL_DATA_HEAP_BASE 0xF4000000 + #define SGX_KERNEL_DATA_HEAP_SIZE (0x05000000-(0x00001000+SGX_KERNEL_DATA_HEAP_OFFSET)) #define SGX_PIXELSHADER_HEAP_BASE 0xF9000000 #define SGX_PIXELSHADER_HEAP_SIZE (0x05000000-0x00001000) #define SGX_VERTEXSHADER_HEAP_BASE 0xFE000000 #define SGX_VERTEXSHADER_HEAP_SIZE (0x02000000-0x00001000) - #define SGX_CORE_IDENTIFIED #endif @@ -94,17 +122,43 @@ #if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP) #define SGX_GENERAL_MAPPING_HEAP_BASE 0x00001000 #define SGX_GENERAL_MAPPING_HEAP_SIZE (0x01800000-0x00001000-0x00001000) - + #define SGX_GENERAL_HEAP_BASE 0x01800000 #define SGX_GENERAL_HEAP_SIZE (0x07000000-0x00001000) #else #define SGX_GENERAL_HEAP_BASE 0x00001000 - #define SGX_GENERAL_HEAP_SIZE (0x0C000000-0x00001000-0x00001000) + #define SGX_GENERAL_HEAP_SIZE (0x08800000-0x00001000-0x00001000) +#endif + + #define SGX_3DPARAMETERS_HEAP_SIZE 0x04000000 + + +#if !defined(HYBRID_SHARED_PB_SIZE) + #define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1) +#endif +#if defined(SUPPORT_HYBRID_PB) + #define SGX_SHARED_3DPARAMETERS_SIZE (HYBRID_SHARED_PB_SIZE) + #define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (HYBRID_SHARED_PB_SIZE-0x00001000) + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - SGX_SHARED_3DPARAMETERS_SIZE - 0x00001000) +#else +#if defined(SUPPORT_PERCONTEXT_PB) + #define SGX_SHARED_3DPARAMETERS_SIZE 0 + #define SGX_SHARED_3DPARAMETERS_HEAP_SIZE 0 + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000) +#endif +#if defined(SUPPORT_SHARED_PB) + #define SGX_SHARED_3DPARAMETERS_SIZE SGX_3DPARAMETERS_HEAP_SIZE + #define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000) + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE 0 +#endif #endif - #define SGX_3DPARAMETERS_HEAP_BASE 0x0C000000 - #define SGX_3DPARAMETERS_HEAP_SIZE (0x00800000-0x00001000) + #define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0x08800000 + + + #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE) + #define SGX_TADATA_HEAP_BASE 0x0C800000 #define SGX_TADATA_HEAP_SIZE (0x01000000-0x00001000) @@ -121,12 +175,8 @@ #define SGX_PDSVERTEX_CODEDATA_HEAP_BASE 0x0E800000 #define SGX_PDSVERTEX_CODEDATA_HEAP_SIZE (0x00800000-0x00001000) - #define SGX_KERNEL_DATA_HEAP_BASE (0x0F000000) -#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE) - #define SGX_KERNEL_DATA_HEAP_SIZE (0x00400000-0x00002000) -#else - #define SGX_KERNEL_DATA_HEAP_SIZE (0x00400000-0x00001000) -#endif + #define SGX_KERNEL_DATA_HEAP_BASE 0x0F000000 + #define SGX_KERNEL_DATA_HEAP_SIZE (0x00400000-(0x00001000+SGX_KERNEL_DATA_HEAP_OFFSET)) #define SGX_PIXELSHADER_HEAP_BASE 0x0F400000 #define SGX_PIXELSHADER_HEAP_SIZE (0x00500000-0x00001000) @@ -195,12 +245,18 @@ #endif #endif -#if ((SGX_GENERAL_HEAP_BASE + SGX_GENERAL_HEAP_SIZE) >= SGX_3DPARAMETERS_HEAP_BASE) +#if defined(SUPPORT_HYBRID_PB) + #if ((HYBRID_SHARED_PB_SIZE + 0x000001000) > SGX_3DPARAMETERS_HEAP_SIZE) + #error "sgxconfig.h: ERROR: HYBRID_SHARED_PB_SIZE too large" + #endif +#endif + +#if ((SGX_GENERAL_HEAP_BASE + SGX_GENERAL_HEAP_SIZE) >= SGX_SHARED_3DPARAMETERS_HEAP_BASE) #error "sgxconfig.h: ERROR: SGX_GENERAL_HEAP overlaps SGX_3DPARAMETERS_HEAP" #endif -#if ((SGX_3DPARAMETERS_HEAP_BASE + SGX_3DPARAMETERS_HEAP_SIZE) >= SGX_TADATA_HEAP_BASE) - #error "sgxconfig.h: ERROR: SGX_3DPARAMETERS_HEAP overlaps SGX_TADATA_HEAP" +#if (((SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE + SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE) >= SGX_TADATA_HEAP_BASE) && (SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE > 0)) + #error "sgxconfig.h: ERROR: SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE overlaps SGX_TADATA_HEAP" #endif #if ((SGX_TADATA_HEAP_BASE + SGX_TADATA_HEAP_SIZE) >= SGX_SYNCINFO_HEAP_BASE) -- 2.7.4