From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t v2 21/23] tests/kms: Use igt_crtc_t instead of enum pipe, part 2
Date: Sat, 21 Feb 2026 05:20:00 +0200 [thread overview]
Message-ID: <20260221032003.30936-22-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260221032003.30936-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Convert several kms tests to use igt_crtc_t instead
of enum pipe. These specific tests already track crtcs
alongside pipes (both in arrays) in their data structure.
Remove the redundant pipe information and just rely on the
crtcs.
#include "scripts/iterators.cocci"
@@
igt_display_t DISPLAY;
expression _PIPE;
@@
- &DISPLAY.crtcs[_PIPE]
+ igt_crtc_for_pipe(&DISPLAY, _PIPE)
@@
igt_display_t *DISPLAY;
expression _PIPE;
@@
- &DISPLAY->crtcs[_PIPE]
+ igt_crtc_for_pipe(DISPLAY, _PIPE)
@find_data@
typedef igt_crtc_t;
typedef igt_display_t;
identifier DISPLAY, PIPE, CRTC;
type T;
@@
(
T {
...
igt_display_t DISPLAY;
...
igt_crtc_t *CRTC[...];
...
- enum pipe PIPE[...];
...
};
|
T {
...
- enum pipe PIPE[...];
...
igt_display_t DISPLAY;
...
igt_crtc_t *CRTC[...];
...
};
)
@depends on find_data@
identifier find_data.PIPE;
identifier find_data.CRTC;
identifier find_data.DISPLAY;
find_data.T S;
find_data.T *P;
expression _PIPE, I;
@@
(
- S.PIPE[I] = _PIPE;
+ S.CRTC[I] = igt_crtc_for_pipe(&S.DISPLAY, _PIPE);
|
- P->PIPE[I] = _PIPE;
+ P->CRTC[I] = igt_crtc_for_pipe(&P->DISPLAY, _PIPE);
)
@depends on find_data@
identifier find_data.PIPE;
identifier find_data.CRTC;
identifier find_data.DISPLAY;
find_data.T S;
find_data.T *P;
expression E;
@@
(
- S.PIPE[I] = E
+ S.CRTC[I] = igt_crtc_for_pipe(&S.DISPLAY, E)
|
- P->PIPE[I] = E
+ P->CRTC[I] = igt_crtc_for_pipe(&P->DISPLAY, E)
|
- igt_crtc_for_pipe(..., S.PIPE[I])
+ S.CRTC[I]
|
- igt_crtc_for_pipe(..., P->PIPE[I])
+ P->CRTC[I]
|
- kmstest_pipe_name(S.PIPE[I])
+ igt_crtc_name(S.CRTC[I])
|
- kmstest_pipe_name(P->PIPE[I])
+ igt_crtc_name(P->CRTC[I])
)
@depends on find_data@
identifier find_data.PIPE;
identifier find_data.CRTC;
find_data.T S;
find_data.T *P;
expression I;
@@
(
- S.PIPE[I]
+ S.CRTC[I]->pipe
|
- P->PIPE[I]
+ P->CRTC[I]->pipe
)
@@
igt_crtc_t *CRTC;
@@
- igt_crtc_for_pipe(..., CRTC->pipe)
+ CRTC
@depends on find_data@
identifier find_data.CRTC;
find_data.T S;
find_data.T *P;
expression I, E;
@@
(
S.CRTC[I] = E;
...
- S.CRTC[I] = E;
|
P->CRTC[I] = E;
...
- P->CRTC[I] = E;
)
@depends on find_data@
identifier find_data.CRTC;
find_data.T S;
find_data.T *P;
igt_crtc_t *C;
@@
(
S.CRTC[C->pipe] = ...;
|
P->CRTC[C->pipe] = ...;
|
- S.CRTC[C->pipe]
+ C
|
- P->CRTC[C->pipe]
+ C
)
@@
typedef igt_display_t;
identifier DISPLAY;
@@
- igt_display_t *DISPLAY = ...;
... when != DISPLAY
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/amdgpu/amd_dp_dsc.c | 12 +++++-------
tests/amdgpu/amd_hotplug.c | 4 +---
tests/amdgpu/amd_plane.c | 14 ++++++--------
tests/amdgpu/amd_subvp.c | 4 +---
tests/kms_bw.c | 2 --
5 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c
index d02d66def18a..4403f9205d83 100644
--- a/tests/amdgpu/amd_dp_dsc.c
+++ b/tests/amdgpu/amd_dp_dsc.c
@@ -39,7 +39,6 @@ typedef struct data {
igt_crtc_t *crtc[MAX_PIPES];
igt_pipe_crc_t *pipe_crc[MAX_PIPES];
drmModeModeInfo mode[MAX_PIPES];
- enum pipe pipe_id[MAX_PIPES];
int fd;
} data_t;
@@ -65,7 +64,6 @@ static void test_init(data_t *data)
int i, n;
for_each_crtc(display, crtc) {
- data->pipe_id[crtc->pipe] = crtc->pipe;
data->crtc[crtc->pipe] = crtc;
data->primary[crtc->pipe] = igt_crtc_get_plane_type(crtc,
DRM_PLANE_TYPE_PRIMARY);
@@ -135,7 +133,7 @@ static void test_dsc_enable(data_t *data)
0,
&ref_fb);
igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe_id[crtc->pipe]));
+ crtc);
igt_plane_set_fb(data->primary[crtc->pipe], &ref_fb);
igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
@@ -283,7 +281,7 @@ static void test_dsc_slice_dimensions_change(data_t *data)
0,
&ref_fb);
igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe_id[crtc->pipe]));
+ crtc);
igt_plane_set_fb(data->primary[crtc->pipe], &ref_fb);
igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
@@ -379,7 +377,7 @@ static void test_dsc_link_settings(data_t *data)
0,
&ref_fb[crtc->pipe]);
igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe_id[crtc->pipe]));
+ crtc);
igt_plane_set_fb(data->primary[crtc->pipe],
&ref_fb[crtc->pipe]);
}
@@ -506,7 +504,7 @@ static void test_dsc_bpc(data_t *data)
0,
&ref_fb[crtc->pipe]);
igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe_id[crtc->pipe]));
+ crtc);
igt_plane_set_fb(data->primary[crtc->pipe],
&ref_fb[crtc->pipe]);
}
@@ -529,7 +527,7 @@ static void test_dsc_bpc(data_t *data)
/* Check current bpc */
igt_info("Verifying display %s has correct bpc\n", output->name);
igt_assert_output_bpc_equal(data->fd,
- data->pipe_id[crtc->pipe],
+ crtc->pipe,
output->name,
bpc_vals[bpc]);
diff --git a/tests/amdgpu/amd_hotplug.c b/tests/amdgpu/amd_hotplug.c
index eff4ec42de00..15092cc9fdec 100644
--- a/tests/amdgpu/amd_hotplug.c
+++ b/tests/amdgpu/amd_hotplug.c
@@ -42,7 +42,6 @@ typedef struct data {
igt_crtc_t *crtc[MAX_PIPES];
igt_pipe_crc_t *pipe_crc[MAX_PIPES];
drmModeModeInfo mode[MAX_PIPES];
- enum pipe pipe_id[MAX_PIPES];
int w[MAX_PIPES];
int h[MAX_PIPES];
int fd;
@@ -55,7 +54,6 @@ static void test_init(data_t *data)
igt_crtc_t *crtc;
for_each_crtc(display, crtc) {
- data->pipe_id[crtc->pipe] = crtc->pipe;
data->crtc[crtc->pipe] = crtc;
data->primary[crtc->pipe] = igt_crtc_get_plane_type(crtc,
DRM_PLANE_TYPE_PRIMARY);
@@ -165,7 +163,7 @@ static void test_hotplug_basic(data_t *data, bool suspend)
DRM_FORMAT_XRGB8888, 0,
&ref_fb[crtc->pipe]);
igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe_id[crtc->pipe]));
+ crtc);
igt_plane_set_fb(data->primary[crtc->pipe],
&ref_fb[crtc->pipe]);
}
diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c
index 296deb898e1d..6831fc43e4a6 100644
--- a/tests/amdgpu/amd_plane.c
+++ b/tests/amdgpu/amd_plane.c
@@ -47,7 +47,6 @@ typedef struct data {
igt_crtc_t *crtc[MAX_PIPES];
igt_pipe_crc_t *pipe_crc[MAX_PIPES];
drmModeModeInfo mode[MAX_PIPES];
- enum pipe pipe_id[MAX_PIPES];
int w[MAX_PIPES];
int h[MAX_PIPES];
int fd;
@@ -156,7 +155,6 @@ static void test_init(data_t *data)
igt_crtc_t *crtc;
for_each_crtc(display, crtc) {
- data->pipe_id[crtc->pipe] = crtc->pipe;
data->crtc[crtc->pipe] = crtc;
data->primary[crtc->pipe] = igt_crtc_get_plane_type(crtc,
DRM_PLANE_TYPE_PRIMARY);
@@ -570,7 +568,7 @@ static void test_multi_mpo_invalid(data_t *data)
igt_skip_on(!data->overlay2[0]);
igt_output_set_crtc(data->output[0],
- igt_crtc_for_pipe(display, data->pipe_id[0]));
+ data->crtc[0]);
igt_create_color_fb(data->fd, w, h, DRM_FORMAT_XRGB8888, 0, 1.0, 1.0, 1.0, &fb[0].test_primary);
igt_create_fb(data->fd, w, h, DRM_FORMAT_NV12, 0, &fb[0].test_overlay);
@@ -647,7 +645,7 @@ static void test_display_mpo(data_t *data, enum test test, uint32_t format, int
}
igt_output_set_crtc(data->output[n],
- igt_crtc_for_pipe(display, data->pipe_id[n]));
+ data->crtc[n]);
igt_create_fb(data->fd, w, h, DRM_FORMAT_XRGB8888, 0, &fb[n].ref_primary);
igt_create_color_fb(data->fd, w, h, DRM_FORMAT_XRGB8888, 0, 1.0, 1.0, 1.0, &fb[n].ref_primary);
@@ -735,7 +733,7 @@ static void test_mpo_4k(data_t *data)
0.00, 0.00, 0.00, 0.00);
igt_output_set_crtc(data->output[0],
- igt_crtc_for_pipe(display, data->pipe_id[0]));
+ data->crtc[0]);
igt_plane_set_fb(data->primary[0], &r_fb);
igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
@@ -801,9 +799,9 @@ static void test_mpo_swizzle_toggle_multihead(data_t *data)
/* Initial modeset */
igt_output_set_crtc(data->output[0],
- igt_crtc_for_pipe(display, data->pipe_id[0]));
+ data->crtc[0]);
igt_output_set_crtc(data->output[1],
- igt_crtc_for_pipe(display, data->pipe_id[1]));
+ data->crtc[1]);
force_output_mode(data, data->output[0], &test_mode_1);
force_output_mode(data, data->output[1], &test_mode_2);
@@ -872,7 +870,7 @@ static void test_mpo_swizzle_toggle(data_t *data)
/* Initial modeset */
igt_output_set_crtc(data->output[0],
- igt_crtc_for_pipe(display, data->pipe_id[0]));
+ data->crtc[0]);
force_output_mode(data, data->output[0], &test_mode_1);
igt_plane_set_fb(data->primary[0], &fb_1920_xb24_linear);
diff --git a/tests/amdgpu/amd_subvp.c b/tests/amdgpu/amd_subvp.c
index 6249490a4e5e..37879d167e08 100644
--- a/tests/amdgpu/amd_subvp.c
+++ b/tests/amdgpu/amd_subvp.c
@@ -19,7 +19,6 @@ struct data {
igt_crtc_t *crtc[IGT_MAX_PIPES];
igt_pipe_crc_t *pipe_crc[IGT_MAX_PIPES];
drmModeModeInfo mode[IGT_MAX_PIPES];
- enum pipe pipe_id[IGT_MAX_PIPES];
int fd;
};
@@ -65,7 +64,6 @@ static void test_init(struct data *data)
bool subvp_en = false;
for_each_crtc(display, crtc) {
- data->pipe_id[crtc->pipe] = crtc->pipe;
data->crtc[crtc->pipe] = crtc;
data->primary[crtc->pipe] = igt_crtc_get_plane_type(crtc,
DRM_PLANE_TYPE_PRIMARY);
@@ -141,7 +139,7 @@ static void test_subvp(struct data *data)
&rfb);
igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe_id[crtc->pipe]));
+ crtc);
igt_plane_set_fb(data->primary[crtc->pipe], &rfb);
igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
}
diff --git a/tests/kms_bw.c b/tests/kms_bw.c
index 11f055b23464..778900d8c9f1 100644
--- a/tests/kms_bw.c
+++ b/tests/kms_bw.c
@@ -70,7 +70,6 @@ typedef struct data {
igt_crtc_t *crtc[IGT_MAX_PIPES];
igt_pipe_crc_t *pipe_crc[IGT_MAX_PIPES];
drmModeModeInfo mode[IGT_MAX_PIPES];
- enum pipe pipe_id[IGT_MAX_PIPES];
int w[IGT_MAX_PIPES];
int h[IGT_MAX_PIPES];
int fd;
@@ -126,7 +125,6 @@ static void test_init(data_t *data, bool physical)
data->connected_outputs = 0;
for_each_crtc(display, crtc) {
- data->pipe_id[crtc->pipe] = crtc->pipe;
data->crtc[crtc->pipe] = crtc;
data->primary[crtc->pipe] = igt_crtc_get_plane_type(crtc,
DRM_PLANE_TYPE_PRIMARY);
--
2.52.0
next prev parent reply other threads:[~2026-02-21 3:21 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-21 3:19 [PATCH i-g-t v2 00/23] tests/kms: More igt_crtc_t conversions Ville Syrjala
2026-02-21 3:19 ` [PATCH i-g-t v2 01/23] tests/intel/kms_psr: Don't pass uninitialized 'pipe' to intel_fbc_supported_on_chipset() Ville Syrjala
2026-02-23 11:22 ` Jani Nikula
2026-02-24 7:28 ` Ville Syrjälä
2026-02-23 11:23 ` Jani Nikula
2026-02-23 12:01 ` Jani Nikula
2026-02-24 8:49 ` [PATCH i-g-t v3 " Ville Syrjala
2026-02-24 8:53 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 02/23] tests/intel/kms_psr2_sf: Don't pass zero initialized 'data.pipe' " Ville Syrjala
2026-02-24 8:51 ` [PATCH i-g-t v3 " Ville Syrjala
2026-02-24 8:56 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 03/23] tests/intel/kms_flip_scaled_crc: Remove unused 'enum pipe pipe' Ville Syrjala
2026-02-23 11:34 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 04/23] tests/kms_concurrent: Actually run the test over all connected crtcs Ville Syrjala
2026-02-23 3:09 ` Karthik B S
2026-02-21 3:19 ` [PATCH i-g-t v2 05/23] tests/amdgpu/amd_abm: Don't use uninitialized 'pipe' Ville Syrjala
2026-02-24 14:08 ` Jani Nikula
2026-02-25 9:18 ` Ville Syrjälä
2026-02-21 3:19 ` [PATCH i-g-t v2 06/23] tests/kms: Use 'enum pipe' over int' Ville Syrjala
2026-02-23 11:44 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 07/23] lib/kms: Add igt_crtc_for_crtc_id() Ville Syrjala
2026-02-23 11:46 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 08/23] tests/kms_lease: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-23 11:48 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 09/23] tests/kms_lease: Pass lease_t to prepare_crtc() Ville Syrjala
2026-02-23 11:49 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 10/23] tests/intel/kms_frontbuffer_tracking: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-23 11:52 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 11/23] tests/kms_plane_scaling: " Ville Syrjala
2026-02-23 14:06 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 12/23] tests/drm_read: " Ville Syrjala
2026-02-24 8:58 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 13/23] tests/intel/kms_psr2_sf: Convert pipes[] to crtcs[] Ville Syrjala
2026-02-24 9:09 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 14/23] tests/kms_vblank: Use igt_crtc_t instead of enum pipe Ville Syrjala
2026-02-24 13:43 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 15/23] tests/kms_plane_multiple: " Ville Syrjala
2026-02-24 13:48 ` Jani Nikula
2026-02-25 7:44 ` Ville Syrjälä
2026-02-21 3:19 ` [PATCH i-g-t v2 16/23] tests/kms_tiled_display: " Ville Syrjala
2026-02-24 13:48 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 17/23] tests/intel/kms_psr: " Ville Syrjala
2026-02-24 13:49 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 18/23] tests/kms_prime: " Ville Syrjala
2026-02-24 13:50 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 19/23] tests/chamelium: " Ville Syrjala
2026-02-24 13:51 ` Jani Nikula
2026-02-21 3:19 ` [PATCH i-g-t v2 20/23] tests/kms: Use igt_crtc_t instead of enum pipe, part 1 Ville Syrjala
2026-02-24 13:56 ` Jani Nikula
2026-02-21 3:20 ` Ville Syrjala [this message]
2026-02-24 13:58 ` [PATCH i-g-t v2 21/23] tests/kms: Use igt_crtc_t instead of enum pipe, part 2 Jani Nikula
2026-02-21 3:20 ` [PATCH i-g-t v2 22/23] tests/kms: Use igt_crtc_t instead of enum pipe, part 3 Ville Syrjala
2026-02-24 8:51 ` [PATCH i-g-t v3 " Ville Syrjala
2026-02-24 14:04 ` Jani Nikula
2026-02-21 3:20 ` [PATCH i-g-t v2 23/23] tests/kms: Use igt_crtc_t instead of enum pipe, part 4 Ville Syrjala
2026-02-24 14:06 ` Jani Nikula
2026-02-21 3:59 ` ✓ Xe.CI.BAT: success for tests/kms: More igt_crtc_t conversions (rev2) Patchwork
2026-02-21 4:13 ` ✓ i915.CI.BAT: " Patchwork
2026-02-21 16:12 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-23 13:25 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-24 12:43 ` ✓ Xe.CI.BAT: success for tests/kms: More igt_crtc_t conversions (rev5) Patchwork
2026-02-24 12:58 ` ✓ i915.CI.BAT: " Patchwork
2026-02-24 18:52 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-24 22:57 ` ✓ Xe.CI.FULL: success " 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=20260221032003.30936-22-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