From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/3] lib/i915/gem_create: Use hash helper for gem bo pool
Date: Thu, 23 Feb 2023 11:53:21 +0100 [thread overview]
Message-ID: <20230223105321.49048-3-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20230223105321.49048-1-zbigniew.kempczynski@intel.com>
Remove local 64-bit hash and use common one defined in igt_map.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
lib/i915/gem_create.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/lib/i915/gem_create.c b/lib/i915/gem_create.c
index 1f9b7fcc01..99c839d7db 100644
--- a/lib/i915/gem_create.c
+++ b/lib/i915/gem_create.c
@@ -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 {
--
2.34.1
next prev parent reply other threads:[~2023-02-23 10:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 10:53 [igt-dev] [PATCH i-g-t 1/3] lib/igt_map: Add 32-bit and 64-bit hash helper functions Zbigniew Kempczyński
2023-02-23 10:53 ` [igt-dev] [PATCH i-g-t 2/3] lib/intel_allocator_*: Use common hash helpers Zbigniew Kempczyński
2023-02-23 11:26 ` Mauro Carvalho Chehab
2023-02-23 10:53 ` Zbigniew Kempczyński [this message]
2023-02-23 11:26 ` [igt-dev] [PATCH i-g-t 3/3] lib/i915/gem_create: Use hash helper for gem bo pool Mauro Carvalho Chehab
2023-02-23 11:26 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_map: Add 32-bit and 64-bit hash helper functions Mauro Carvalho Chehab
2023-02-23 12:28 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2023-02-23 15:15 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-02-23 17:07 ` Zbigniew Kempczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230223105321.49048-3-zbigniew.kempczynski@intel.com \
--to=zbigniew.kempczynski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox