From 81ec079592cadb2f820ddeae01cffa13231fc940 Mon Sep 17 00:00:00 2001 From: Xianzhong Date: Thu, 29 Mar 2018 19:46:42 +0800 Subject: [PATCH] MGS-3778 [#imx-989] fix GPU performance regression with 6.2.4.p1 the original patch will skip CMA memory allocation with CMA_LIMIT flag, that enforces GPU memory allocation from virtual pool with MMU mapping, then both 2D and 3D performance will have performance regression on i.MX6. Revert "6.2.4.p1-0044-CL142820-check-flag-match-even-try-to-allocate-from-" This reverts commit 8a8cbf389ad56dc49685ea078698087be867655a. Signed-off-by: Xianzhong (cherry picked from commit 951e42c0ec05d4cdaf739eadd5fd40c2b8321b10) --- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 11 ++--------- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h | 3 --- .../gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c | 1 - .../hal/os/linux/kernel/gc_hal_kernel_device.c | 7 ------- 4 files changed, 2 insertions(+), 20 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 2f16d6d71c92..457fc6b62c40 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -1122,21 +1122,14 @@ AllocateMemory: if (gcmIS_SUCCESS(status)) { /* Allocate memory. */ - if ((Flag & videoMemory->capability) != Flag) - { - status = gcvSTATUS_NOT_SUPPORTED; - - gcmkFATAL("%s(%d): Reject alloc because VIDMEM (pool=%d) caps=0x%x cannot meet required Flag=0x%x", - __FUNCTION__, __LINE__, pool, videoMemory->capability, Flag); - } #if defined(gcdLINEAR_SIZE_LIMIT) /* 512 KB */ - else if (Bytes > gcdLINEAR_SIZE_LIMIT) + if (Bytes > gcdLINEAR_SIZE_LIMIT) { status = gcvSTATUS_OUT_OF_MEMORY; } -#endif else +#endif { hasFastPools = gcvTRUE; status = gckVIDMEM_AllocateLinear(Kernel, diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h index f5d23bd77889..438ca886a4b5 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h @@ -1080,9 +1080,6 @@ struct _gckVIDMEM gctSIZE_T freeBytes; gctSIZE_T minFreeBytes; - /* caps inherit from its allocator, ~0u if allocator was not applicable. */ - gctUINT32 capability; - /* Mapping for each type of surface. */ gctINT mapping[gcvSURF_NUM_TYPES]; 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 2fcc52c67fe9..49adff00c601 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 @@ -435,7 +435,6 @@ gckVIDMEM_Construct( memory->bytes = heapBytes; memory->freeBytes = heapBytes; memory->minFreeBytes = heapBytes; - memory->capability = ~0u; memory->threshold = Threshold; memory->mutex = gcvNULL; diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c index 020cba99df7a..c69dd5c9f18b 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c @@ -54,7 +54,6 @@ #include "gc_hal_kernel_linux.h" -#include "gc_hal_kernel_allocator.h" #include #include #include @@ -853,8 +852,6 @@ _SetupVidMem( if (gcmIS_SUCCESS(status)) { - gckALLOCATOR allocator = ((PLINUX_MDL)device->contiguousPhysical)->allocator; - device->contiguousVidMem->capability = allocator->capability | gcvALLOC_FLAG_MEMLIMIT; device->contiguousVidMem->physical = device->contiguousPhysical; device->contiguousBase = physAddr; break; @@ -899,8 +896,6 @@ _SetupVidMem( } else { - gckALLOCATOR allocator; - gcmkONERROR(gckOS_RequestReservedMemory( device->os, ContiguousBase, ContiguousSize, "galcore contiguous memory", @@ -908,8 +903,6 @@ _SetupVidMem( &device->contiguousPhysical )); - allocator = ((PLINUX_MDL)device->contiguousPhysical)->allocator; - device->contiguousVidMem->capability = allocator->capability | gcvALLOC_FLAG_MEMLIMIT; device->contiguousVidMem->physical = device->contiguousPhysical; device->requestedContiguousBase = ContiguousBase; device->requestedContiguousSize = ContiguousSize; -- 2.17.1