diff options
author | Loren Huang <b02279@freescale.com> | 2014-01-09 04:36:27 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:35 -0400 |
commit | d04081279112184a5a9a6c1e4050062bb22cd941 (patch) | |
tree | a8b651e91ea2b18e7d877127be1f0a805ce7ea9d /drivers/mxc | |
parent | 32bc5e65d78b513828a0ae8f4d32d87d6093b348 (diff) |
ENGR00292154-3 gpu:Adjust logic for non_paged memory cache
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
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 11 |
1 files changed, 11 insertions, 0 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 39c90f270cf5..273d1173aac7 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 | |||
@@ -2019,6 +2019,17 @@ gckOS_AllocateNonPagedMemory( | |||
2019 | &mdl->dmaHandle, | 2019 | &mdl->dmaHandle, |
2020 | GFP_KERNEL | gcdNOWARN); | 2020 | GFP_KERNEL | gcdNOWARN); |
2021 | } | 2021 | } |
2022 | #if gcdUSE_NON_PAGED_MEMORY_CACHE | ||
2023 | if(addr == gcvNULL) | ||
2024 | { | ||
2025 | /*Free all cache and try again*/ | ||
2026 | _FreeAllNonPagedMemoryCache(Os); | ||
2027 | addr = dma_alloc_coherent(gcvNULL, | ||
2028 | mdl->numPages * PAGE_SIZE, | ||
2029 | &mdl->dmaHandle, | ||
2030 | GFP_KERNEL | gcdNOWARN); | ||
2031 | } | ||
2032 | #endif | ||
2022 | #else | 2033 | #else |
2023 | size = mdl->numPages * PAGE_SIZE; | 2034 | size = mdl->numPages * PAGE_SIZE; |
2024 | order = get_order(size); | 2035 | order = get_order(size); |