diff options
author | yong.gan <yong.gan@nxp.com> | 2016-05-19 09:02:36 +0800 |
---|---|---|
committer | yong.gan <yong.gan@nxp.com> | 2016-05-19 09:02:36 +0800 |
commit | 67dfabd7c2f08e3d9f52a6923de2fc6ca7f45f0c (patch) | |
tree | b168b928c11739fb004054290b204fdc14db1a1b /drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | |
parent | 245a1410422a4245b88996fdc00f7fb00a464b3a (diff) |
MGS-1685 [#2356] fix vg context buffer memory leak
gcoVGHARDWARE_FreeVideoMemory user space implementation has some problem,
the asynchronous unlock/free is required by kernel memory managment, by not available in this function.
because user command buffer & struct cannot be freed through committing new vg command to hardware,
the new workaround is to double unlock the video memory for gcvHAL_RELEASE_VIDEO_MEMORY,
also removed the database as the asynchronous unlock is not available in vg user space driver.
Date: May 18, 2016
Signed-off-by: Yong Gan <yong.gan@freescale.com>
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 20 |
1 files changed, 20 insertions, 0 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 d31af4f4a7be..2519729f1e2d 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -2050,6 +2050,26 @@ gckKERNEL_Dispatch( Kernel, processID, (gctUINT32)Interface->u.ReleaseVideoMemory.node )); + +#if gcdENABLE_VG + if (Kernel->vg != gcvNULL) + { + gckVIDMEM_NODE nodeObject; + + /* Remove record from process db. */ + gcmkERR_BREAK( + gckKERNEL_RemoveProcessDB(Kernel, processID, + gcvDB_VIDEO_MEMORY_LOCKED, + (gctPOINTER)Interface->u.ReleaseVideoMemory.node)); + + gcmkERR_BREAK( + gckVIDMEM_HANDLE_Lookup(Kernel, processID, + (gctUINT32)Interface->u.ReleaseVideoMemory.node, &nodeObject)); + + gckVIDMEM_HANDLE_Dereference(Kernel, processID,(gctUINT32)Interface->u.ReleaseVideoMemory.node); + gckVIDMEM_NODE_Dereference(Kernel, nodeObject); + } +#endif break; case gcvHAL_LOCK_VIDEO_MEMORY: |