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 1/2] tests/chamelium/kms_chamelium_color: Prepare FB creation for explicit YUV color range handling
Date: Wed, 15 Jul 2026 10:02:25 +0530 [thread overview]
Message-ID: <20260715043226.169521-2-pranay.samala@intel.com> (raw)
In-Reply-To: <20260715043226.169521-1-pranay.samala@intel.com>
Switch framebuffer creation from igt_create_fb() to a common path that can
use igt_create_fb_with_bo_size() when explicit YCbCr encoding/range is
needed.
YUV formats may otherwise be interpreted with implicit limited-range
defaults (16-235) instead of full range (0-255), which can make color
expectations non-deterministic in YUV coverage.
This is a preparatory cleanup and does not fix a user-visible bug.
It refactors FB creation so YUV paths can carry explicit YCbCr
parameters, while RGB paths continue using the default framebuffer
creation behavior.
v2:
- Keep RGB formats on the existing igt_create_fb() path
- Use explicit range/encoding only for YUV formats
- Rebase and split the patches
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
tests/chamelium/kms_chamelium_color.c | 138 ++++++++++++++------------
1 file changed, 72 insertions(+), 66 deletions(-)
diff --git a/tests/chamelium/kms_chamelium_color.c b/tests/chamelium/kms_chamelium_color.c
index 31629ec58..72d7716bc 100644
--- a/tests/chamelium/kms_chamelium_color.c
+++ b/tests/chamelium/kms_chamelium_color.c
@@ -58,6 +58,21 @@
IGT_TEST_DESCRIPTION("Test Color Features at Pipe level using Chamelium to verify instead of CRC");
+static unsigned int create_test_fb(data_t *data, int w, int h,
+ uint32_t format,
+ enum igt_color_encoding encoding,
+ enum igt_color_range range,
+ struct igt_fb *fb)
+{
+ if (igt_format_is_yuv(format))
+ return igt_create_fb_with_bo_size(data->drm_fd, w, h, format,
+ DRM_FORMAT_MOD_LINEAR,
+ encoding, range, fb, 0, 0);
+
+ return igt_create_fb(data->drm_fd, w, h, format,
+ DRM_FORMAT_MOD_LINEAR, fb);
+}
+
/*
* 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 +102,25 @@ 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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb);
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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb_modeset);
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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fbref);
igt_assert(fbref_id);
igt_plane_set_fb(primary, &fb_modeset);
@@ -177,28 +189,27 @@ 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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb);
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 = create_test_fb(data, mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb_modeset);
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 = create_test_fb(data, mode->hdisplay,
+ mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fbref);
igt_assert(fbref_id);
igt_plane_set_fb(primary, &fbref);
@@ -265,28 +276,25 @@ 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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb);
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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb_modeset);
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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fbref);
igt_assert(fbref_id);
igt_plane_set_fb(primary, &fb_modeset);
@@ -369,20 +377,18 @@ 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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb0);
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 = create_test_fb(data, mode->hdisplay, mode->vdisplay,
+ data->drm_format,
+ IGT_COLOR_YCBCR_BT709,
+ IGT_COLOR_YCBCR_FULL_RANGE,
+ &fb1);
igt_assert(fb_id1);
set_degamma(data, primary->crtc, degamma_linear);
--
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 ` Pranay Samala [this message]
2026-07-15 4:32 ` [PATCH i-g-t v2 2/2] tests/chamelium/kms_chamelium_color: Add multi-format coverage for pipe " Pranay Samala
2026-07-15 5:58 ` ✓ Xe.CI.BAT: success for Enable multi-format testing for chamelium " 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-2-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