summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2016-06-17 17:25:35 -0500
committerDave Airlie <[email protected]>2016-07-29 09:09:56 +1000
commita235765d27d259edb7b028b8df55ef7240622242 (patch)
tree23b5a1e62a8ec39c915541b69bed16c33226cbaa /src/gallium/winsys
parent6d958c7c1666a2c67ab74e2b2542d1352eb49a5e (diff)
virgl: add exported dmabuf to BO hash table
Exported dmabufs can get imported by the same process, but the handle was not getting added to the hash table on export. Add the handle to the hash table on export. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 81afa848732..11385b2faae 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -489,6 +489,9 @@ static boolean virgl_drm_winsys_resource_get_handle(struct virgl_winsys *qws,
} else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
if (drmPrimeHandleToFD(qdws->fd, res->bo_handle, DRM_CLOEXEC, (int*)&whandle->handle))
return FALSE;
+ pipe_mutex_lock(qdws->bo_handles_mutex);
+ util_hash_table_set(qdws->bo_handles, (void *)(uintptr_t)res->bo_handle, res);
+ pipe_mutex_unlock(qdws->bo_handles_mutex);
}
whandle->stride = stride;
return TRUE;