From: Alex Hung <alex.hung@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: brian.starkey@arm.com, maxime@cerno.tech
Subject: [igt-dev] [PATCH 2/3][i-g-t][V3] lib/igt_fb: add 10 bits (XRGB2101010) supports in fnv1a_crc
Date: Fri, 15 Sep 2023 16:52:36 -0600 [thread overview]
Message-ID: <20230915225237.116176-3-alex.hung@amd.com> (raw)
In-Reply-To: <20230915225237.116176-1-alex.hung@amd.com>
Allow 10 bits (DRM_FORMAT_XRGB2101010) components to be hashed
as well.
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
lib/igt_fb.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index f60150017..281e99771 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -4754,7 +4754,7 @@ int igt_fb_get_fnv1a_crc(struct igt_fb *fb, igt_crc_t *crc)
if (fb->num_planes != 1)
return -EINVAL;
- if (fb->drm_format != DRM_FORMAT_XRGB8888)
+ if (fb->drm_format != DRM_FORMAT_XRGB8888 && fb->drm_format != DRM_FORMAT_XRGB2101010)
return -EINVAL;
ptr = igt_fb_map_buffer(fb->fd, fb);
@@ -4780,7 +4780,11 @@ int igt_fb_get_fnv1a_crc(struct igt_fb *fb, igt_crc_t *crc)
for (x = 0; x < fb->width; x++) {
uint32_t pixel = le32_to_cpu(line[x]);
- pixel &= 0x00ffffff;
+
+ if (fb->drm_format == DRM_FORMAT_XRGB8888)
+ pixel &= 0x00ffffff;
+ else if (fb->drm_format == DRM_FORMAT_XRGB2101010)
+ pixel &= 0x3fffffff;
hash ^= pixel;
hash *= FNV1a_PRIME;
--
2.42.0
next prev parent reply other threads:[~2023-09-15 22:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 22:52 [igt-dev] [PATCH 0/3][i-g-t][V3] kms_writeback: support DRM_FORMAT_XRGB2101010 in kms_writeback Alex Hung
2023-09-15 22:52 ` [igt-dev] [PATCH 1/3][i-g-t][V3] lib/igt_fb: use the entire 32 bit for fnv1a_crc Alex Hung
2023-09-15 22:52 ` Alex Hung [this message]
2023-09-15 22:52 ` [igt-dev] [PATCH 3/3][i-g-t][V3] tests/kms_writeback: support DRM_FORMAT_XRGB2101010 for writeback Alex Hung
2023-09-16 0:28 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_writeback: support DRM_FORMAT_XRGB2101010 in kms_writeback (rev3) Patchwork
2023-09-16 1:55 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-09-16 10:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-18 19:41 ` [igt-dev] ✓ CI.xeBAT: success for kms_writeback: support DRM_FORMAT_XRGB2101010 in kms_writeback (rev4) Patchwork
2023-09-18 19:50 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-09-19 5:30 ` [igt-dev] ✗ CI.xeBAT: failure for kms_writeback: support DRM_FORMAT_XRGB2101010 in kms_writeback (rev5) Patchwork
2023-09-19 5:36 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-09-20 4:47 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-22 19:22 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_writeback: support DRM_FORMAT_XRGB2101010 in kms_writeback (rev6) Patchwork
2023-09-22 20:34 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-09-23 22:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-25 12:46 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2023-09-25 13:34 ` [igt-dev] [PATCH 0/3][i-g-t][V3] kms_writeback: support DRM_FORMAT_XRGB2101010 in kms_writeback Harry Wentland
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=20230915225237.116176-3-alex.hung@amd.com \
--to=alex.hung@amd.com \
--cc=brian.starkey@arm.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=maxime@cerno.tech \
/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