public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 12/19] tests/kms: Use for_each_plane_on_crtc()
Date: Wed, 25 Feb 2026 14:51:01 +0200	[thread overview]
Message-ID: <20260225125108.31119-13-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260225125108.31119-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Replace for_each_plane_on_pipe() with
for_each_plane_on_crtc(). All callers already have
the crtc around anyway.

 #include "scripts/iterators.cocci"

@@
iterator name for_each_plane_on_pipe;
iterator name for_each_plane_on_crtc;
expression DISPLAY, PIPE, PLANE;
@@
- for_each_plane_on_pipe(DISPLAY, PIPE, PLANE)
+ for_each_plane_on_crtc(igt_crtc_for_pipe(DISPLAY, PIPE), PLANE)
{ ... }

@@
igt_crtc_t *CRTC;
@@
- igt_crtc_for_pipe(..., CRTC->pipe)
+ CRTC

@@
identifier DISPLAY;
@@
- igt_display_t *DISPLAY = ...;
... when != DISPLAY

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c                          | 18 +++++++++++------
 tests/amdgpu/amd_cursor_overlay.c      |  2 +-
 tests/intel/kms_big_fb.c               |  3 ++-
 tests/intel/kms_busy.c                 |  3 ++-
 tests/intel/kms_ccs.c                  |  3 +--
 tests/intel/kms_cdclk.c                |  3 ++-
 tests/intel/kms_frontbuffer_tracking.c |  3 ++-
 tests/intel/kms_legacy_colorkey.c      |  5 +++--
 tests/intel/kms_pipe_stress.c          |  3 ++-
 tests/kms_atomic.c                     |  3 ++-
 tests/kms_atomic_transition.c          | 27 +++++++++++++++++---------
 tests/kms_colorop.c                    |  3 ++-
 tests/kms_cursor_legacy.c              |  2 +-
 tests/kms_debugfs.c                    |  3 ++-
 tests/kms_plane.c                      |  3 ++-
 tests/kms_plane_alpha_blend.c          |  8 ++++----
 tests/kms_plane_lowres.c               |  3 ++-
 tests/kms_plane_multiple.c             |  6 ++++--
 tests/kms_plane_scaling.c              |  9 +++------
 tests/kms_properties.c                 | 12 +++++++-----
 tests/kms_rmfb.c                       |  6 ++++--
 21 files changed, 78 insertions(+), 50 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 8855ba845ed2..b6d3467c598d 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2797,7 +2797,8 @@ void igt_display_reset(igt_display_t *display)
 	for_each_crtc(display, crtc) {
 		igt_plane_t *plane;
 
-		for_each_plane_on_pipe(display, crtc->pipe, plane)
+		for_each_plane_on_crtc(crtc,
+				       plane)
 			igt_plane_reset(plane);
 
 		igt_crtc_reset(crtc);
@@ -4777,7 +4778,8 @@ static int igt_atomic_commit(igt_display_t *display, uint32_t flags, void *user_
 		if (crtc->changed)
 			igt_atomic_prepare_crtc_commit(crtc, req);
 
-		for_each_plane_on_pipe(display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			/* skip planes that are handled by another pipe */
 			if (plane->ref->crtc != crtc)
 				continue;
@@ -4841,7 +4843,8 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 			}
 		}
 
-		for_each_plane_on_pipe(display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			if (s == COMMIT_ATOMIC) {
 				int fd;
 				plane->changed = 0;
@@ -6242,7 +6245,8 @@ static int igt_count_display_format_mod(igt_display_t *display)
 	for_each_crtc(display, crtc) {
 		igt_plane_t *plane;
 
-		for_each_plane_on_pipe(display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			count += plane->format_mod_count;
 		}
 	}
@@ -6284,7 +6288,8 @@ static void igt_fill_display_format_mod(igt_display_t *display)
 	for_each_crtc(display, crtc) {
 		igt_plane_t *plane;
 
-		for_each_plane_on_pipe(display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			for (int i = 0; i < plane->format_mod_count; i++) {
 				igt_add_display_format_mod(display,
 							   plane->formats[i],
@@ -7384,7 +7389,8 @@ int igt_crtc_num_scalers(igt_crtc_t *crtc)
 		 * as a rough approximation of the # of scalars.. it may
 		 * undercount on some hw, but it will not overcount
 		 */
-		for_each_plane_on_pipe(display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			for (unsigned i = 0; i < plane->format_mod_count; i++) {
 				if (igt_format_is_yuv(plane->formats[i])) {
 					num_scalers++;
diff --git a/tests/amdgpu/amd_cursor_overlay.c b/tests/amdgpu/amd_cursor_overlay.c
index 73e1cbcc7919..41c9905b8a6c 100644
--- a/tests/amdgpu/amd_cursor_overlay.c
+++ b/tests/amdgpu/amd_cursor_overlay.c
@@ -89,7 +89,7 @@ static int get_overlay_planes_count(igt_display_t *display, igt_crtc_t *crtc)
 	int count = 0;
 	igt_plane_t *plane;
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane)
+	for_each_plane_on_crtc(crtc, plane)
 		if (plane->type == DRM_PLANE_TYPE_OVERLAY)
 			count++;
 
diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
index 66d7c5428d1e..c99cf51df64d 100644
--- a/tests/intel/kms_big_fb.c
+++ b/tests/intel/kms_big_fb.c
@@ -569,7 +569,8 @@ static bool test_pipe(data_t *data)
 	data->pipe_crc = igt_crtc_crc_new(data->crtc,
 					  IGT_PIPE_CRC_SOURCE_AUTO);
 
-	for_each_plane_on_pipe(&data->display, data->crtc->pipe, data->plane) {
+	for_each_plane_on_crtc(data->crtc,
+			       data->plane) {
 		ret = test_plane(data);
 		if (ret || run_in_simulation)
 			break;
diff --git a/tests/intel/kms_busy.c b/tests/intel/kms_busy.c
index b109766fc4f0..400174faef33 100644
--- a/tests/intel/kms_busy.c
+++ b/tests/intel/kms_busy.c
@@ -97,8 +97,9 @@ static void do_cleanup_display(igt_display_t *dpy)
 	igt_plane_t *plane;
 
 	for_each_crtc(dpy, crtc)
-		for_each_plane_on_pipe(dpy, crtc->pipe, plane)
+	{for_each_plane_on_crtc(crtc, plane)
 			igt_plane_set_fb(plane, NULL);
+	}
 
 	for_each_connected_output(dpy, output)
 		igt_output_set_crtc(output, NULL);
diff --git a/tests/intel/kms_ccs.c b/tests/intel/kms_ccs.c
index 19d12027b68f..2b570af355fc 100644
--- a/tests/intel/kms_ccs.c
+++ b/tests/intel/kms_ccs.c
@@ -1174,8 +1174,7 @@ static void test_output(data_t *data, const int testnum)
 						igt_display_require_output_on_pipe(&data->display,
 										   crtc->pipe);
 
-						for_each_plane_on_pipe(&data->display,
-								       crtc->pipe,
+						for_each_plane_on_crtc(crtc,
 								       data->plane) {
 							if (skip_plane(data, data->plane))
 								continue;
diff --git a/tests/intel/kms_cdclk.c b/tests/intel/kms_cdclk.c
index 73cb962c0fe9..069bf267a170 100644
--- a/tests/intel/kms_cdclk.c
+++ b/tests/intel/kms_cdclk.c
@@ -119,8 +119,9 @@ static void do_cleanup_display(igt_display_t *dpy)
 	igt_plane_t *plane;
 
 	for_each_crtc(dpy, crtc)
-		for_each_plane_on_pipe(dpy, crtc->pipe, plane)
+	{for_each_plane_on_crtc(crtc, plane)
 			igt_plane_set_fb(plane, NULL);
+	}
 
 	for_each_connected_output(dpy, output)
 		igt_output_set_crtc(output, NULL);
diff --git a/tests/intel/kms_frontbuffer_tracking.c b/tests/intel/kms_frontbuffer_tracking.c
index ce0a646d4e80..101ceea1f0bc 100644
--- a/tests/intel/kms_frontbuffer_tracking.c
+++ b/tests/intel/kms_frontbuffer_tracking.c
@@ -2768,7 +2768,8 @@ static void plane_fbc_rte_subtest(const struct test_mode *t)
 
 	wanted_crc = &blue_crcs[t->format].crc;
 
-	for_each_plane_on_pipe(&drm.display, prim_mode_params.crtc->pipe, plane) {
+	for_each_plane_on_crtc(prim_mode_params.crtc,
+			       plane) {
 		if (!is_valid_plane(plane))
 			continue;
 
diff --git a/tests/intel/kms_legacy_colorkey.c b/tests/intel/kms_legacy_colorkey.c
index 15def4f35936..1063a4df309c 100644
--- a/tests/intel/kms_legacy_colorkey.c
+++ b/tests/intel/kms_legacy_colorkey.c
@@ -67,7 +67,8 @@ int igt_main()
 
 		igt_display_require(&display, drm_fd);
 		for_each_crtc(&display, crtc) {
-			for_each_plane_on_pipe(&display, crtc->pipe, plane) {
+			for_each_plane_on_crtc(crtc,
+					       plane) {
 				max_id = max(max_id, plane->drm_plane->plane_id);
 			}
 		}
@@ -79,7 +80,7 @@ int igt_main()
 	igt_subtest_with_dynamic("basic") {
 		for_each_crtc(&display, crtc) {
 			igt_dynamic_f("pipe-%s", igt_crtc_name(crtc)) {
-				for_each_plane_on_pipe(&display, crtc->pipe,
+				for_each_plane_on_crtc(crtc,
 						       plane) {
 					bool is_valid = (plane->type == DRM_PLANE_TYPE_PRIMARY ||
 							 plane->type == DRM_PLANE_TYPE_CURSOR);
diff --git a/tests/intel/kms_pipe_stress.c b/tests/intel/kms_pipe_stress.c
index 72f8a7be23cc..ae8de0de7f80 100644
--- a/tests/intel/kms_pipe_stress.c
+++ b/tests/intel/kms_pipe_stress.c
@@ -447,7 +447,8 @@ static int pipe_stress(struct data *data, igt_output_t *output,
 	if (!data->num_planes[crtc->pipe] || !new_mode)
 		return 0;
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		int plane_width, plane_height;
 		if (plane->type == DRM_PLANE_TYPE_CURSOR) {
 			cursor_plane_set_fb(plane,
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 5e6d1123874e..10d8f991d78a 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -1406,7 +1406,8 @@ static void atomic_clear(data_t *data, igt_crtc_t *crtc, igt_output_t *output)
 {
 	igt_plane_t *plane;
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		igt_plane_set_fb(plane, NULL);
 		igt_plane_set_position(plane, 0, 0);
 	}
diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 701503136b92..80c6f49de274 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -238,7 +238,8 @@ wm_setup_plane(data_t *data, igt_crtc_t *crtc,
 	* because most of the modeset operations must be fast
 	* later on.
 	*/
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		int i = plane->index;
 
 		if (skip_plane(data, plane))
@@ -288,7 +289,8 @@ static void set_sprite_wh(data_t *data, igt_crtc_t *crtc,
 {
 	igt_plane_t *plane;
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		int i = plane->index;
 
 		if (plane->type == DRM_PLANE_TYPE_PRIMARY ||
@@ -338,7 +340,8 @@ static void setup_parms(data_t *data, igt_crtc_t *crtc,
 	if (cursor_height >= mode->vdisplay)
 		cursor_height = mode->vdisplay;
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		int i = plane->index;
 
 		if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
@@ -489,7 +492,8 @@ static void prepare_fencing(data_t *data, igt_crtc_t *crtc)
 	seqno = calloc(n_planes, sizeof(*seqno));
 	igt_assert_f(seqno != NULL, "Failed to allocate memory for seqno\n");
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane)
+	for_each_plane_on_crtc(crtc,
+			       plane)
 		timeline[plane->index] = sw_sync_timeline_create();
 }
 
@@ -501,7 +505,8 @@ static void unprepare_fencing(data_t *data, igt_crtc_t *crtc)
 	if (!timeline)
 		return;
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane)
+	for_each_plane_on_crtc(crtc,
+			       plane)
 		close(timeline[plane->index]);
 
 	free(timeline);
@@ -627,7 +632,8 @@ run_transition_test(data_t *data, igt_crtc_t *crtc, igt_output_t *output,
 			break;
 
 		ret = 0;
-		for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			i = plane->index;
 
 			if (plane->type == DRM_PLANE_TYPE_PRIMARY ||
@@ -661,7 +667,8 @@ run_transition_test(data_t *data, igt_crtc_t *crtc, igt_output_t *output,
 		}
 
 		/* force planes to be part of commit */
-		for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			if (parms[plane->index].mask)
 				igt_plane_set_position(plane, 0, 0);
 		}
@@ -772,7 +779,8 @@ static void test_cleanup(data_t *data, igt_crtc_t *crtc, igt_output_t *output,
 
 	igt_output_set_crtc(output, NULL);
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane)
+	for_each_plane_on_crtc(crtc,
+			       plane)
 		igt_plane_set_fb(plane, NULL);
 
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
@@ -913,7 +921,8 @@ static void refresh_primaries(data_t  *data, int mask)
 		if (!((1 << crtc->pipe) & mask))
 			continue;
 
-		for_each_plane_on_pipe(&data->display, crtc->pipe, plane)
+		for_each_plane_on_crtc(crtc,
+				       plane)
 			if (plane->type == DRM_PLANE_TYPE_PRIMARY)
 				igt_plane_set_position(plane, 0, 0);
 	}
diff --git a/tests/kms_colorop.c b/tests/kms_colorop.c
index bb15350efc66..d535be4e5287 100644
--- a/tests/kms_colorop.c
+++ b/tests/kms_colorop.c
@@ -308,7 +308,8 @@ static void check_plane_colorop_ids(igt_display_t *display)
 	GHashTable *id_set = g_hash_table_new(g_direct_hash, g_direct_equal);
 
 	for_each_crtc(display, crtc) {
-		for_each_plane_on_pipe(display, crtc->pipe, plane) {
+		for_each_plane_on_crtc(crtc,
+				       plane) {
 			/* Skip when a drm_plane is already scanned */
 			if (g_hash_table_contains(plane_set, GINT_TO_POINTER(plane->drm_plane->plane_id)))
 				continue;
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 248fc3b06cae..9720a76dc71b 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -384,7 +384,7 @@ static	igt_plane_t
 {
 	igt_plane_t *plane, *cursor = NULL;
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (plane->type != DRM_PLANE_TYPE_CURSOR)
 			continue;
 
diff --git a/tests/kms_debugfs.c b/tests/kms_debugfs.c
index 1f23eac69979..3b7224fbd4a1 100644
--- a/tests/kms_debugfs.c
+++ b/tests/kms_debugfs.c
@@ -88,8 +88,9 @@ static void igt_display_all_off(igt_display_t *display)
 		igt_output_set_crtc(output, NULL);
 
 	for_each_crtc(display, crtc)
-		for_each_plane_on_pipe(display, crtc->pipe, plane)
+	{for_each_plane_on_crtc(crtc, plane)
 			igt_plane_set_fb(plane, NULL);
+	}
 
 	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 }
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 30655b75c7ea..15924f550ebf 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -1312,7 +1312,8 @@ test_pixel_formats(data_t *data, igt_crtc_t *crtc)
 
 	set_legacy_lut(data, crtc, LUT_MASK);
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		if (skip_plane(data, plane))
 			continue;
 		/* Cursor planes do not support cropping, skip generating subtest on cursor plane */
diff --git a/tests/kms_plane_alpha_blend.c b/tests/kms_plane_alpha_blend.c
index 2ee74d30f558..41a3b71c3861 100644
--- a/tests/kms_plane_alpha_blend.c
+++ b/tests/kms_plane_alpha_blend.c
@@ -172,7 +172,7 @@ static void reset_alpha(igt_display_t *display, igt_crtc_t *crtc)
 {
 	igt_plane_t *plane;
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
 			igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, 0xffff);
 
@@ -539,7 +539,7 @@ static void run_test_on_pipe_planes(data_t *data, igt_crtc_t *crtc,
 	int first_plane = -1;
 	int last_plane = -1;
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
 			continue;
 
@@ -559,7 +559,7 @@ static void run_test_on_pipe_planes(data_t *data, igt_crtc_t *crtc,
 		last_plane = j__;
 	}
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
 			continue;
 
@@ -660,7 +660,7 @@ static bool pipe_check(data_t *data, igt_crtc_t *crtc,
 	bool plane_alpha = false, plane_blend = false, multiply = false;
 
 	igt_display_require_output_on_pipe(display, crtc->pipe);
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
 			continue;
 		plane_alpha = true;
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index 8b4e5809d14e..c9ecd6f56c4e 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -273,7 +273,8 @@ test_planes_on_pipe(data_t *data, uint64_t modifier)
 	igt_plane_t *plane;
 	unsigned tested = 0;
 
-	for_each_plane_on_pipe(&data->display, data->crtc->pipe, plane)
+	for_each_plane_on_crtc(data->crtc,
+			       plane)
 		tested += test_planes_on_pipe_with_output(data, plane, modifier);
 
 	igt_assert(tested > 0);
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index e1b5e8bce47f..297ac7ec2ccf 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -363,7 +363,8 @@ test_plane_position_with_output(data_t *data, igt_crtc_t *crtc,
 			       data->plane1, modifier, c, output, data->fb1);
 		err = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
 
-		for_each_plane_on_pipe(&data->display, crtc->pipe, plane)
+		for_each_plane_on_crtc(crtc,
+				       plane)
 			igt_plane_set_fb(plane, NULL);
 
 		igt_output_set_crtc(output, NULL);
@@ -394,7 +395,8 @@ test_plane_position_with_output(data_t *data, igt_crtc_t *crtc,
 		igt_assert_crc_equal(&data->ref_crc1, &crc);
 		igt_pipe_crc_stop(data->pipe_crc1);
 
-		for_each_plane_on_pipe(&data->display, crtc->pipe, plane)
+		for_each_plane_on_crtc(crtc,
+				       plane)
 			igt_plane_set_fb(plane, NULL);
 
 		igt_output_set_crtc(output, NULL);
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index ac301924f937..6957defd1f3b 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -717,7 +717,6 @@ test_scaler_with_modifier_pipe(data_t *d,
 			       bool is_upscale, igt_crtc_t *crtc,
 			       igt_output_t *output)
 {
-	igt_display_t *display = &d->display;
 	unsigned format = DRM_FORMAT_XRGB8888;
 	igt_plane_t *plane;
 	uint32_t ret;
@@ -726,7 +725,7 @@ test_scaler_with_modifier_pipe(data_t *d,
 
 	igt_output_set_crtc(output, crtc);
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (plane->type == DRM_PLANE_TYPE_CURSOR)
 			continue;
 
@@ -755,7 +754,6 @@ test_scaler_with_rotation_pipe(data_t *d,
 			       bool is_upscale, igt_crtc_t *crtc,
 			       igt_output_t *output)
 {
-	igt_display_t *display = &d->display;
 	unsigned format = DRM_FORMAT_XRGB8888;
 	uint64_t modifier = DRM_FORMAT_MOD_LINEAR;
 	igt_plane_t *plane;
@@ -765,7 +763,7 @@ test_scaler_with_rotation_pipe(data_t *d,
 
 	igt_output_set_crtc(output, crtc);
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		if (plane->type == DRM_PLANE_TYPE_CURSOR)
 			continue;
 
@@ -793,7 +791,6 @@ test_scaler_with_pixel_format_pipe(data_t *d, double sf_plane,
 				   bool is_upscale, igt_crtc_t *crtc,
 				   igt_output_t *output)
 {
-	igt_display_t *display = &d->display;
 	uint64_t modifier = DRM_FORMAT_MOD_LINEAR;
 	igt_plane_t *plane;
 	uint32_t ret;
@@ -802,7 +799,7 @@ test_scaler_with_pixel_format_pipe(data_t *d, double sf_plane,
 
 	igt_output_set_crtc(output, crtc);
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		struct igt_vec tested_formats;
 
 		if (plane->type == DRM_PLANE_TYPE_CURSOR)
diff --git a/tests/kms_properties.c b/tests/kms_properties.c
index 2fbcce6ad864..4f74170949e1 100644
--- a/tests/kms_properties.c
+++ b/tests/kms_properties.c
@@ -93,7 +93,7 @@ static void cleanup_pipe(igt_display_t *display, igt_crtc_t *crtc,
 {
 	igt_plane_t *plane;
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane)
+	for_each_plane_on_crtc(crtc, plane)
 		igt_plane_set_fb(plane, NULL);
 
 	igt_output_set_crtc(output, NULL);
@@ -246,7 +246,7 @@ static void run_colorop_property_tests(igt_display_t *display,
 	prepare_pipe(display, crtc, output,
 		     &fb);
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		igt_info("Testing colorop properties on plane %s.#%d-%s (output: %s)\n",
 			 igt_crtc_name(crtc), plane->index,
 			 kmstest_plane_type_name(plane->type), output->name);
@@ -283,7 +283,7 @@ static void run_plane_property_tests(igt_display_t *display, igt_crtc_t *crtc,
 	prepare_pipe(display, crtc, output,
 		     &fb);
 
-	for_each_plane_on_pipe(display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc, plane) {
 		igt_info("Testing plane properties on %s.#%d-%s (output: %s)\n",
 			 igt_crtc_name(crtc), plane->index,
 			 kmstest_plane_type_name(plane->type), output->name);
@@ -528,8 +528,9 @@ static void test_object_invalid_properties(igt_display_t *display,
 				        DRM_MODE_OBJECT_CRTC, atomic);
 
 	for_each_crtc(display, crtc)
-		for_each_plane_on_pipe(display, crtc->pipe, plane)
+	{for_each_plane_on_crtc(crtc, plane)
 			test_invalid_properties(display->drm_fd, id, type, plane->drm_plane->plane_id, DRM_MODE_OBJECT_PLANE, atomic);
+	}
 
 	for_each_output(display, output)
 		test_invalid_properties(display->drm_fd, id, type, output->id, DRM_MODE_OBJECT_CONNECTOR, atomic);
@@ -936,8 +937,9 @@ static void invalid_properties(igt_display_t *display, bool atomic)
 				               DRM_MODE_OBJECT_CRTC, atomic);
 
 	for_each_crtc(display, crtc)
-		for_each_plane_on_pipe(display, crtc->pipe, plane)
+	{for_each_plane_on_crtc(crtc, plane)
 			test_object_invalid_properties(display, plane->drm_plane->plane_id, DRM_MODE_OBJECT_PLANE, atomic);
+	}
 
 	for_each_output(display, output)
 		test_object_invalid_properties(display, output->id, DRM_MODE_OBJECT_CONNECTOR, atomic);
diff --git a/tests/kms_rmfb.c b/tests/kms_rmfb.c
index 3055dd3b0fe8..80bd51bcb22c 100644
--- a/tests/kms_rmfb.c
+++ b/tests/kms_rmfb.c
@@ -104,7 +104,8 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, igt_crtc_t *crtc,
 	 * because most of the modeset operations must be fast
 	 * later on.
 	 */
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		if (plane->type == DRM_PLANE_TYPE_CURSOR) {
 			igt_plane_set_fb(plane, &argb_fb);
 			igt_fb_set_size(&argb_fb, plane, cursor_width, cursor_height);
@@ -161,7 +162,8 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, igt_crtc_t *crtc,
 
 	drmModeFreeCrtc(drm_crtc);
 
-	for_each_plane_on_pipe(&data->display, crtc->pipe, plane) {
+	for_each_plane_on_crtc(crtc,
+			       plane) {
 		drmModePlanePtr planeres = drmModeGetPlane(data->drm_fd, plane->drm_plane->plane_id);
 
 		igt_assert_eq(planeres->fb_id, 0);
-- 
2.52.0


  parent reply	other threads:[~2026-02-25 12:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 12:50 [PATCH i-g-t 00/19] lib/kms: Clean up more of igt_kms API Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 01/19] tests/kms_plane_multiple: Clean up n_planes stuff Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 02/19] tests/kms_async_flips: Remove redundant data.crtc_id Ville Syrjala
2026-02-25 13:58   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 03/19] tests/kms_lease: Consolidate igt_crtc_for_pipe() calls Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 04/19] tests/kms: " Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 05/19] lib/kms: Introduce igt_first_crtc_with_single_output() Ville Syrjala
2026-02-25 13:59   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 06/19] tests/kms: Use igt_first_crtc_with_single_output() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 07/19] lib/kms: Introduce and use igt_first_crtc() Ville Syrjala
2026-02-25 14:00   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 08/19] tests/kms: Stop using igt_require_pipe() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 09/19] lib/kms: Replace get_num_scalers() with igt_crtc_num_scalers() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 10/19] lib/kms: Pass igt_crtc_t* to igt_max_bpc_constraint() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 11/19] lib/kms: Introduce for_each_plane_on_crtc() Ville Syrjala
2026-02-25 12:51 ` Ville Syrjala [this message]
2026-02-25 13:53   ` [PATCH i-g-t 12/19] tests/kms: Use for_each_plane_on_crtc() Jani Nikula
2026-02-25 12:51 ` [PATCH i-g-t 13/19] lib/kms: Nuke for_each_plane_on_pipe() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 14/19] tests/kms: Switch to for_each_valid_output_on_crtc_local() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 15/19] tests/kms: Replace igt_pipe_connector_valid() with igt_crtc_connector_valid() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 16/19] lib/kms: Intreoduce for_each_valid_output_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 17/19] tests/intel/kms_frontbuffer_tracking: Use for_each_valid_output_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 18/19] tests/kms: " Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 19/19] lib/kms: Nuke for_each_valid_output_on_pipe() Ville Syrjala
2026-02-25 14:06   ` Jani Nikula
2026-02-25 14:07 ` [PATCH i-g-t 00/19] lib/kms: Clean up more of igt_kms API Jani Nikula
2026-02-25 23:34 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-26  0:05 ` ✓ i915.CI.BAT: success " Patchwork
2026-02-26  1:57 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-26 22:06 ` ✓ Xe.CI.BAT: success for lib/kms: Clean up more of igt_kms API (rev2) Patchwork
2026-02-26 22:09 ` ✓ i915.CI.BAT: " Patchwork
2026-02-27  2:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-27  4:24 ` ✗ i915.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=20260225125108.31119-13-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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