From: Pranay Samala <pranay.samala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, sameer.lattannavar@intel.com,
pranay.samala@intel.com
Subject: [PATCH i-g-t] tests/chamelium/kms_chamelium_color: Add YUYV and NV12 coverage to color subtests
Date: Mon, 11 May 2026 15:59:36 +0530 [thread overview]
Message-ID: <20260511102936.115495-1-pranay.samala@intel.com> (raw)
Add multi-format coverage to kms_chamelium_color by iterating
DRM_FORMAT_XRGB8888, DRM_FORMAT_YUYV, and DRM_FORMAT_NV12 for
degamma, gamma, CTM, and limited-range CTM subtests.
Dynamic subtest names now include format suffix and unsupported
formats are skipped.
Observed behavior while validating:
ctm-green-to-red: RGB and YUYV render correctly, while NV12
shows a thin dark seam at the green-to-red transition.
ctm-negative: RGB is fully black as expected; YUYV/NV12 are
near-black with faint residual tint.
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
tests/chamelium/kms_chamelium_color.c | 281 +++++++++++++++++---------
1 file changed, 181 insertions(+), 100 deletions(-)
diff --git a/tests/chamelium/kms_chamelium_color.c b/tests/chamelium/kms_chamelium_color.c
index 4b50a148d..d2ced32c8 100644
--- a/tests/chamelium/kms_chamelium_color.c
+++ b/tests/chamelium/kms_chamelium_color.c
@@ -58,6 +58,15 @@
IGT_TEST_DESCRIPTION("Test Color Features at Pipe level using Chamelium to verify instead of CRC");
+static const struct {
+ const char *name;
+ uint32_t format;
+} formats[] = {
+ { "RGB", DRM_FORMAT_XRGB8888 },
+ { "YUYV", DRM_FORMAT_YUYV },
+ { "NV12", DRM_FORMAT_NV12 },
+};
+
/*
* Draw 3 gradient rectangles in red, green and blue, with a maxed out
* degamma LUT and verify we have the same frame dump as drawing solid color
@@ -87,28 +96,40 @@ static bool test_pipe_degamma(data_t *data,
igt_output_set_crtc(output, primary->crtc);
/* Create a framebuffer at the size of the output. */
- fb_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb);
+ fb_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb,
+ 0,
+ 0);
igt_assert(fb_id);
- fb_modeset_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb_modeset);
+ fb_modeset_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb_modeset,
+ 0,
+ 0);
igt_assert(fb_modeset_id);
- fbref_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fbref);
+ fbref_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fbref,
+ 0,
+ 0);
igt_assert(fbref_id);
igt_plane_set_fb(primary, &fb_modeset);
@@ -178,28 +199,40 @@ static bool test_pipe_gamma(data_t *data,
igt_output_set_crtc(output, primary->crtc);
/* Create a framebuffer at the size of the output. */
- fb_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb);
+ fb_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb,
+ 0,
+ 0);
igt_assert(fb_id);
- fb_modeset_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb_modeset);
+ fb_modeset_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb_modeset,
+ 0,
+ 0);
igt_assert(fb_modeset_id);
- fbref_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fbref);
+ fbref_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fbref,
+ 0,
+ 0);
igt_assert(fbref_id);
igt_plane_set_fb(primary, &fbref);
@@ -267,28 +300,40 @@ static bool test_pipe_ctm(data_t *data,
igt_output_set_crtc(output, primary->crtc);
/* Create a framebuffer at the size of the output. */
- fb_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb);
+ fb_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb,
+ 0,
+ 0);
igt_assert(fb_id);
- fb_modeset_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb_modeset);
+ fb_modeset_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb_modeset,
+ 0,
+ 0);
igt_assert(fb_modeset_id);
- fbref_id = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fbref);
+ fbref_id = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fbref,
+ 0,
+ 0);
igt_assert(fbref_id);
igt_plane_set_fb(primary, &fb_modeset);
@@ -372,20 +417,28 @@ static bool test_pipe_limited_range_ctm(data_t *data,
igt_output_set_crtc(output, primary->crtc);
/* Create a framebuffer at the size of the output. */
- fb_id0 = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb0);
+ fb_id0 = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_LIMITED_RANGE,
+ &fb0,
+ 0,
+ 0);
igt_assert(fb_id0);
- fb_id1 = igt_create_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_MOD_LINEAR,
- &fb1);
+ fb_id1 = igt_create_fb_with_bo_size(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ DRM_FORMAT_MOD_LINEAR,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_LIMITED_RANGE,
+ &fb1,
+ 0,
+ 0);
igt_assert(fb_id1);
set_degamma(data, primary->crtc, degamma_linear);
@@ -502,14 +555,25 @@ run_gamma_degamma_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
igt_require(port_idx >= 0);
data->color_depth = 8;
- data->drm_format = DRM_FORMAT_XRGB8888;
data->mode = igt_output_get_mode(data->output);
if (!crtc_output_combo_valid(data, crtc))
return;
- igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc), data->output->name)
- igt_assert(test_t(data, data->primary, data->ports[port_idx]));
+ for (int i = 0; i < ARRAY_SIZE(formats); i++) {
+ igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc),
+ data->output->name, formats[i].name) {
+ if (!igt_plane_has_format_mod(data->primary,
+ formats[i].format,
+ DRM_FORMAT_MOD_LINEAR))
+ continue;
+ igt_info("Running on " IGT_FORMAT_FMT " format\n",
+ IGT_FORMAT_ARGS(formats[i].format));
+ data->drm_format = formats[i].format;
+ igt_assert(test_t(data, data->primary,
+ data->ports[port_idx]));
+ }
+ }
}
static void
@@ -541,41 +605,47 @@ run_ctm_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
*/
data->color_depth = 8;
delta = 1.0 / (1 << data->color_depth);
- data->drm_format = DRM_FORMAT_XRGB8888;
data->mode = igt_output_get_mode(data->output);
if (!crtc_output_combo_valid(data, crtc))
return;
- igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc), data->output->name) {
- bool success = false;
- int i;
-
- if (!iter)
- success = test_pipe_ctm(data, data->primary,
- red_green_blue,
- expected_colors, ctm,
- data->ports[port_idx]);
-
- /*
- * We tests a few values around the expected result because
- * it depends on the hardware we're dealing with, we can either
- * get clamped or rounded values and we also need to account
- * for odd number of items in the LUTs.
- */
- for (i = 0; i < iter; i++) {
- expected_colors[0].r =
- expected_colors[1].g =
- expected_colors[2].b =
- ctm[0] + delta * (i - (iter / 2));
- if (test_pipe_ctm(data, data->primary,
- red_green_blue, expected_colors,
- ctm, data->ports[port_idx])) {
- success = true;
- break;
+ for (int fi = 0; fi < ARRAY_SIZE(formats); fi++) {
+ igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc),
+ data->output->name, formats[fi].name) {
+ bool success = false;
+ int i;
+
+ data->drm_format = formats[fi].format;
+
+ if (!igt_plane_has_format_mod(data->primary,
+ formats[fi].format,
+ DRM_FORMAT_MOD_LINEAR))
+ continue;
+
+ igt_info("Running on " IGT_FORMAT_FMT " format\n",
+ IGT_FORMAT_ARGS(formats[fi].format));
+
+ if (!iter)
+ success = test_pipe_ctm(data, data->primary,
+ red_green_blue,
+ expected_colors, ctm,
+ data->ports[port_idx]);
+
+ for (i = 0; i < iter; i++) {
+ expected_colors[0].r =
+ expected_colors[1].g =
+ expected_colors[2].b =
+ ctm[0] + delta * (i - (iter / 2));
+ if (test_pipe_ctm(data, data->primary,
+ red_green_blue, expected_colors,
+ ctm, data->ports[port_idx])) {
+ success = true;
+ break;
+ }
}
+ igt_assert(success);
}
- igt_assert(success);
}
}
@@ -590,14 +660,25 @@ run_limited_range_ctm_test_for_crtc(data_t *data, igt_crtc_t *crtc,
igt_require(igt_output_has_prop(data->output, IGT_CONNECTOR_BROADCAST_RGB));
data->color_depth = 8;
- data->drm_format = DRM_FORMAT_XRGB8888;
data->mode = igt_output_get_mode(data->output);
if (!crtc_output_combo_valid(data, crtc))
return;
- igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc), data->output->name)
- igt_assert(test_t(data, data->primary, data->ports[port_idx]));
+ for (int i = 0; i < ARRAY_SIZE(formats); i++) {
+ igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc),
+ data->output->name, formats[i].name) {
+ if (!igt_plane_has_format_mod(data->primary,
+ formats[i].format,
+ DRM_FORMAT_MOD_LINEAR))
+ continue;
+ igt_info("Running on " IGT_FORMAT_FMT " format\n",
+ IGT_FORMAT_ARGS(formats[i].format));
+ data->drm_format = formats[i].format;
+ igt_assert(test_t(data, data->primary,
+ data->ports[port_idx]));
+ }
+ }
}
static void
--
2.34.1
next reply other threads:[~2026-05-11 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 10:29 Pranay Samala [this message]
2026-05-12 2:52 ` ✓ i915.CI.BAT: success for tests/chamelium/kms_chamelium_color: Add YUYV and NV12 coverage to color subtests Patchwork
2026-05-12 3:51 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-12 8:30 ` ✓ Xe.CI.FULL: " Patchwork
2026-05-12 15:11 ` ✗ i915.CI.Full: failure " Patchwork
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=20260511102936.115495-1-pranay.samala@intel.com \
--to=pranay.samala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=karthik.b.s@intel.com \
--cc=sameer.lattannavar@intel.com \
/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