MGS-3349 [#ccc] [imx8qm] Met segmentation fault when run GLES samples stress on GPU0...
authorYuchou Gan <yuchou.gan@nxp.com>
Fri, 10 Nov 2017 13:34:41 +0000 (21:34 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:39:14 +0000 (15:39 -0500)
cma limit feature is for gpu/dpu/vpu buffer sharing,
cma preempt feature is required for gpu mmu table setup.

remove cma limit flag for video memory since imx8 g2d use ion.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Yuchou Gan <yuchou.gan@nxp.com>
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index 71e424b..92061c2 100644 (file)
@@ -2136,6 +2136,7 @@ gceCOMPRESSION_OPTION;
 /* CMA allocator only */
 #define gcvALLOC_FLAG_CMA_LIMIT             0x04000000
 
+#define gcvALLOC_FLAG_CMA_PREEMPT           0x08000000
 
 /* GL_VIV internal usage */
 #ifndef GL_MAP_BUFFER_OBJ_VIV
index 8d7cf27..c8bfb12 100644 (file)
@@ -146,7 +146,7 @@ _CMAFSLAlloc(
 
     if (os->allocatorLimitMarker)
     {
-        if (Flags & gcvALLOC_FLAG_CMA_LIMIT)
+        if ((Flags & gcvALLOC_FLAG_CMA_LIMIT) && !(Flags & gcvALLOC_FLAG_CMA_PREEMPT))
         {
             priv->cmaLimitRequest = gcvTRUE;
         }
@@ -564,6 +564,7 @@ _CMAFSLAlloctorInit(
     if (Os->allocatorLimitMarker)
     {
         allocator->capability |= gcvALLOC_FLAG_CMA_LIMIT;
+        allocator->capability |= gcvALLOC_FLAG_CMA_PREEMPT;
     }
 
     *Allocator = allocator;
index f050781..0aad204 100644 (file)
@@ -1422,6 +1422,7 @@ gckOS_AllocateNonPagedMemory(
     if (Os->allocatorLimitMarker)
     {
         flag |= gcvALLOC_FLAG_CMA_LIMIT;
+        flag |= gcvALLOC_FLAG_CMA_PREEMPT;
     }
 
     /* Walk all allocators. */