From fa858cf55ac490f4ebd4ee5e2b532b3676231f5e Mon Sep 17 00:00:00 2001 From: Richard Liu Date: Tue, 17 Sep 2013 21:57:13 +0800 Subject: ENGR00278701 use alloc_pages instead of alloc_pages_exact alloc_pages_exact is added by Vivante in gpu git commit e3debfdf4c3f29519ee66d60ac9b5e4db4c41026. alloc_pages_exact is more easy make memory fragment, video playback and camera recording case need large physical continue memory, using alloc_pages_exact will easy make memory fragment and no large physical continue memory, it will impact video playback and camera case. Signed-off-by: Richard Liu --- .../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 30 ++-------------------- .../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h | 3 --- 2 files changed, 2 insertions(+), 31 deletions(-) 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 6a31eba85a9f..58a2d5e344e8 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 @@ -3856,9 +3856,6 @@ gckOS_AllocatePagedMemoryEx( gctSIZE_T bytes; gctBOOL locked = gcvFALSE; gceSTATUS status; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - gctPOINTER addr = gcvNULL; -#endif gcmkHEADER_ARG("Os=0x%X Contiguous=%d Bytes=%lu", Os, Contiguous, Bytes); @@ -3884,27 +3881,13 @@ gckOS_AllocatePagedMemoryEx( { /* Get contiguous pages, and suppress warning (stack dump) from kernel when we run out of memory. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - addr = - alloc_pages_exact(numPages * PAGE_SIZE, GFP_KERNEL | gcdNOWARN | __GFP_NORETRY); - - mdl->u.contiguousPages = addr - ? virt_to_page(addr) - : gcvNULL; - - mdl->exact = gcvTRUE; -#else mdl->u.contiguousPages = alloc_pages(GFP_KERNEL | gcdNOWARN | __GFP_NORETRY, GetOrder(numPages)); -#endif + if (mdl->u.contiguousPages == gcvNULL) { mdl->u.contiguousPages = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM | gcdNOWARN, GetOrder(numPages)); - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - mdl->exact = gcvFALSE; -#endif } } else @@ -4049,16 +4032,7 @@ gckOS_FreePagedMemory( if (mdl->contiguous) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - if (mdl->exact == gcvTRUE) - { - free_pages_exact(page_address(mdl->u.contiguousPages), mdl->numPages * PAGE_SIZE); - } - else -#endif - { - __free_pages(mdl->u.contiguousPages, GetOrder(mdl->numPages)); - } + __free_pages(mdl->u.contiguousPages, GetOrder(mdl->numPages)); } else { diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h index 501cf30e9273..9307e832e167 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h @@ -55,9 +55,6 @@ typedef struct _LINUX_MDL gctINT numPages; gctINT pagedMem; gctBOOL contiguous; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - gctBOOL exact; -#endif dma_addr_t dmaHandle; PLINUX_MDL_MAP maps; struct _LINUX_MDL * prev; -- cgit v1.2.3