/* Winsys. */
struct radeon_drm_winsys *rws;
- /* List of buffer handles and its mutex. */
- struct util_hash_table *bo_handles;
+ /* List of buffer GEM names. Protected by bo_handles_mutex. */
+ struct util_hash_table *bo_names;
pipe_mutex bo_handles_mutex;
pipe_mutex bo_va_mutex;
if (bo->name) {
pipe_mutex_lock(bo->mgr->bo_handles_mutex);
- util_hash_table_remove(bo->mgr->bo_handles,
+ util_hash_table_remove(bo->mgr->bo_names,
(void*)(uintptr_t)bo->name);
pipe_mutex_unlock(bo->mgr->bo_handles_mutex);
}
static void radeon_bomgr_destroy(struct pb_manager *_mgr)
{
struct radeon_bomgr *mgr = radeon_bomgr(_mgr);
- util_hash_table_destroy(mgr->bo_handles);
+ util_hash_table_destroy(mgr->bo_names);
pipe_mutex_destroy(mgr->bo_handles_mutex);
pipe_mutex_destroy(mgr->bo_va_mutex);
FREE(mgr);
mgr->base.is_buffer_busy = radeon_bomgr_is_buffer_busy;
mgr->rws = rws;
- mgr->bo_handles = util_hash_table_create(handle_hash, handle_compare);
+ mgr->bo_names = util_hash_table_create(handle_hash, handle_compare);
pipe_mutex_init(mgr->bo_handles_mutex);
pipe_mutex_init(mgr->bo_va_mutex);
pipe_mutex_lock(mgr->bo_handles_mutex);
/* First check if there already is an existing bo for the handle. */
- bo = util_hash_table_get(mgr->bo_handles, (void*)(uintptr_t)whandle->handle);
+ bo = util_hash_table_get(mgr->bo_names, (void*)(uintptr_t)whandle->handle);
if (bo) {
/* Increase the refcount. */
struct pb_buffer *b = NULL;
bo->va = 0;
pipe_mutex_init(bo->map_mutex);
- util_hash_table_set(mgr->bo_handles, (void*)(uintptr_t)whandle->handle, bo);
+ util_hash_table_set(mgr->bo_names, (void*)(uintptr_t)whandle->handle, bo);
done:
pipe_mutex_unlock(mgr->bo_handles_mutex);
bo->flink = flink.name;
pipe_mutex_lock(bo->mgr->bo_handles_mutex);
- util_hash_table_set(bo->mgr->bo_handles, (void*)(uintptr_t)bo->flink, bo);
+ util_hash_table_set(bo->mgr->bo_names, (void*)(uintptr_t)bo->flink, bo);
pipe_mutex_unlock(bo->mgr->bo_handles_mutex);
}
whandle->handle = bo->flink;