summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2013-08-23 20:36:45 +0800
committerXianzhong <b07117@freescale.com>2013-08-23 21:29:18 +0800
commitfed537a64d73dfffc8defcf865e0c228c430de2b (patch)
tree34af909ac9223f4e522ff99a9f2146339044b489 /drivers/mxc
parent930ad4b405df8575e3e7f2d336cb1aba1d82c12f (diff)
ENGR00274478 fix gpu memory multi-lock failure
this issue cause system boot with multi-user switch on JB4.3, root cause is gpu memory cannot be multi-locked in same process, gpu memory lock reference is added to allow multi-lock in kernel driver. Signed-off-by: Xianzhong <b07117@freescale.com> Acked-by: Jason Liu
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c18
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h1
2 files changed, 16 insertions, 3 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 3c2fb22aae94..6a31eba85a9f 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
@@ -336,9 +336,10 @@ _CreateMdlMap(
return gcvNULL;
}
- mdlMap->pid = ProcessID;
- mdlMap->vmaAddr = gcvNULL;
- mdlMap->vma = gcvNULL;
+ mdlMap->pid = ProcessID;
+ mdlMap->vmaAddr = gcvNULL;
+ mdlMap->vma = gcvNULL;
+ mdlMap->reference = 0;
mdlMap->next = Mdl->maps;
Mdl->maps = mdlMap;
@@ -4315,6 +4316,8 @@ gckOS_LockPages(
up_write(&current->mm->mmap_sem);
}
+
+#if 0
else
{
/* mdlMap->vmaAddr != gcvNULL means current process has already locked this node. */
@@ -4323,6 +4326,7 @@ gckOS_LockPages(
gcmkFOOTER_ARG("*status=%d, mdlMap->vmaAddr=%x", gcvSTATUS_MEMORY_LOCKED, mdlMap->vmaAddr);
return gcvSTATUS_MEMORY_LOCKED;
}
+#endif
/* Convert pointer to MDL. */
*Logical = mdlMap->vmaAddr;
@@ -4333,6 +4337,9 @@ gckOS_LockPages(
*PageCount = mdl->numPages * (PAGE_SIZE / 4096);
+ /* Increase reference count. */
+ mdlMap->reference++;
+
MEMORY_UNLOCK(Os);
gcmkVERIFY_OK(gckOS_CacheFlush(
@@ -4599,6 +4606,11 @@ gckOS_UnlockPages(
{
if ((mdlMap->vmaAddr != gcvNULL) && (_GetProcessID() == mdlMap->pid))
{
+ if (--mdlMap->reference > 0)
+ {
+ continue;
+ }
+
_UnmapUserLogical(mdlMap->pid, mdlMap->vmaAddr, mdl->numPages * PAGE_SIZE);
mdlMap->vmaAddr = gcvNULL;
}
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
index 006632c642e2..501cf30e9273 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
@@ -27,6 +27,7 @@ typedef struct _LINUX_MDL_MAP
gctINT pid;
gctPOINTER vmaAddr;
struct vm_area_struct * vma;
+ gctINT reference;
struct _LINUX_MDL_MAP * next;
}
LINUX_MDL_MAP;