From a37835c8eda017f0c955e0927e7418e7f3ba3b73 Mon Sep 17 00:00:00 2001 From: Martin Andersson Date: Sat, 2 Feb 2013 17:55:07 +0100 Subject: [PATCH] winsys/radeon: fix bo with virtual address referencing mismatch If the same context try to flink and open the object, use the same bo struct instead of opening a new gem handle for the object. This way we avoid avoid having 2 different handle pointing to the same kernel object which can latter lead to trouble with virtual address. Fix: https://bugs.freedesktop.org/show_bug.cgi?id=60200 Signed-off-by: Martin Andersson Reviewed-by: Jerome Glisse --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index bb6e954c542..2d41c267ff7 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -963,6 +963,10 @@ static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer, whandle->handle = bo->handle; } + pipe_mutex_lock(bo->mgr->bo_handles_mutex); + util_hash_table_set(bo->mgr->bo_handles, (void*)(uintptr_t)whandle->handle, bo); + pipe_mutex_unlock(bo->mgr->bo_handles_mutex); + whandle->stride = stride; return TRUE; } -- 2.30.2