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 16/21] tests/kms_prime: Use igt_crtc_t instead of enum pipe
Date: Fri, 20 Feb 2026 16:01:48 +0200	[thread overview]
Message-ID: <20260220140154.4138-17-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260220140154.4138-1-ville.syrjala@linux.intel.com>

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

Convert kms_prime to use igt_crtc_t instead of enum pioe .

The complication here is that setup_display() returns
the pipe/crtc via a pointer passed as a function argument.

 #include "scripts/iterators.cocci"

@ret_pipe@
typedef igt_output_t;
typedef igt_crtc_t;
identifier FUNC, PIPE;
expression CRTC;
parameter list[N] P;
@@
FUNC(P
- ,enum pipe *PIPE
+ ,igt_crtc_t **ret_crtc
   ,...)
{
<...
- *PIPE = CRTC->pipe;
+ *ret_crtc = CRTC;
...>
}

@depends on ret_pipe@
identifier ret_pipe.FUNC, PIPE;
expression list[ret_pipe.N] EP;
expression E;
@@
  enum pipe PIPE;
+ igt_crtc_t *crtc;
...
FUNC(EP,
- &PIPE
+ &crtc
  ,...)
<...
- PIPE
+ crtc->pipe
...>

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

@@
identifier PIPE;
@@
{...
- enum pipe PIPE;
... when != PIPE
}

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

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

diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index 7b13e9f538e1..bb85b2e2e0da 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -116,14 +116,14 @@ static bool has_prime_export(int fd)
 }
 
 static igt_output_t *setup_display(int importer_fd, igt_display_t *display,
-				   enum pipe *pipe)
+				   igt_crtc_t **ret_crtc)
 {
 	igt_crtc_t *crtc;
 	igt_output_t *output;
 	bool found = false;
 
 	for_each_crtc_with_valid_output(display, crtc, output) {
-		*pipe = crtc->pipe;
+		*ret_crtc = crtc;
 		igt_display_reset(display);
 
 		igt_output_set_crtc(output,
@@ -388,7 +388,7 @@ static void test_crc(int exporter_fd, int importer_fd)
 	igt_display_t display;
 	igt_output_t *output;
 	igt_pipe_crc_t *pipe_crc;
-	enum pipe pipe;
+	igt_crtc_t *crtc;
 	struct igt_fb fb;
 	int dmabuf_fd;
 	struct dumb_bo scratch = {};
@@ -400,10 +400,10 @@ static void test_crc(int exporter_fd, int importer_fd)
 	igt_require_pipe_crc(importer_fd);
 	igt_display_require(&display, importer_fd);
 
-	output = setup_display(importer_fd, &display, &pipe);
+	output = setup_display(importer_fd, &display, &crtc);
 
 	mode = igt_output_get_mode(output);
-	pipe_crc = igt_crtc_crc_new(igt_crtc_for_pipe(&display, pipe),
+	pipe_crc = igt_crtc_crc_new(crtc,
 				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	for (i = 0; i < ARRAY_SIZE(colors); i++) {
@@ -458,7 +458,7 @@ static void test_basic_modeset(int drm_fd)
 {
 	igt_display_t display;
 	igt_output_t *output;
-	enum pipe pipe;
+	igt_crtc_t *crtc;
 	drmModeModeInfo *mode;
 	struct igt_fb fb;
 	uint32_t bo;
@@ -468,7 +468,7 @@ static void test_basic_modeset(int drm_fd)
 	igt_device_set_master(drm_fd);
 	igt_display_require(&display, drm_fd);
 
-	output = setup_display(drm_fd, &display, &pipe);
+	output = setup_display(drm_fd, &display, &crtc);
 	mode = igt_output_get_mode(output);
 	igt_assert(mode);
 
-- 
2.52.0


  parent reply	other threads:[~2026-02-20 14:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 14:01 [PATCH i-g-t 00/21] tests/kms: More igt_crtc_t conversions Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 01/21] tests/intel/kms_flip_scaled_crc: Remove unused 'enum pipe pipe' Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 02/21] tests/kms_concurrent: Actually run the test over all connected crtcs Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 03/21] tests/amdgpu/amd_abm: Don't use uninitialized 'pipe' Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 04/21] tests/kms: Use 'enum pipe' over int' Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 05/21] lib/kms: Add igt_crtc_for_crtc_id() Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 06/21] tests/kms_lease: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 07/21] tests/kms_lease: Pass lease_t to prepare_crtc() Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 08/21] tests/intel/kms_frontbuffer_tracking: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 09/21] tests/kms_plane_scaling: " Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 10/21] tests/drm_read: " Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 11/21] tests/intel/kms_psr2_sf: Convert pipes[] to crtcs[] Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 12/21] tests/kms_vblank: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 13/21] tests/kms_plane_multiple: " Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 14/21] tests/kms_tiled_display: " Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 15/21] tests/intel/kms_psr: " Ville Syrjala
2026-02-20 14:01 ` Ville Syrjala [this message]
2026-02-20 14:01 ` [PATCH i-g-t 17/21] tests/chamelium: " Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 18/21] tests/kms: Use igt_crtc_t instead of enum pipe, part 1 Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 19/21] tests/kms: Use igt_crtc_t instead of enum pipe, part 2 Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 20/21] tests/kms: Use igt_crtc_t instead of enum pipe, part 3 Ville Syrjala
2026-02-20 14:01 ` [PATCH i-g-t 21/21] tests/kms: Use igt_crtc_t instead of enum pipe, part 4 Ville Syrjala
2026-02-20 17:33 ` ✓ Xe.CI.BAT: success for tests/kms: More igt_crtc_t conversions Patchwork
2026-02-20 17:49 ` ✓ i915.CI.BAT: " Patchwork
2026-02-21  1:27 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-21  6:32 ` ✗ 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=20260220140154.4138-17-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