summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c10
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 ae7ca5ea1f88..c627d7c85bff 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_GPU_LOW_MEMORY_KILLER
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);