diff options
author | Richard Liu <r66033@freescale.com> | 2012-07-02 09:34:31 +0800 |
---|---|---|
committer | Richard Liu <r66033@freescale.com> | 2012-07-02 09:34:31 +0800 |
commit | 26bb7d7b3b4804150253237e6081f6648e08771d (patch) | |
tree | c499fa8689edc80cff46a43a9b0ca4819d407b79 | |
parent | 21edcb55dc99d9f1ccf3610410206facfae62538 (diff) |
ENGR00215344 GPU became slow after long time run some applications
GPU became slow after long time run some applications
root cause is when GPU reserved memory exhaust, GPU will request continue physical
memory which will trigger defregment operation in kernel and cause system slow
Signed-off-by: Richard Liu <r66033@freescale.com>
Acked-by: Lily Zhang
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 14 | ||||
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h | 8 |
2 files changed, 20 insertions, 2 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 773a262562c4..c7a05a58c262 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -509,8 +509,18 @@ _AllocateMemory( else if (pool == gcvPOOL_CONTIGUOUS) { - /* Create a gcuVIDMEM_NODE for contiguous memory. */ - status = gckVIDMEM_ConstructVirtual(Kernel, gcvTRUE, Bytes, &node); +#if gcdCONTIGUOUS_SIZE_LIMIT + if (Bytes > gcdCONTIGUOUS_SIZE_LIMIT) + { + status = gcvSTATUS_OUT_OF_MEMORY; + } + else +#endif + { + /* Create a gcuVIDMEM_NODE from contiguous memory. */ + status = gckVIDMEM_ConstructVirtual(Kernel, gcvTRUE, Bytes, &node); + } + if (gcmIS_SUCCESS(status)) { /* Memory allocated. */ diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h index 35743c62f2a2..0b7c42ce9190 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h +++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h @@ -759,6 +759,14 @@ # define gcdRATIO_FOR_SMALL_MEMORY 32 #endif +/* + gcdCONTIGUOUS_SIZE_LIMIT + When non-zero, size of video node from gcvPOOL_CONTIGUOUS is + limited by gcdCONTIGUOUS_SIZE_LIMIT. + */ +#ifndef gcdCONTIGUOUS_SIZE_LIMIT +# define gcdCONTIGUOUS_SIZE_LIMIT 4096 +#endif /* gcdALPHA_KILL_IN_SHADER * |