]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00295218-2 gpu: Allow allocate vg memory from small block reserved memory
authorLoren Huang <b02279@freescale.com>
Thu, 16 Jan 2014 08:23:37 +0000 (16:23 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:54 +0000 (10:06 +0200)
-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)

drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h

index b75e7f64030ebd6c44535b1d68be1baa50fc93f7..8b9d3c789cd34030c45bf5dcfb0513ffacff6f90 100644 (file)
@@ -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);
 
index 2599d6f5795906b6a928b4f7875e7702119cb7e2..d7b8e08732522a97846e712081777c708d47067f 100644 (file)
@@ -305,6 +305,8 @@ gckKERNEL_AllocateLinearMemory(
 
             if (status == gcvSTATUS_OK)
             {
+                if(*Pool == gcvPOOL_SYSTEM)
+                    Type |= gcvSURF_VG;
                 /* Allocate memory. */
                 status = gckVIDMEM_AllocateLinear(videoMemory,
                                                   Bytes,
index 39290c9e45d9e25b96e84167f580e9f66457f6e0..5699996125cddd55110d1a2e23b013e952d3f637 100644 (file)
@@ -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)
     )
     {
index 31422cee56afe6e7c4ba6b79ad7c2c304c2438e2..1d19882217defca120bdc2058f5edbb4dbc39baf 100644 (file)
@@ -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,