Module: Mesa
Branch: 9.1
Commit: 3b609f12f691717f297e8cbb5193edfc09670a6c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b609f12f691717f297e8cbb5193edfc09670a6c

Author: Martin Andersson <[email protected]>
Date:   Sat Feb  2 17:55:07 2013 +0100

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 <[email protected]>
Reviewed-by: Jerome Glisse <[email protected]>
(cherry picked from commit a37835c8eda017f0c955e0927e7418e7f3ba3b73)

---

 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c 
b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index bb6e954..2d41c26 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;
 }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to