diff options
author | Marek Olšák <[email protected]> | 2020-02-05 14:52:38 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-26 20:35:50 +0000 |
commit | f6d1dd34d76c1930b6f5223ae7e1c6b7f52ec4cd (patch) | |
tree | b83dac41c23afe083a8ffff554b1eb90528e7d15 /src/gallium/winsys/radeon | |
parent | 502840855acac744fbc8dd090d931adc07755ead (diff) |
gallium/hash_table: remove some function wrappers
Reviewed-by: Kristian H. Kristensen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
Diffstat (limited to 'src/gallium/winsys/radeon')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 20 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 14 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 6d3e9c9f752..0f3a8aa67cd 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -361,9 +361,9 @@ void radeon_bo_destroy(struct pb_buffer *_buf) memset(&args, 0, sizeof(args)); mtx_lock(&rws->bo_handles_mutex); - util_hash_table_remove(rws->bo_handles, (void*)(uintptr_t)bo->handle); + _mesa_hash_table_remove_key(rws->bo_handles, (void*)(uintptr_t)bo->handle); if (bo->flink_name) { - util_hash_table_remove(rws->bo_names, + _mesa_hash_table_remove_key(rws->bo_names, (void*)(uintptr_t)bo->flink_name); } mtx_unlock(&rws->bo_handles_mutex); @@ -725,7 +725,7 @@ static struct radeon_bo *radeon_create_bo(struct radeon_drm_winsys *rws, return radeon_bo(b); } - util_hash_table_set(rws->bo_vas, (void*)(uintptr_t)bo->va, bo); + _mesa_hash_table_insert(rws->bo_vas, (void*)(uintptr_t)bo->va, bo); mtx_unlock(&rws->bo_handles_mutex); } @@ -1042,7 +1042,7 @@ no_slab: bo->u.real.use_reusable_pool = use_reusable_pool; mtx_lock(&ws->bo_handles_mutex); - util_hash_table_set(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo); + _mesa_hash_table_insert(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo); mtx_unlock(&ws->bo_handles_mutex); return &bo->base; @@ -1089,7 +1089,7 @@ static struct pb_buffer *radeon_winsys_bo_from_ptr(struct radeon_winsys *rws, bo->hash = __sync_fetch_and_add(&ws->next_bo_hash, 1); (void) mtx_init(&bo->u.real.map_mutex, mtx_plain); - util_hash_table_set(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo); + _mesa_hash_table_insert(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo); mtx_unlock(&ws->bo_handles_mutex); @@ -1123,7 +1123,7 @@ static struct pb_buffer *radeon_winsys_bo_from_ptr(struct radeon_winsys *rws, return b; } - util_hash_table_set(ws->bo_vas, (void*)(uintptr_t)bo->va, bo); + _mesa_hash_table_insert(ws->bo_vas, (void*)(uintptr_t)bo->va, bo); mtx_unlock(&ws->bo_handles_mutex); } @@ -1217,9 +1217,9 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws, (void) mtx_init(&bo->u.real.map_mutex, mtx_plain); if (bo->flink_name) - util_hash_table_set(ws->bo_names, (void*)(uintptr_t)bo->flink_name, bo); + _mesa_hash_table_insert(ws->bo_names, (void*)(uintptr_t)bo->flink_name, bo); - util_hash_table_set(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo); + _mesa_hash_table_insert(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo); done: mtx_unlock(&ws->bo_handles_mutex); @@ -1254,7 +1254,7 @@ done: return b; } - util_hash_table_set(ws->bo_vas, (void*)(uintptr_t)bo->va, bo); + _mesa_hash_table_insert(ws->bo_vas, (void*)(uintptr_t)bo->va, bo); mtx_unlock(&ws->bo_handles_mutex); } @@ -1299,7 +1299,7 @@ static bool radeon_winsys_bo_get_handle(struct radeon_winsys *rws, bo->flink_name = flink.name; mtx_lock(&ws->bo_handles_mutex); - util_hash_table_set(ws->bo_names, (void*)(uintptr_t)bo->flink_name, bo); + _mesa_hash_table_insert(ws->bo_names, (void*)(uintptr_t)bo->flink_name, bo); mtx_unlock(&ws->bo_handles_mutex); } whandle->handle = bo->flink_name; diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index 394ba1f9831..fca5be58751 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -622,9 +622,9 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws) radeon_surface_manager_free(ws->surf_man); } - util_hash_table_destroy(ws->bo_names); - util_hash_table_destroy(ws->bo_handles); - util_hash_table_destroy(ws->bo_vas); + _mesa_hash_table_destroy(ws->bo_names, NULL); + _mesa_hash_table_destroy(ws->bo_handles, NULL); + _mesa_hash_table_destroy(ws->bo_vas, NULL); mtx_destroy(&ws->bo_handles_mutex); mtx_destroy(&ws->vm32.mutex); mtx_destroy(&ws->vm64.mutex); @@ -776,9 +776,9 @@ static bool radeon_winsys_unref(struct radeon_winsys *ws) destroy = pipe_reference(&rws->reference, NULL); if (destroy && fd_tab) { - util_hash_table_remove(fd_tab, intptr_to_pointer(rws->fd)); - if (util_hash_table_count(fd_tab) == 0) { - util_hash_table_destroy(fd_tab); + _mesa_hash_table_remove_key(fd_tab, intptr_to_pointer(rws->fd)); + if (_mesa_hash_table_num_entries(fd_tab) == 0) { + _mesa_hash_table_destroy(fd_tab, NULL); fd_tab = NULL; } } @@ -929,7 +929,7 @@ radeon_drm_winsys_create(int fd, const struct pipe_screen_config *config, return NULL; } - util_hash_table_set(fd_tab, intptr_to_pointer(ws->fd), ws); + _mesa_hash_table_insert(fd_tab, intptr_to_pointer(ws->fd), ws); /* We must unlock the mutex once the winsys is fully initialized, so that * other threads attempting to create the winsys from the same fd will |