Skip to content
Snippets Groups Projects
Commit 06270015 authored by Xianzhong's avatar Xianzhong Committed by Gianfranco Mariotti
Browse files

MGS-6400 [#imx-1870] fix vivante drm database leak


contiguous memory is part of video memory allocation,
remove the duplicated database for contiguous memory,
need set contiguous memory flag as database type.

Signed-off-by: default avatarXianzhong <xianzhong.li@nxp.com>
parent d65e6990
No related branches found
No related tags found
1 merge request!156Draft: [i.MX] mxc: gpu-viv: apply patches
......@@ -665,6 +665,7 @@ static int viv_ioctl_gem_ref_node(struct drm_device *drm, void *data,
gckKERNEL kernel = gcvNULL;
gctUINT32 processID;
gckVIDMEM_NODE nodeObj;
gceDATABASE_TYPE type;
gctUINT32 nodeHandle = 0, tsNodeHandle = 0;
gctBOOL refered = gcvFALSE;
gctBOOL isContiguous = gcvFALSE;
......@@ -687,50 +688,44 @@ static int viv_ioctl_gem_ref_node(struct drm_device *drm, void *data,
gcmkONERROR(gckOS_GetProcessID(&processID));
gcmkONERROR(gckVIDMEM_HANDLE_Allocate(kernel, nodeObj, &nodeHandle));
type = gcvDB_VIDEO_MEMORY
| (nodeObj->type << gcdDB_VIDEO_MEMORY_TYPE_SHIFT)
| (nodeObj->pool << gcdDB_VIDEO_MEMORY_POOL_SHIFT);
gcmkONERROR(gckVIDMEM_NODE_IsContiguous(kernel, nodeObj, &isContiguous));
if (isContiguous)
{
type |= (gcvDB_CONTIGUOUS << gcdDB_VIDEO_MEMORY_DBTYPE_SHIFT);
}
gcmkONERROR(
gckKERNEL_AddProcessDB(kernel,
processID, gcvDB_VIDEO_MEMORY,
processID, type,
gcmINT2PTR(nodeHandle),
gcvNULL,
0));
gcmkONERROR(gckVIDMEM_NODE_Reference(kernel, nodeObj));
refered = gcvTRUE;
gcmkONERROR(gckVIDMEM_NODE_IsContiguous(kernel, nodeObj, &isContiguous));
if (isContiguous)
{
/* Record in process db. */
gcmkONERROR(
gckKERNEL_AddProcessDB(kernel,
processID,
gcvDB_CONTIGUOUS,
gcmINT2PTR(nodeHandle),
gcvNULL,
0));
}
if (nodeObj->tsNode)
{
type = gcvDB_VIDEO_MEMORY
| (nodeObj->tsNode->type << gcdDB_VIDEO_MEMORY_TYPE_SHIFT)
| (nodeObj->tsNode->pool << gcdDB_VIDEO_MEMORY_POOL_SHIFT);
gcmkONERROR(gckVIDMEM_NODE_IsContiguous(kernel, nodeObj->tsNode, &isContiguous));
if (isContiguous)
{
type |= (gcvDB_CONTIGUOUS << gcdDB_VIDEO_MEMORY_DBTYPE_SHIFT);
}
gcmkONERROR(gckVIDMEM_HANDLE_Allocate(kernel, nodeObj->tsNode, &tsNodeHandle));
gcmkONERROR(
gckKERNEL_AddProcessDB(kernel,
processID, gcvDB_VIDEO_MEMORY,
processID, type,
gcmINT2PTR(tsNodeHandle),
gcvNULL,
0));
gcmkONERROR(gckVIDMEM_NODE_Reference(kernel, nodeObj->tsNode));
gcmkONERROR(gckVIDMEM_NODE_IsContiguous(kernel, nodeObj->tsNode, &isContiguous));
if (isContiguous)
{
/* Record in process db. */
gcmkONERROR(
gckKERNEL_AddProcessDB(kernel,
processID,
gcvDB_CONTIGUOUS,
gcmINT2PTR(tsNodeHandle),
gcvNULL,
0));
}
}
args->node = nodeHandle;
args->ts_node = tsNodeHandle;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment