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 15/19] tests/kms: Replace igt_pipe_connector_valid() with igt_crtc_connector_valid()
Date: Wed, 25 Feb 2026 14:51:04 +0200	[thread overview]
Message-ID: <20260225125108.31119-16-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>

Convert most of the remaining igt_pipe_connector_valid()s
to igt_crtc_connector_valid(). This gets rid of more crtc->pipe
stuff from the tests.

 #include "scripts/iterators.cocci"

@@
expression PIPE;
@@
- igt_pipe_connector_valid(PIPE
+ igt_crtc_connector_valid(igt_crtc_for_pipe(display, PIPE)
	,...)

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

@@
expression PIPE, CRTC;
@@
{...
CRTC = igt_crtc_for_pipe(..., PIPE)
<... when != PIPE = ...
- igt_crtc_for_pipe(..., PIPE)
+ CRTC
...>
}

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c                          | 2 +-
 tests/amdgpu/amd_freesync_video_mode.c | 2 +-
 tests/amdgpu/amd_ilr.c                 | 2 +-
 tests/amdgpu/amd_link_settings.c       | 2 +-
 tests/intel/gem_pxp.c                  | 4 ++--
 tests/intel/kms_pm_lpsp.c              | 2 +-
 tests/intel/xe_pxp.c                   | 6 +++---
 tests/kms_content_protection.c         | 2 +-
 tests/kms_tiled_display.c              | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b6d3467c598d..ab27928e777f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -7274,7 +7274,7 @@ bool intel_pipe_output_combo_valid(igt_display_t *display)
 		if (output->pending_pipe == PIPE_NONE)
 			continue;
 
-		if (!igt_pipe_connector_valid(output->pending_pipe, output)) {
+		if (!igt_crtc_connector_valid(igt_crtc_for_pipe(display, output->pending_pipe), output)) {
 			igt_info("Output %s is disconnected (or) pipe-%s & %s cannot be used together\n",
 				 igt_output_name(output),
 				 kmstest_pipe_name(output->pending_pipe),
diff --git a/tests/amdgpu/amd_freesync_video_mode.c b/tests/amdgpu/amd_freesync_video_mode.c
index 3a82464e8d69..fe92dd0329e3 100644
--- a/tests/amdgpu/amd_freesync_video_mode.c
+++ b/tests/amdgpu/amd_freesync_video_mode.c
@@ -845,7 +845,7 @@ run_test(data_t *data, uint32_t scene)
 		}
 
 		for_each_crtc(&data->display, crtc)
-			if (igt_pipe_connector_valid(crtc->pipe, output)) {
+			if (igt_crtc_connector_valid(crtc, output)) {
 				igt_display_reset(&data->display);
 				igt_output_set_crtc(output,
 						    crtc);
diff --git a/tests/amdgpu/amd_ilr.c b/tests/amdgpu/amd_ilr.c
index d6f96cc33804..5dd467b43d10 100644
--- a/tests/amdgpu/amd_ilr.c
+++ b/tests/amdgpu/amd_ilr.c
@@ -87,7 +87,7 @@ static void test_init(data_t *data, igt_output_t *output)
 	set_all_output_pipe_to_none(data);
 
 	for_each_crtc(&data->display, crtc) {
-		if (igt_pipe_connector_valid(crtc->pipe, output)) {
+		if (igt_crtc_connector_valid(crtc, output)) {
 			data->crtc = crtc;
 			break;
 		}
diff --git a/tests/amdgpu/amd_link_settings.c b/tests/amdgpu/amd_link_settings.c
index eaeddfb1599b..ae5f4bb5e0bb 100644
--- a/tests/amdgpu/amd_link_settings.c
+++ b/tests/amdgpu/amd_link_settings.c
@@ -89,7 +89,7 @@ static void test_init(data_t *data, igt_output_t *output)
 	set_all_output_pipe_to_none(data);
 
 	for_each_crtc(&data->display, crtc) {
-		if (igt_pipe_connector_valid(crtc->pipe, output)) {
+		if (igt_crtc_connector_valid(crtc, output)) {
 			data->crtc = crtc;
 			break;
 		}
diff --git a/tests/intel/gem_pxp.c b/tests/intel/gem_pxp.c
index c094d18e5b10..69a16d3420ce 100644
--- a/tests/intel/gem_pxp.c
+++ b/tests/intel/gem_pxp.c
@@ -1228,7 +1228,7 @@ static void test_display_protected_crc(int i915, igt_display_t *display)
 		mode = igt_output_get_mode(output);
 		crtc = igt_crtc_for_pipe(display, i);
 		plane = igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(igt_pipe_connector_valid(i, output));
+		igt_require(igt_crtc_connector_valid(crtc, output));
 		igt_output_set_crtc(output,
 				    crtc);
 
@@ -1248,7 +1248,7 @@ static void test_display_protected_crc(int i915, igt_display_t *display)
 		pipe_crc = igt_crtc_crc_new(crtc,
 					    IGT_PIPE_CRC_SOURCE_AUTO);
 		plane = igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(igt_pipe_connector_valid(crtc->pipe, output));
+		igt_require(igt_crtc_connector_valid(crtc, output));
 		igt_output_set_crtc(output, crtc);
 
 		igt_plane_set_fb(plane, &ref_fb);
diff --git a/tests/intel/kms_pm_lpsp.c b/tests/intel/kms_pm_lpsp.c
index 595c81f0e693..b0f79124e9e5 100644
--- a/tests/intel/kms_pm_lpsp.c
+++ b/tests/intel/kms_pm_lpsp.c
@@ -232,7 +232,7 @@ int igt_main()
 				continue;
 
 			for_each_crtc(display, crtc) {
-				if (!igt_pipe_connector_valid(crtc->pipe, output))
+				if (!igt_crtc_connector_valid(crtc, output))
 					continue;
 
 				/* LPSP is low power single pipe usages i.e. PIPE_A */
diff --git a/tests/intel/xe_pxp.c b/tests/intel/xe_pxp.c
index 48a045e11c51..d45bd8feab97 100644
--- a/tests/intel/xe_pxp.c
+++ b/tests/intel/xe_pxp.c
@@ -849,7 +849,7 @@ static void compare_crcs(int fd, igt_display_t *display, igt_fb_t *ref_fb, igt_f
 		pipe_crc = igt_crtc_crc_new(crtc,
 					    IGT_PIPE_CRC_SOURCE_AUTO);
 		plane = igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(igt_pipe_connector_valid(crtc->pipe, output));
+		igt_require(igt_crtc_connector_valid(crtc, output));
 		igt_output_set_crtc(output, crtc);
 
 		commit_fb(display, plane, ref_fb, mode);
@@ -904,7 +904,7 @@ static void test_display_pxp_fb(int fd, igt_display_t *display)
 		mode = igt_output_get_mode(output);
 		crtc = igt_crtc_for_pipe(display, i);
 		plane = igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(igt_pipe_connector_valid(i, output));
+		igt_require(igt_crtc_connector_valid(crtc, output));
 		igt_output_set_crtc(output,
 				    crtc);
 
@@ -962,7 +962,7 @@ static void test_display_black_pxp_fb(int fd, igt_display_t *display)
 		mode = igt_output_get_mode(output);
 		crtc = igt_crtc_for_pipe(display, i);
 		plane = igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(igt_pipe_connector_valid(i, output));
+		igt_require(igt_crtc_connector_valid(crtc, output));
 		igt_output_set_crtc(output,
 				    crtc);
 
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 2c2ffa150c41..f35c9fa73a57 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -880,7 +880,7 @@ test_content_protection_mst(int content_type)
 		pipe_found = false;
 		for_each_crtc(display, crtc) {
 			if (igt_crtc_is_free(crtc) &&
-			    igt_pipe_connector_valid(crtc->pipe, output)) {
+			    igt_crtc_connector_valid(crtc, output)) {
 				pipe_found = true;
 				break;
 			}
diff --git a/tests/kms_tiled_display.c b/tests/kms_tiled_display.c
index 374ea0bf6a85..8aae2bcaadba 100644
--- a/tests/kms_tiled_display.c
+++ b/tests/kms_tiled_display.c
@@ -246,7 +246,7 @@ static void setup_mode(data_t *data)
 					continue;
 			}
 
-			if (igt_pipe_connector_valid(crtc->pipe, output)) {
+			if (igt_crtc_connector_valid(crtc, output)) {
 				conns[count].crtc = crtc;
 				conns[count].output = output;
 
-- 
2.52.0


  parent reply	other threads:[~2026-02-25 12:52 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 ` [PATCH i-g-t 12/19] tests/kms: Use for_each_plane_on_crtc() Ville Syrjala
2026-02-25 13:53   ` 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 ` Ville Syrjala [this message]
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-16-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