diff options
author | Loren Huang <b02279@freescale.com> | 2014-01-16 16:23:37 +0800 |
---|---|---|
committer | Loren Huang <b02279@freescale.com> | 2014-01-16 18:38:49 +0800 |
commit | 4396407406499bf256bf2489dd52ea0228a6d531 (patch) | |
tree | f5c1d375fdd50b0a4c4dc7ec78de59c7301cf363 /drivers/mxc | |
parent | e8504b498e8ef6eb577b15db423e2a13af9085ba (diff) |
ENGR00295218-2 gpu: Allow allocate vg memory from small block reserved memory
-Most vg memory must requires reserved memory, when reserved memory is
used up by 3d appliction. vg hardware can't be constructed successfully,
which cause whole context creation failure(including 3d context).
-Allow allocating vg memory from small block reserved memory can help such
multi context cases.
Date: Jan 15, 2014
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Shawn Guo
(cherry picked from commit 5d7c8c1c695b79f7372de16504292a1241390a8b)
Diffstat (limited to 'drivers/mxc')
4 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index b75e7f64030e..8b9d3c789cd3 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -760,7 +760,7 @@ _AllocateMemory_Retry: if((physAddr & 0x80000000) || ((physAddr + Bytes) & 0x80000000)) { - gckOS_Print("gpu virtual memory 0x%x cannot be allocated for external use !\n", physAddr); + gckOS_Print("gpu virtual memory 0x%x cannot be allocated in force contiguous request!\n", physAddr); gckVIDMEM_Free(node); diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c index 2599d6f57959..d7b8e0873252 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c @@ -305,6 +305,8 @@ gckKERNEL_AllocateLinearMemory( if (status == gcvSTATUS_OK) { + if(*Pool == gcvPOOL_SYSTEM) + Type |= gcvSURF_VG; /* Allocate memory. */ status = gckVIDMEM_AllocateLinear(videoMemory, Bytes, diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c index 39290c9e45d9..5699996125cd 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c @@ -1001,10 +1001,14 @@ gckVIDMEM_AllocateLinear( gctUINT32 alignment; gctINT bank, i; gctBOOL acquired = gcvFALSE; +#if gcdSMALL_BLOCK_SIZE + gctBOOL force_allocate = (Type == gcvSURF_TILE_STATUS) || (Type & gcvSURF_VG); +#endif gcmkHEADER_ARG("Memory=0x%x Bytes=%lu Alignment=%u Type=%d", Memory, Bytes, Alignment, Type); + Type &= ~gcvSURF_VG; /* Verify the arguments. */ gcmkVERIFY_OBJECT(Memory, gcvOBJ_VIDMEM); gcmkVERIFY_ARGUMENT(Bytes > 0); @@ -1026,7 +1030,7 @@ gckVIDMEM_AllocateLinear( #endif #if gcdSMALL_BLOCK_SIZE - if ((Memory->freeBytes < (Memory->bytes/gcdRATIO_FOR_SMALL_MEMORY)) + if ((!force_allocate) && (Memory->freeBytes < (Memory->bytes/gcdRATIO_FOR_SMALL_MEMORY)) && (Bytes >= gcdSMALL_BLOCK_SIZE) ) { diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h index 31422cee56af..1d19882217de 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h +++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h @@ -224,6 +224,7 @@ typedef enum _gceSURF_TYPE gcvSURF_TILE_STATUS_DIRTY = 0x1000, /* Init tile status to all dirty */ gcvSURF_LINEAR = 0x2000, + gcvSURF_VG = 0x4000, gcvSURF_TEXTURE_LINEAR = gcvSURF_TEXTURE | gcvSURF_LINEAR, |