diff options
author | Loren Huang <b02279@freescale.com> | 2014-07-15 15:27:30 +0800 |
---|---|---|
committer | Loren Huang <b02279@freescale.com> | 2014-08-15 11:25:05 +0800 |
commit | d40445b3f91c142ba5aacd5f23d45e831cc763f9 (patch) | |
tree | 6d3fe05c5524529a0d6385f3f2d7560620a91582 | |
parent | 79d49d738ac4c28cc8c0e57b87202204f6c21b06 (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)
(cherry picked from commit d6acc3d27428be0d0b4682ab86b76de03c54efab)
-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); |