diff options
author | Loren Huang <b02279@freescale.com> | 2014-07-15 15:27:30 +0800 |
---|---|---|
committer | Loren Huang <b02279@freescale.com> | 2014-08-27 12:09:53 +0800 |
commit | 6ac4d326ff53d30da52c173c17a5c2af86ebbed6 (patch) | |
tree | c8fc4035c99e4a390722193638bb2ccabbb86326 /drivers | |
parent | 4cc465429628bf02b8b363e1ec6f8f97492ab1e3 (diff) |
ENGR00316978 [#1162] force_sig crash in GPU lower memory killer
it is caused when multiple threads try to kill same one process,
the global semaphore is used to avoid this conflict.
Date: Jun 05, 2014
Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Jason Liu
(cherry picked from commit 48c860eba3aae80c85587a37a858082b3a8b7b08)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 10 |
1 files changed, 9 insertions, 1 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 d565800e13bf..cdfb4b70ecbd 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -872,7 +872,15 @@ _AllocateMemory_Retry: #ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT if(forceContiguous == gcvTRUE) { - if(force_contiguous_lowmem_shrink(Kernel) == 0) + int ret; + /* Acquire the mutex. */ + gcmkVERIFY_OK(gckOS_AcquireMutex(Kernel->os, Kernel->vidmemMutex, gcvINFINITE)); + + ret = force_contiguous_lowmem_shrink(Kernel); + + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); + + if(ret == 0) { /* Sleep 1 millisecond. */ gckOS_Delay(gcvNULL, 1); |