]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00292154-3 gpu:Adjust logic for non_paged memory cache
authorLoren Huang <b02279@freescale.com>
Thu, 9 Jan 2014 09:36:27 +0000 (17:36 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:54 +0000 (10:06 +0200)
non_page memory cache will only be freed when application exit.
It will have waste when contiguous memory used up.
Add logic to free it when contiguous memory is used up.

[DATE]16-12-2013
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Shawn Guo
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index 39c90f270cf550d1aeb12ea90e79943f4ffcb28e..273d1173aac781262356a0faaae35a5a48b5e9a5 100644 (file)
@@ -2019,6 +2019,17 @@ gckOS_AllocateNonPagedMemory(
                 &mdl->dmaHandle,
                 GFP_KERNEL | gcdNOWARN);
     }
+#if gcdUSE_NON_PAGED_MEMORY_CACHE
+    if(addr == gcvNULL)
+    {
+            /*Free all cache and try again*/
+            _FreeAllNonPagedMemoryCache(Os);
+            addr = dma_alloc_coherent(gcvNULL,
+                mdl->numPages * PAGE_SIZE,
+                &mdl->dmaHandle,
+                GFP_KERNEL | gcdNOWARN);
+    }
+#endif
 #else
     size    = mdl->numPages * PAGE_SIZE;
     order   = get_order(size);