public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v3 1/4] tests/kms_color_pipeline: use atomic commit helper consistently
@ 2026-02-23 14:32 Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 2/4] tests/kms_color_pipeline: Run tests on all supported planes Chaitanya Kumar Borah
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chaitanya Kumar Borah @ 2026-02-23 14:32 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, chaitanya.kumar.borah

The color pipeline is an atomic-only feature, so kms_color_pipeline
should not rely on the legacy-compatible commit path.

Replace igt_display_commit2(COMMIT_ATOMIC) with
igt_display_commit_atomic() throughout the test to make the atomic
requirement explicit and avoid any ambiguity around commit paths.

No functional change intended.

v2:
 - Rebase

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_color_pipeline.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/kms_color_pipeline.c b/tests/kms_color_pipeline.c
index 7445b1456..3b270e86e 100644
--- a/tests/kms_color_pipeline.c
+++ b/tests/kms_color_pipeline.c
@@ -43,7 +43,7 @@ static void test_cleanup(data_t *data)
 	}
 
 	igt_output_set_crtc(data->output, NULL);
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 }
 
 static void test_setup(data_t *data, igt_crtc_t *crtc)
@@ -61,7 +61,7 @@ static void test_setup(data_t *data, igt_crtc_t *crtc)
 	data->pipe_crc = igt_crtc_crc_new(data->primary->crtc,
 					  IGT_PIPE_CRC_SOURCE_AUTO);
 
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 }
 
 static bool ctm_colorop_only(kms_colorop_t *colorops[])
@@ -108,14 +108,14 @@ static bool test_plane_colorops(data_t *data,
 	disable_ctm(plane->crtc);
 	disable_degamma(plane->crtc);
 	disable_gamma(plane->crtc);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	igt_display_commit_atomic(&data->display, 0, NULL);
 
 	/* Reference (software-equivalent) CRC */
 	set_color_pipeline_bypass(plane);
 	paint_rectangles(data, mode, exp_colors, &fb);
 
 	igt_plane_set_fb(plane, &fb);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	igt_display_commit_atomic(&data->display, 0, NULL);
 	igt_wait_for_vblank(plane->crtc);
 	igt_pipe_crc_collect_crc(data->pipe_crc, &crc_ref);
 
@@ -131,7 +131,7 @@ static bool test_plane_colorops(data_t *data,
 		paint_gradient_rectangles(data, mode, fb_colors, &fb);
 
 	igt_plane_set_fb(plane, &fb);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	igt_display_commit_atomic(&data->display, 0, NULL);
 	igt_wait_for_vblank(plane->crtc);
 	igt_pipe_crc_collect_crc(data->pipe_crc, &crc_pipe);
 
@@ -141,7 +141,7 @@ static bool test_plane_colorops(data_t *data,
 	set_color_pipeline_bypass(plane);
 	reset_colorops(colorops);
 	igt_plane_set_fb(plane, NULL);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	igt_display_commit_atomic(&data->display, 0, NULL);
 
 	igt_remove_fb(data->drm_fd, &fb);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH i-g-t v3 2/4] tests/kms_color_pipeline: Run tests on all supported planes
  2026-02-23 14:32 [PATCH i-g-t v3 1/4] tests/kms_color_pipeline: use atomic commit helper consistently Chaitanya Kumar Borah
@ 2026-02-23 14:32 ` Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 3/4] tests/kms_color_pipeline: Disable pipe color properties in test setup Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 4/4] tests/kms_color_pipeline: collect reference CRC once per pipe Chaitanya Kumar Borah
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kumar Borah @ 2026-02-23 14:32 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, chaitanya.kumar.borah

Extend the color pipeline tests to run on all planes of a pipe that
exposes COLOR_PIPELINE property instead of only the primary plane.

v3:
 - Rebase

v2:
 - Rebase
 - Remove unused variable (Swati)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_color_pipeline.c | 57 +++++++++++++++++++++-----------------
 1 file changed, 32 insertions(+), 25 deletions(-)

diff --git a/tests/kms_color_pipeline.c b/tests/kms_color_pipeline.c
index 3b270e86e..e5914e2cc 100644
--- a/tests/kms_color_pipeline.c
+++ b/tests/kms_color_pipeline.c
@@ -58,7 +58,7 @@ static void test_setup(data_t *data, igt_crtc_t *crtc)
 	data->mode = igt_output_get_mode(data->output);
 	igt_require(data->mode);
 
-	data->pipe_crc = igt_crtc_crc_new(data->primary->crtc,
+	data->pipe_crc = igt_crtc_crc_new(crtc,
 					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
@@ -79,18 +79,17 @@ static bool ctm_colorop_only(kms_colorop_t *colorops[])
 	return true;
 }
 
-static bool test_plane_colorops(data_t *data,
-				const color_t *fb_colors,
-				const color_t *exp_colors,
-				kms_colorop_t *colorops[])
+static void _test_plane_colorops(data_t *data,
+				 igt_plane_t *plane,
+				 const color_t *fb_colors,
+				 const color_t *exp_colors,
+				 kms_colorop_t *colorops[])
 {
-	igt_plane_t *plane = data->primary;
 	igt_display_t *display = &data->display;
 	drmModeModeInfo *mode = data->mode;
 	igt_colorop_t *color_pipeline;
 	igt_crc_t crc_ref, crc_pipe;
 	struct igt_fb fb;
-	bool ret;
 
 	color_pipeline = get_color_pipeline(display, plane, colorops);
 	igt_skip_on(!color_pipeline);
@@ -135,7 +134,7 @@ static bool test_plane_colorops(data_t *data,
 	igt_wait_for_vblank(plane->crtc);
 	igt_pipe_crc_collect_crc(data->pipe_crc, &crc_pipe);
 
-	ret = igt_check_crc_equal(&crc_ref, &crc_pipe);
+	igt_assert_crc_equal(&crc_ref, &crc_pipe);
 
 	/* Cleanup per-test state */
 	set_color_pipeline_bypass(plane);
@@ -144,8 +143,26 @@ static bool test_plane_colorops(data_t *data,
 	igt_display_commit_atomic(&data->display, 0, NULL);
 
 	igt_remove_fb(data->drm_fd, &fb);
+}
 
-	return ret;
+static void test_plane_colorops(data_t *data, igt_crtc_t *crtc,
+				const color_t *fb_colors,
+				const color_t *exp_colors,
+				kms_colorop_t *colorops[])
+{
+	int n_planes = crtc->n_planes;
+	igt_output_t *output = data->output;
+	igt_plane_t *plane;
+
+	for (int plane_id = 0; plane_id < n_planes; plane_id++) {
+		plane = igt_output_get_plane(output, plane_id);
+
+		if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_PIPELINE))
+			continue;
+
+		igt_dynamic_f("pipe-%s-plane-%u", kmstest_pipe_name(crtc->pipe), plane_id)
+			_test_plane_colorops(data, plane, fb_colors, exp_colors, colorops);
+	}
 }
 
 static void
@@ -282,23 +299,13 @@ run_tests_for_plane(data_t *data)
 				test_setup(data,
 					   crtc);
 
-				if (!igt_plane_has_prop(data->primary, IGT_PLANE_COLOR_PIPELINE)) {
-					test_cleanup(data);
-					continue;
-				}
-
-				igt_dynamic_f("pipe-%s-%s",
-					       igt_crtc_name(crtc),
-					       igt_output_name(data->output)) {
-					data->color_depth = 8;
-					data->drm_format = DRM_FORMAT_XRGB8888;
-
-					igt_assert(test_plane_colorops(data,
-								       plane_colorops_tests[i].fb_colors,
-								       plane_colorops_tests[i].exp_colors,
-								       plane_colorops_tests[i].colorops));
-				}
+				data->color_depth = 8;
+				data->drm_format = DRM_FORMAT_XRGB8888;
 
+				test_plane_colorops(data, crtc,
+						    plane_colorops_tests[i].fb_colors,
+						    plane_colorops_tests[i].exp_colors,
+						    plane_colorops_tests[i].colorops);
 				test_cleanup(data);
 			}
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH i-g-t v3 3/4] tests/kms_color_pipeline: Disable pipe color properties in test setup
  2026-02-23 14:32 [PATCH i-g-t v3 1/4] tests/kms_color_pipeline: use atomic commit helper consistently Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 2/4] tests/kms_color_pipeline: Run tests on all supported planes Chaitanya Kumar Borah
@ 2026-02-23 14:32 ` Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 4/4] tests/kms_color_pipeline: collect reference CRC once per pipe Chaitanya Kumar Borah
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kumar Borah @ 2026-02-23 14:32 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, chaitanya.kumar.borah

Move disabling of pipe-level color properties (CTM, degamma, gamma)
from the individual plane color tests into the common test setup.

v2:
 - Rebase

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_color_pipeline.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/kms_color_pipeline.c b/tests/kms_color_pipeline.c
index e5914e2cc..41808718f 100644
--- a/tests/kms_color_pipeline.c
+++ b/tests/kms_color_pipeline.c
@@ -61,6 +61,11 @@ static void test_setup(data_t *data, igt_crtc_t *crtc)
 	data->pipe_crc = igt_crtc_crc_new(crtc,
 					  IGT_PIPE_CRC_SOURCE_AUTO);
 
+	/* Disable Pipe color props. */
+	disable_ctm(crtc);
+	disable_degamma(crtc);
+	disable_gamma(crtc);
+
 	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 }
 
@@ -103,10 +108,6 @@ static void _test_plane_colorops(data_t *data,
 				 &fb));
 	igt_plane_set_fb(plane, &fb);
 
-	/* Disable Pipe color props. */
-	disable_ctm(plane->crtc);
-	disable_degamma(plane->crtc);
-	disable_gamma(plane->crtc);
 	igt_display_commit_atomic(&data->display, 0, NULL);
 
 	/* Reference (software-equivalent) CRC */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH i-g-t v3 4/4] tests/kms_color_pipeline: collect reference CRC once per pipe
  2026-02-23 14:32 [PATCH i-g-t v3 1/4] tests/kms_color_pipeline: use atomic commit helper consistently Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 2/4] tests/kms_color_pipeline: Run tests on all supported planes Chaitanya Kumar Borah
  2026-02-23 14:32 ` [PATCH i-g-t v3 3/4] tests/kms_color_pipeline: Disable pipe color properties in test setup Chaitanya Kumar Borah
@ 2026-02-23 14:32 ` Chaitanya Kumar Borah
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kumar Borah @ 2026-02-23 14:32 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, chaitanya.kumar.borah

The reference (software-equivalent) CRC is being recomputed
for every plane even though it is identical across planes for
a given test configuration. Refactor the test to collect the
reference CRC once per pipe and reuse it for all planes.

v3:
 - Rebase

v2:
 - Rebase
 - s/test_grab_crc/capture_ref_crc (Swati)
 - Use DRM_PLANE_TYPE_PRIMARY (Swati)
 - s/igt_skip_on/igt_assert/ (Swati)
 - Add a comment explaining why CRC capture on the
   primary plane is sufficient (Swati)
 - Wait for vblank before CRC collection (Swati)
 - s/reference_crc/ref_crc (Swati)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_color_pipeline.c | 66 +++++++++++++++++++++++++++++---------
 1 file changed, 50 insertions(+), 16 deletions(-)

diff --git a/tests/kms_color_pipeline.c b/tests/kms_color_pipeline.c
index 41808718f..3b4b85758 100644
--- a/tests/kms_color_pipeline.c
+++ b/tests/kms_color_pipeline.c
@@ -84,16 +84,58 @@ static bool ctm_colorop_only(kms_colorop_t *colorops[])
 	return true;
 }
 
+static void
+capture_ref_crc(data_t *data, igt_output_t *output,
+		const color_t *fb_color, igt_crc_t *crc /* out */)
+{
+	struct igt_fb fb;
+	drmModeModeInfo *mode;
+	igt_plane_t *primary;
+	char *crc_str;
+	int ret;
+
+	/*
+	 * Since CRC is collected at Pipe level,
+	 * collecting crc for primary plane
+	 * is enough for reference.
+	 */
+	primary = igt_output_get_plane(output, DRM_PLANE_TYPE_PRIMARY);
+
+	mode = igt_output_get_mode(output);
+	igt_assert_fd(igt_create_fb(data->drm_fd,
+				    mode->hdisplay, mode->vdisplay,
+				    DRM_FORMAT_XRGB8888,
+				    DRM_FORMAT_MOD_LINEAR,
+				    &fb));
+
+	paint_rectangles(data, mode, fb_color, &fb);
+	igt_plane_set_fb(primary, &fb);
+	ret = igt_display_try_commit_atomic(&data->display, 0, NULL);
+	igt_assert(!ret);
+
+	igt_wait_for_vblank(primary->crtc);
+	igt_pipe_crc_collect_crc(data->pipe_crc, crc);
+
+	igt_plane_set_fb(primary, NULL);
+	igt_display_commit_atomic(&data->display, 0, NULL);
+
+	igt_remove_fb(data->drm_fd, &fb);
+
+	crc_str = igt_crc_to_string(crc);
+	igt_debug("CRC for reference fb: %s\n", crc_str);
+	free(crc_str);
+}
+
 static void _test_plane_colorops(data_t *data,
 				 igt_plane_t *plane,
 				 const color_t *fb_colors,
-				 const color_t *exp_colors,
+				 igt_crc_t *crc_ref,
 				 kms_colorop_t *colorops[])
 {
 	igt_display_t *display = &data->display;
 	drmModeModeInfo *mode = data->mode;
 	igt_colorop_t *color_pipeline;
-	igt_crc_t crc_ref, crc_pipe;
+	igt_crc_t crc_pipe;
 	struct igt_fb fb;
 
 	color_pipeline = get_color_pipeline(display, plane, colorops);
@@ -106,18 +148,6 @@ static void _test_plane_colorops(data_t *data,
 				 DRM_FORMAT_XRGB8888,
 				 DRM_FORMAT_MOD_LINEAR,
 				 &fb));
-	igt_plane_set_fb(plane, &fb);
-
-	igt_display_commit_atomic(&data->display, 0, NULL);
-
-	/* Reference (software-equivalent) CRC */
-	set_color_pipeline_bypass(plane);
-	paint_rectangles(data, mode, exp_colors, &fb);
-
-	igt_plane_set_fb(plane, &fb);
-	igt_display_commit_atomic(&data->display, 0, NULL);
-	igt_wait_for_vblank(plane->crtc);
-	igt_pipe_crc_collect_crc(data->pipe_crc, &crc_ref);
 
 	/* Hardware pipeline CRC */
 	set_color_pipeline(display, plane, colorops, color_pipeline);
@@ -135,7 +165,7 @@ static void _test_plane_colorops(data_t *data,
 	igt_wait_for_vblank(plane->crtc);
 	igt_pipe_crc_collect_crc(data->pipe_crc, &crc_pipe);
 
-	igt_assert_crc_equal(&crc_ref, &crc_pipe);
+	igt_assert_crc_equal(crc_ref, &crc_pipe);
 
 	/* Cleanup per-test state */
 	set_color_pipeline_bypass(plane);
@@ -154,6 +184,9 @@ static void test_plane_colorops(data_t *data, igt_crtc_t *crtc,
 	int n_planes = crtc->n_planes;
 	igt_output_t *output = data->output;
 	igt_plane_t *plane;
+	igt_crc_t ref_crc;
+
+	capture_ref_crc(data, output, exp_colors, &ref_crc);
 
 	for (int plane_id = 0; plane_id < n_planes; plane_id++) {
 		plane = igt_output_get_plane(output, plane_id);
@@ -162,7 +195,8 @@ static void test_plane_colorops(data_t *data, igt_crtc_t *crtc,
 			continue;
 
 		igt_dynamic_f("pipe-%s-plane-%u", kmstest_pipe_name(crtc->pipe), plane_id)
-			_test_plane_colorops(data, plane, fb_colors, exp_colors, colorops);
+			_test_plane_colorops(data, plane, fb_colors,
+					     &ref_crc, colorops);
 	}
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-23 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 14:32 [PATCH i-g-t v3 1/4] tests/kms_color_pipeline: use atomic commit helper consistently Chaitanya Kumar Borah
2026-02-23 14:32 ` [PATCH i-g-t v3 2/4] tests/kms_color_pipeline: Run tests on all supported planes Chaitanya Kumar Borah
2026-02-23 14:32 ` [PATCH i-g-t v3 3/4] tests/kms_color_pipeline: Disable pipe color properties in test setup Chaitanya Kumar Borah
2026-02-23 14:32 ` [PATCH i-g-t v3 4/4] tests/kms_color_pipeline: collect reference CRC once per pipe Chaitanya Kumar Borah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox