Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH 1/3] lib/igt_fb: use the entire 32 bit for fnv1a_crc
@ 2023-08-16 20:53 Alex Hung
  2023-08-16 20:53 ` [igt-dev] [PATCH 2/3] lib/igt_fb: add 10 bits (XRGB2101010) supports in fnv1a_crc Alex Hung
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Alex Hung @ 2023-08-16 20:53 UTC (permalink / raw)
  To: igt-dev; +Cc: brian.starkey, maxime

The function was implemented as a 32-bit hashing function. Commit
85f4c1005150 ("lib/igt_fb: Ignore the X component when computing CRC")
broke this behavior by hashing 8-bit portions. Restore the 32-bit hasing
behavior while still ignoring the X compoment.

Signed-off-by: Alex Hung <alex.hung@amd.com>
---
 lib/igt_fb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 60b0e2669..9beb07049 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -4780,16 +4780,11 @@ int igt_fb_get_fnv1a_crc(struct igt_fb *fb, igt_crc_t *crc)
 		igt_memcpy_from_wc(line, ptr, fb->width * cpp);
 
 		for (x = 0; x < fb->width; x++) {
-			unsigned int i;
 			uint32_t pixel = le32_to_cpu(line[x]);
 			pixel &= 0x00ffffff;
 
-			for (i = 0; i < sizeof(pixel); i++) {
-				uint8_t component = (pixel >> (i * 8)) & 0xff;
-
-				hash ^= component;
-				hash *= FNV1a_PRIME;
-			}
+			hash ^= pixel;
+			hash *= FNV1a_PRIME;
 		}
 	}
 
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-08-22 14:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-16 20:53 [igt-dev] [PATCH 1/3] lib/igt_fb: use the entire 32 bit for fnv1a_crc Alex Hung
2023-08-16 20:53 ` [igt-dev] [PATCH 2/3] lib/igt_fb: add 10 bits (XRGB2101010) supports in fnv1a_crc Alex Hung
2023-08-16 20:53 ` [igt-dev] [PATCH 3/3] tests/kms_writeback: support DRM_FORMAT_XRGB2101010 for writeback Alex Hung
2023-08-17  6:32   ` Maxime Ripard
2023-08-17  7:09     ` Alex Hung
2023-08-17  7:50       ` Maxime Ripard
2023-08-17 14:15         ` Harry Wentland
2023-08-17 16:22           ` Alex Hung
2023-08-22 14:14             ` Maxime Ripard
2023-08-22 14:34               ` Harry Wentland
2023-08-22 13:26           ` Maxime Ripard
2023-08-22 14:51             ` Harry Wentland
2023-08-16 23:41 ` [igt-dev] ○ CI.xeBAT: info for series starting with [1/3] lib/igt_fb: use the entire 32 bit for fnv1a_crc Patchwork
2023-08-16 23:47 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-17 11:13 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox