From: Xianzhong Date: Thu, 18 Apr 2019 15:38:43 +0000 (+0800) Subject: MGS-4716 [#imx-1412] redirect cma limit request with dma32 X-Git-Tag: rel_imx_4.19.35_1.1.0~712 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=8912ae3d24b46c0e40e3012b9f720e7eaf5e022e;p=linux.git MGS-4716 [#imx-1412] redirect cma limit request with dma32 L4.19 kernel support CONFIG_ZONE_DMA32 feature, which is better to allocate 4G memory than CMA limit feature. Signed-off-by: Xianzhong --- diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c index 0e8f386455ba..2c4aec3bba77 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -3103,6 +3103,15 @@ gckOS_AllocatePagedMemory( gcmkONERROR(gcvSTATUS_OUT_OF_MEMORY); } +#if defined(CONFIG_ZONE_DMA32) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) + /* redirect DMA32 pool for CMA LIMIT request */ + if (Flag & gcvALLOC_FLAG_CMA_LIMIT) + { + Flag &= ~gcvALLOC_FLAG_CMA_LIMIT; + Flag |= gcvALLOC_FLAG_4GB_ADDR; + } +#endif + if (Os->allocatorLimitMarker && (Flag & gcvALLOC_FLAG_CMA_LIMIT)) { Flag &= ~gcvALLOC_FLAG_CACHEABLE;