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 14/17] tests/kms_display_modes: Use igt_crtc_t instead of enum pipe
Date: Wed, 11 Feb 2026 18:34:01 +0200	[thread overview]
Message-ID: <20260211163404.2018-15-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260211163404.2018-1-ville.syrjala@linux.intel.com>

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

Convert the use of enum pipe to igt_crtc_t in
tests/kms_display_modes.

The complication here is the use of multiple pipes/crtcs
simultaneously.

 #include "scripts/iterators.cocci"

@func@
typedef igt_crtc_t;
identifier FUNC, PIPE1, PIPE2;
parameter list[N] P;
parameter list[N2] P2;
@@
FUNC(P
-	,enum pipe PIPE1
+	,igt_crtc_t *crtc1
	,P2
-	,enum pipe PIPE2
+	,igt_crtc_t *crtc2
	,...)
{
<+...
(
- igt_crtc_for_pipe(..., PIPE1)
+ crtc1
|
- kmsetst_crtc_name(PIPE1)
+ igt_crtc_name(crtc1)
|
- PIPE1
+ crtc1->pipe
|
- igt_crtc_for_pipe(..., PIPE2)
+ crtc2
|
- kmsetst_crtc_name(PIPE2)
+ igt_crtc_name(crtc2)
|
- PIPE2
+ crtc2->pipe
)
...+>
}

@depends on func@
identifier func.FUNC;
expression PIPE1, PIPE2;
expression list[func.N] EP;
expression list[func.N2] EP2;
@@
 FUNC(EP
-	,PIPE1
+	,igt_crtc_for_pipe(display, PIPE1)
	,EP2
-	,PIPE2
+	,igt_crtc_for_pipe(display, PIPE2)
	,...)

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

@@
typedef igt_display_t;
identifier DISPLAY;
expression E;
@@
- igt_display_t *DISPLAY = E;
... when != DISPLAY

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_display_modes.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/tests/kms_display_modes.c b/tests/kms_display_modes.c
index f3888375c966..60585bed0218 100644
--- a/tests/kms_display_modes.c
+++ b/tests/kms_display_modes.c
@@ -72,9 +72,9 @@ static bool output_is_dp_mst(data_t *data, igt_output_t *output, int i)
 	return true;
 }
 
-static void run_extendedmode_basic(data_t *data,
-				   enum pipe pipe1, igt_output_t *output1,
-				   enum pipe pipe2, igt_output_t *output2)
+static void run_extendedmode_basic(data_t *data, igt_crtc_t *crtc1,
+				   igt_output_t *output1, igt_crtc_t *crtc2,
+				   igt_output_t *output2)
 {
 	struct igt_fb fb, fbs[2];
 	drmModeModeInfo *mode[2];
@@ -88,18 +88,18 @@ static void run_extendedmode_basic(data_t *data,
 	igt_display_reset(display);
 
 	igt_output_set_crtc(output1,
-			    igt_crtc_for_pipe(display, pipe1));
+			    crtc1);
 	igt_output_set_crtc(output2,
-			    igt_crtc_for_pipe(display, pipe2));
+			    crtc2);
 
 	mode[0] = igt_output_get_mode(output1);
 	mode[1] = igt_output_get_mode(output2);
 
 	igt_assert_f(igt_fit_modes_in_bw(display), "Unable to fit modes in bw\n");
 
-	pipe_crc[0] = igt_crtc_crc_new(igt_crtc_for_pipe(display, pipe1),
+	pipe_crc[0] = igt_crtc_crc_new(crtc1,
 				       IGT_PIPE_CRC_SOURCE_AUTO);
-	pipe_crc[1] = igt_crtc_crc_new(igt_crtc_for_pipe(display, pipe2),
+	pipe_crc[1] = igt_crtc_crc_new(crtc2,
 				       IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_create_color_fb(data->drm_fd, mode[0]->hdisplay, mode[0]->vdisplay,
@@ -107,9 +107,9 @@ static void run_extendedmode_basic(data_t *data,
 	igt_create_color_fb(data->drm_fd, mode[1]->hdisplay, mode[1]->vdisplay,
 			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, 0, 0, 1, &fbs[1]);
 
-	plane[0] = igt_crtc_get_plane_type(igt_crtc_for_pipe(display, pipe1),
+	plane[0] = igt_crtc_get_plane_type(crtc1,
 					   DRM_PLANE_TYPE_PRIMARY);
-	plane[1] = igt_crtc_get_plane_type(igt_crtc_for_pipe(display, pipe2),
+	plane[1] = igt_crtc_get_plane_type(crtc2,
 					   DRM_PLANE_TYPE_PRIMARY);
 
 	igt_plane_set_fb(plane[0], &fbs[0]);
@@ -163,10 +163,10 @@ static void run_extendedmode_basic(data_t *data,
 	igt_output_set_crtc(output1, NULL);
 	igt_output_set_crtc(output2, NULL);
 
-	igt_plane_set_fb(igt_crtc_get_plane_type(igt_crtc_for_pipe(display, pipe1),
+	igt_plane_set_fb(igt_crtc_get_plane_type(crtc1,
 						 DRM_PLANE_TYPE_PRIMARY),
 			 NULL);
-	igt_plane_set_fb(igt_crtc_get_plane_type(igt_crtc_for_pipe(display, pipe2),
+	igt_plane_set_fb(igt_crtc_get_plane_type(crtc2,
 						 DRM_PLANE_TYPE_PRIMARY),
 			 NULL);
 	igt_assert_f(igt_fit_modes_in_bw(display), "Unable to fit modes in bw\n");
@@ -224,10 +224,10 @@ static void run_extendedmode_test(data_t *data) {
 						      igt_crtc_name(crtc2),
 						      igt_output_name(output2))
 						run_extendedmode_basic(data,
-								crtc->pipe,
-								output1,
-								crtc2->pipe,
-								output2);
+								       crtc,
+								       output1,
+								       crtc2,
+								       output2);
 				}
 			}
 			/*
-- 
2.52.0


  parent reply	other threads:[~2026-02-11 16:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 16:33 [PATCH i-g-t 00/17] tests/kms: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 01/17] tests/kms_plane_alpha_blend: " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 02/17] tests/kms: Remove unused 'pipe' function parameters Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 03/17] tests/kms: Remove const qualifier from " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 04/17] tests/intel/kms_busy: Use 'enum pipe' instead of 'int' Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 05/17] tests/kms_atomic_interruptible: s/crtc/drm_crtc/ Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 06/17] tests/intel/kms_psr2_su: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 07/17] tests/intel/kms_dsc*: " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 08/17] tests/kms_cursor_legacy: " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 09/17] tests/kms_color*: " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 10/17] tests/kms_atomic_transition: " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 11/17] tests/kms_plane: " Ville Syrjala
2026-02-11 16:33 ` [PATCH i-g-t 12/17] tests/intel/kms_pipe_b_c_ivb: " Ville Syrjala
2026-02-11 16:34 ` [PATCH i-g-t 13/17] tests/kms_vrr: " Ville Syrjala
2026-02-11 16:34 ` Ville Syrjala [this message]
2026-02-11 16:34 ` [PATCH i-g-t 15/17] tests/kms_rotation_crc: " Ville Syrjala
2026-02-11 16:34 ` [PATCH i-g-t 16/17] tests/kms_properties: " Ville Syrjala
2026-02-11 16:34 ` [PATCH i-g-t 17/17] tests/kms: " Ville Syrjala
2026-02-11 17:35 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-11 17:47 ` ✓ i915.CI.BAT: success " Patchwork
2026-02-12  6:18 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-12  9:42 ` [PATCH i-g-t 00/17] " Jani Nikula
2026-02-13  2:09 ` ✗ Xe.CI.FULL: failure for " 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=20260211163404.2018-15-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