Skip to content
Snippets Groups Projects
Commit 35a09092 authored by Zbigniew Kempczyński's avatar Zbigniew Kempczyński
Browse files

lib/i915/gem_create: Use hash helper for gem bo pool


Remove local 64-bit hash and use common one defined in igt_map.

Signed-off-by: default avatarZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 53d586ab
No related branches found
No related tags found
Loading
Pipeline #815003 passed
......@@ -252,15 +252,6 @@ void gem_pool_dump(void)
pthread_mutex_unlock(&pool_mutex);
}
#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001ULL
static inline uint32_t hash_pool(const void *val)
{
uint64_t hash = *(uint64_t *) val;
hash = hash * GOLDEN_RATIO_PRIME_64;
return hash >> 32;
}
static int equal_pool(const void *a, const void *b)
{
struct pool_list *p1 = (struct pool_list *) a;
......@@ -356,7 +347,7 @@ void gem_pool_init(void)
{
pthread_mutex_init(&pool_mutex, NULL);
__destroy_pool(pool, &pool_mutex);
pool = igt_map_create(hash_pool, equal_pool);
pool = igt_map_create(igt_map_hash_64, equal_pool);
}
igt_constructor {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment