From: Pranay Samala <pranay.samala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, swati2.sharma@intel.com,
sameer.lattannavar@intel.com, pranay.samala@intel.com
Subject: [PATCH i-g-t v2 2/2] tests/chamelium/kms_chamelium_color: Add multi-format coverage for pipe color tests
Date: Wed, 15 Jul 2026 10:02:26 +0530 [thread overview]
Message-ID: <20260715043226.169521-3-pranay.samala@intel.com> (raw)
In-Reply-To: <20260715043226.169521-1-pranay.samala@intel.com>
Extend chamelium color tests to run across multiple pixel formats
at dynamic subtest level instead of being limited to single format
for gamma/degamma and CTM tests.
This improves coverage for format-dependent pipe color pipeline
behavior.
v2:
- Add formats (P010, RGB10bit, FP16)
- Rebase and split the patches
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
tests/chamelium/kms_chamelium_color.c | 102 +++++++++++++++++---------
1 file changed, 67 insertions(+), 35 deletions(-)
diff --git a/tests/chamelium/kms_chamelium_color.c b/tests/chamelium/kms_chamelium_color.c
index 72d7716bc..77970fa7e 100644
--- a/tests/chamelium/kms_chamelium_color.c
+++ b/tests/chamelium/kms_chamelium_color.c
@@ -58,6 +58,19 @@
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;
+ int bpc;
+} formats[] = {
+ { "XRGB8888", DRM_FORMAT_XRGB8888, 8 },
+ { "YUYV", DRM_FORMAT_YUYV, 8 },
+ { "NV12", DRM_FORMAT_NV12, 8 },
+ { "XRGB2101010", DRM_FORMAT_XRGB2101010, 10 },
+ { "P010", DRM_FORMAT_P010, 10 },
+ { "FP16", DRM_FORMAT_XRGB16161616F, 16 },
+};
+
static unsigned int create_test_fb(data_t *data, int w, int h,
uint32_t format,
enum igt_color_encoding encoding,
@@ -504,15 +517,24 @@ 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++) {
+ if (!igt_plane_has_format_mod(data->primary, formats[i].format,
+ DRM_FORMAT_MOD_LINEAR))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc),
+ data->output->name, formats[i].name) {
+ igt_info("Running on " IGT_FORMAT_FMT " format\n",
+ IGT_FORMAT_ARGS(formats[i].format));
+ data->color_depth = formats[i].bpc;
+ data->drm_format = formats[i].format;
+ igt_assert(test_t(data, data->primary, data->ports[port_idx]));
+ }
+ }
}
static void
@@ -522,6 +544,7 @@ run_ctm_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
int iter)
{
double delta;
+ bool success;
color_t red_green_blue[] = {
{ 1.0, 0.0, 0.0 },
{ 0.0, 1.0, 0.0 },
@@ -542,43 +565,52 @@ run_ctm_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
* We assume an 8bits depth per color for degamma/gamma LUTs
* for CRC checks with framebuffer references.
*/
- 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++) {
+ if (!igt_plane_has_format_mod(data->primary, formats[fi].format,
+ DRM_FORMAT_MOD_LINEAR))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc), data->output->name) {
+ data->color_depth = formats[fi].bpc;
+ delta = 1.0 / (1 << data->color_depth);
+ data->drm_format = formats[fi].format;
+ success = false;
+ int i;
+
+ 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]);
+
+ /*
+ * 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;
+ }
}
+ igt_assert(success);
}
- igt_assert(success);
}
}
--
2.53.0
next prev parent reply other threads:[~2026-07-15 4:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 4:32 [PATCH i-g-t v2 0/2] Enable multi-format testing for chamelium color tests Pranay Samala
2026-07-15 4:32 ` [PATCH i-g-t v2 1/2] tests/chamelium/kms_chamelium_color: Prepare FB creation for explicit YUV color range handling Pranay Samala
2026-07-15 4:32 ` Pranay Samala [this message]
2026-07-15 5:58 ` ✓ Xe.CI.BAT: success for Enable multi-format testing for chamelium color tests Patchwork
2026-07-15 6:23 ` ✓ i915.CI.BAT: " Patchwork
2026-07-15 6:41 ` ✓ i915.CI.Full: " Patchwork
2026-07-15 6:53 ` ✓ Xe.CI.FULL: " 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=20260715043226.169521-3-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 \
--cc=swati2.sharma@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