From: Simon Zeni <simon.zeni@collabora.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 3/3] tests/kms_plane: compare DRM_FORMAT_Y8 plane with greyscale reference CRC
Date: Wed, 25 Nov 2026 14:37:10 -0500 [thread overview]
Message-ID: <20261125193826.57420-3-simon.zeni@collabora.com> (raw)
In-Reply-To: <20261125193826.57420-1-simon.zeni@collabora.com>
The format DRM_FORMAT_Y8 is a specific YUV format that can't properly represent colours, so
comparing the tested plane against the existing reference CRC would yield a mismatch warning.
This introduced a new capture format CRC consisting of a solid grey colour aimed specifically at
greyscale colours which can't represent the full colour spectrum.
Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
---
tests/kms_plane.c | 58 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 56 insertions(+), 2 deletions(-)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 388b869ea..0c6b98321 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -789,6 +789,36 @@ static void capture_format_crcs_single(data_t *data, igt_crtc_t *crtc,
igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &crc[0]);
}
+static void capture_format_crcs_greyscale(data_t *data, igt_crtc_t *crtc,
+ igt_plane_t *plane,
+ uint32_t format, uint64_t modifier,
+ int width, int height,
+ enum igt_color_encoding encoding,
+ enum igt_color_range range,
+ igt_crc_t crc[], struct igt_fb *fb)
+{
+ struct igt_fb old_fb = *fb;
+ const color_t grey = { 0.5f, 0.5f, 0.5f };
+
+ prepare_format_color(data, plane, format, modifier,
+ width, height, encoding, range, &grey, fb, false);
+
+ igt_display_commit2(&data->display, data->display.is_atomic ?
+ COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ igt_remove_fb(data->drm_fd, &old_fb);
+
+ /*
+ * On MediaTek hardware, CRC generation needs time to stabilize after
+ * a pixel format change. Wait for at least one vblank to ensure the
+ * CRC hardware has updated for the new format.
+ */
+ if (is_mtk_device(data->drm_fd))
+ igt_wait_for_vblank(crtc);
+
+ igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &crc[0]);
+}
+
static void capture_format_crcs_multiple(data_t *data, igt_crtc_t *crtc,
igt_plane_t *plane,
uint32_t format, uint64_t modifier,
@@ -939,6 +969,13 @@ static bool test_format_plane_colors(data_t *data, igt_crtc_t *crtc,
width, height, encoding, range, crc,
fb);
total_crcs = data->num_colors;
+ } else if (format == DRM_FORMAT_Y8) {
+ capture_format_crcs_greyscale(data,
+ crtc,
+ plane, format,
+ modifier,
+ width, height, encoding, range, crc,
+ fb);
} else {
capture_format_crcs_single(data,
crtc,
@@ -1049,6 +1086,7 @@ static bool test_format_plane_yuv(data_t *data, igt_crtc_t *crtc,
enum crc_set {
SINGLE_CRC_SET,
+ GREYSCALE_CRC_SET,
MULTIPLE_CRC_SET,
MAX_CRC_SET,
};
@@ -1133,6 +1171,7 @@ static void test_format_plane(data_t *data, igt_crtc_t *crtc,
struct igt_vec tested_formats;
struct format_mod ref = {};
struct format_mod f = {};
+ enum crc_set set;
igt_crc_t* crcset;
bool result = true;
@@ -1178,6 +1217,14 @@ static void test_format_plane(data_t *data, igt_crtc_t *crtc,
IGT_COLOR_YCBCR_LIMITED_RANGE,
ref_crc[SINGLE_CRC_SET], &fb);
+ capture_format_crcs_greyscale(data,
+ crtc,
+ plane, ref.format,
+ ref.modifier,
+ width, height, IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_LIMITED_RANGE,
+ ref_crc[GREYSCALE_CRC_SET], &fb);
+
capture_format_crcs_multiple(data,
crtc,
plane, ref.format,
@@ -1219,8 +1266,15 @@ static void test_format_plane(data_t *data, igt_crtc_t *crtc,
continue;
}
- crcset = ref_crc[use_multiple_colors(data, f.format) ?
- MULTIPLE_CRC_SET : SINGLE_CRC_SET];
+ if (use_multiple_colors(data, f.format)) {
+ set = MULTIPLE_CRC_SET;
+ } else if (f.format == DRM_FORMAT_Y8) {
+ set = GREYSCALE_CRC_SET;
+ } else {
+ set = SINGLE_CRC_SET;
+ }
+
+ crcset = ref_crc[set];
if (igt_format_is_yuv(f.format))
result &= test_format_plane_yuv(data,
--
2.53.0
next prev parent reply other threads:[~2026-11-26 8:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 19:37 [PATCH i-g-t 1/3] drm_uapi/fourcc: sync with drm-next Simon Zeni
2026-11-25 19:37 ` [PATCH i-g-t 2/3] lib/igt_fb: add support for DRM_FORMAT_Y8 Simon Zeni
2026-11-25 19:37 ` Simon Zeni [this message]
2026-11-26 14:46 ` [PATCH i-g-t 1/3] drm_uapi/fourcc: sync with drm-next Kamil Konieczny
2026-11-26 19:31 ` Simon Zeni
2026-11-27 0:41 ` ✓ Xe.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2026-11-27 0:59 ` ✓ i915.CI.BAT: " Patchwork
2026-11-27 13:04 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-28 6:19 ` ✗ i915.CI.Full: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-12-02 16:51 [PATCH i-g-t 0/3] Add support for DRM_FORMAT_Y8 in tests/kms_plane simon.zeni
2026-12-02 16:51 ` [PATCH i-g-t 3/3] tests/kms_plane: compare DRM_FORMAT_Y8 plane with greyscale reference CRC simon.zeni
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=20261125193826.57420-3-simon.zeni@collabora.com \
--to=simon.zeni@collabora.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