diff options
author | Anthony Pesch <[email protected]> | 2020-01-16 09:11:16 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-23 17:06:57 +0000 |
commit | f77369086ced2a76dd33358d28b7bb0706b1157f (patch) | |
tree | a7e7477886a87964f32bac39012cc22dd97df076 /src/etnaviv/drm/etnaviv_device.c | |
parent | 1496cc92f6f743f10e1f3c9c63787d79febfda40 (diff) |
util/hash_table: update users to use new optimal integer hash functions
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
Diffstat (limited to 'src/etnaviv/drm/etnaviv_device.c')
-rw-r--r-- | src/etnaviv/drm/etnaviv_device.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/etnaviv/drm/etnaviv_device.c b/src/etnaviv/drm/etnaviv_device.c index 32991d0a5b3..b1fc6b91c89 100644 --- a/src/etnaviv/drm/etnaviv_device.c +++ b/src/etnaviv/drm/etnaviv_device.c @@ -31,18 +31,6 @@ static pthread_mutex_t etna_drm_table_lock = PTHREAD_MUTEX_INITIALIZER; -static uint32_t -u32_hash(const void *key) -{ - return _mesa_hash_data(key, sizeof(uint32_t)); -} - -static bool -u32_equals(const void *key1, const void *key2) -{ - return *(const uint32_t *)key1 == *(const uint32_t *)key2; -} - struct etna_device *etna_device_new(int fd) { struct etna_device *dev = calloc(sizeof(*dev), 1); @@ -56,8 +44,8 @@ struct etna_device *etna_device_new(int fd) p_atomic_set(&dev->refcnt, 1); dev->fd = fd; - dev->handle_table = _mesa_hash_table_create(NULL, u32_hash, u32_equals); - dev->name_table = _mesa_hash_table_create(NULL, u32_hash, u32_equals); + dev->handle_table = _mesa_hash_table_create(NULL, _mesa_hash_u32, _mesa_key_u32_equal); + dev->name_table = _mesa_hash_table_create(NULL, _mesa_hash_u32, _mesa_key_u32_equal); etna_bo_cache_init(&dev->bo_cache); ret = drmCommandWriteRead(dev->fd, DRM_ETNAVIV_GET_PARAM, &req, sizeof(req)); |