Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Pranay Samala <pranay.samala@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: <karthik.b.s@intel.com>, <sameer.lattannavar@intel.com>
Subject: Re: [PATCH i-g-t v2] tests/kms_color: Add multi-format coverage for pipe color tests
Date: Wed, 27 May 2026 02:07:29 +0530	[thread overview]
Message-ID: <0db525fa-a300-4b8e-adcd-26731bf3252c@intel.com> (raw)
In-Reply-To: <20260526054909.688792-1-pranay.samala@intel.com>

Hi Pranay

On 26-05-2026 11:19 am, Pranay Samala wrote:
> Extend kms_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.
>
> For platforms where only a single format is relevant (e.g. 10-bit
> paths), limit the iteration accordingly to avoid redundant testing.
>
> This improves coverage for format-dependent pipe color pipeline
> behavior.
>
> v2:
> - Add DRM_FORMAT_P010 format
>
> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
> ---
>   tests/kms_color.c | 225 +++++++++++++++++++++++++++++-----------------
>   1 file changed, 144 insertions(+), 81 deletions(-)
>
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 565edb2dc..b0adcd221 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -78,6 +78,16 @@
>   
>   IGT_TEST_DESCRIPTION("Test Color Features at Pipe level");
>   
> +static const struct {
> +	const char *name;
> +	uint32_t format;
> +} formats[] = {
> +	{ "RGB", DRM_FORMAT_XRGB8888 },
> +	{ "YUYV", DRM_FORMAT_YUYV },
> +	{ "NV12", DRM_FORMAT_NV12 },
> +	{ "P010", DRM_FORMAT_P010 },
> +};
> +
>   static bool test_pipe_degamma(data_t *data,
>   			      igt_plane_t *primary)
>   {
> @@ -104,20 +114,28 @@ static bool test_pipe_degamma(data_t *data,
>   	igt_output_override_mode(output, mode);
>   
>   	/* Create a framebuffer at the size of the output. */
> -	fb_id = igt_create_fb(data->drm_fd,
> -			      mode->hdisplay,
> -			      mode->vdisplay,
> -			      data->drm_format,
> -			      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,

Nothing is mentioned "why" are we doing this change in commit. Please 
update commit.

> +					   &fb,
> +					   0,
> +					   0);
>   	igt_assert(fb_id);
>   
> -	fb_modeset_id = igt_create_fb(data->drm_fd,
> -				      mode->hdisplay,
> -				      mode->vdisplay,
> -				      data->drm_format,
> -				      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);
>   
>   	igt_plane_set_fb(primary, &fb_modeset);
> @@ -191,20 +209,28 @@ static bool test_pipe_gamma(data_t *data,
>   	igt_output_override_mode(output, mode);
>   
>   	/* Create a framebuffer at the size of the output. */
> -	fb_id = igt_create_fb(data->drm_fd,
> -			      mode->hdisplay,
> -			      mode->vdisplay,
> -			      data->drm_format,
> -			      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,
> -				      data->drm_format,
> -				      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);
>   
>   	igt_plane_set_fb(primary, &fb_modeset);
> @@ -285,20 +311,28 @@ static bool test_pipe_legacy_gamma(data_t *data,
>   	igt_output_override_mode(output, mode);
>   
>   	/* 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,
> +					   DRM_FORMAT_XRGB8888,
> +					   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,
> +						   DRM_FORMAT_XRGB8888,
> +						   DRM_FORMAT_MOD_LINEAR,
> +						   IGT_COLOR_YCBCR_BT709,
> +						   IGT_COLOR_YCBCR_FULL_RANGE,
> +						   &fb_modeset,
> +						   0,
> +						   0);
>   	igt_assert(fb_modeset_id);
>   
>   	igt_plane_set_fb(primary, &fb_modeset);
> @@ -520,20 +554,28 @@ static bool test_pipe_ctm(data_t *data,
>   	igt_output_override_mode(output, mode);
>   
>   	/* Create a framebuffer at the size of the output. */
> -	fb_id = igt_create_fb(data->drm_fd,
> -			      mode->hdisplay,
> -			      mode->vdisplay,
> -			      data->drm_format,
> -			      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,
> -				      data->drm_format,
> -				      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);
>   	igt_plane_set_fb(primary, &fb_modeset);
>   
> @@ -759,12 +801,23 @@ run_gamma_degamma_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
>   	 * for CRC checks with framebuffer references.
>   	 */
>   	data->color_depth = 8;
> -	data->drm_format = DRM_FORMAT_XRGB8888;
>   	data->mode = igt_output_get_mode(data->output);
>   
>   	igt_require(crtc_output_combo_valid(data, crtc));
>   
> -	igt_assert(test_t(data, data->primary));
> +	for (int i = 0; i < ARRAY_SIZE(formats); i++) {
> +		igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc),
> +			      igt_output_name(data->output),
> +			      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));
> +		}
> +	}
>   
>   	test_cleanup(data);
>   }
> @@ -784,10 +837,10 @@ run_ctm_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
>   		       const double *ctm,
>   		       int iter)
>   {
> -	bool success = false;
> +	bool success;
>   	bool depth_10bit = false;
>   	double delta;
> -	int i;
> +	int i, n_formats;
>   
>   	test_setup(data, crtc);
>   
> @@ -801,7 +854,6 @@ run_ctm_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
>   	 */
>   	data->color_depth = depth_10bit ? 10 : 8;
>   	delta = 1.0 / (1 << data->color_depth);
> -	data->drm_format = depth_10bit ? DRM_FORMAT_XRGB2101010 : DRM_FORMAT_XRGB8888;
>   	data->mode = igt_output_get_mode(data->output);
>   
>   	igt_require(crtc_output_combo_valid(data, crtc));
> @@ -815,24 +867,39 @@ run_ctm_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
>   	 * 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++) {
> -		color_t expected_colors[3] = {
> -			fb_colors[0],
> -			fb_colors[1],
> -			fb_colors[2],
> -		};
> -
> -		transform_color(&expected_colors[0], ctm, delta * (i - (iter / 2)));
> -		transform_color(&expected_colors[1], ctm, delta * (i - (iter / 2)));
> -		transform_color(&expected_colors[2], ctm, delta * (i - (iter / 2)));
> -
> -		if (test_pipe_ctm(data, data->primary, fb_colors,
> -				  expected_colors, ctm)) {
> -			success = true;
> -			break;
> +	n_formats = depth_10bit ? 1 : ARRAY_SIZE(formats);
> +
> +	for (int fi = 0; fi < n_formats; fi++) {
> +		igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc),
> +			      igt_output_name(data->output),
> +			      depth_10bit ? "XRGB2101010" : formats[fi].name) {
> +			success = false;
> +			data->drm_format = depth_10bit ? DRM_FORMAT_XRGB2101010 :
> +							formats[fi].format;
> +
> +			if (!igt_plane_has_format_mod(data->primary, data->drm_format,
> +						      DRM_FORMAT_MOD_LINEAR))
> +				continue;
> +			for (i = 0; i < iter; i++) {
> +				color_t expected_colors[3] = {
> +					fb_colors[0],
> +					fb_colors[1],
> +					fb_colors[2],
> +				};
> +
> +				transform_color(&expected_colors[0], ctm, delta * (i - (iter / 2)));
> +				transform_color(&expected_colors[1], ctm, delta * (i - (iter / 2)));
> +				transform_color(&expected_colors[2], ctm, delta * (i - (iter / 2)));
> +
> +				if (test_pipe_ctm(data, data->primary, fb_colors,
> +						  expected_colors, ctm)) {
> +					success = true;
> +					break;
> +				}
> +			}
> +			igt_assert(success);
>   		}
>   	}
> -	igt_assert(success);
>   
>   	test_cleanup(data);
>   }
> @@ -1126,11 +1193,9 @@ run_tests_for_pipe(data_t *data)
>   		igt_describe_f("%s", gamma_degamma_tests[i].desc);
>   		igt_subtest_with_dynamic_f("%s", gamma_degamma_tests[i].name) {
>   			for_each_crtc_with_valid_output(&data->display, crtc, data->output) {
> -				igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc),
> -					      igt_output_name(data->output))
> -					run_gamma_degamma_tests_for_crtc(data,
> -									 crtc,
> -									 gamma_degamma_tests[i].test_t);
> +				run_gamma_degamma_tests_for_crtc(data,
> +								 crtc,
> +								 gamma_degamma_tests[i].test_t);
>   			}
>   		}
>   	}
> @@ -1139,13 +1204,11 @@ run_tests_for_pipe(data_t *data)
>   		igt_describe_f("%s", ctm_tests[i].desc);
>   		igt_subtest_with_dynamic_f("%s", ctm_tests[i].name) {
>   			for_each_crtc_with_valid_output(&data->display, crtc, data->output) {
> -				igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc),
> -					      igt_output_name(data->output))
> -					run_ctm_tests_for_crtc(data,
> -							       crtc,
> -							       ctm_tests[i].fb_colors,
> -							       ctm_tests[i].ctm,
> -							       ctm_tests[i].iter);
> +				run_ctm_tests_for_crtc(data,
> +						       crtc,
> +						       ctm_tests[i].fb_colors,
> +						       ctm_tests[i].ctm,
> +						       ctm_tests[i].iter);
>   				if (igt_run_in_simulation())
>   					break;
>   			}

      parent reply	other threads:[~2026-05-26 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  5:49 [PATCH i-g-t v2] tests/kms_color: Add multi-format coverage for pipe color tests Pranay Samala
2026-05-26  6:36 ` ✓ Xe.CI.BAT: success for tests/kms_color: Add multi-format coverage for pipe color tests (rev2) Patchwork
2026-05-26  6:53 ` ✓ i915.CI.BAT: " Patchwork
2026-05-26  7:46 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-26 20:37 ` Sharma, Swati2 [this message]

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=0db525fa-a300-4b8e-adcd-26731bf3252c@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=pranay.samala@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