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 <g02maran@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit a37835c8ed)
This commit is contained in:
Martin Andersson 2013-02-02 17:55:07 +01:00 committed by Jerome Glisse
parent ecd310bd67
commit 3b609f12f6

View file

@ -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;
}