[PATCH i-g-t 3/7] tests/amdgpu/amd_subvp: s/crtc->pipe/crtc->crtc_index/

Jani Nikula
2026-03-20T11:26:22Z

For amdpgu, crtc->crtc_index == crtc->pipe always. Use the generic and
GPU agnostic crtc->crtc_index instead of the vendor specific crtc->pipe.

This allows us to better highlight the places where crtc->pipe is
actually needed and valid.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Cc: Alex Hung <alex.hung@amd.com>

Review tip: apply and use this to ignore the whitespace changes:

git show --color-words --word-diff-regex="\w+"
---
tests/amdgpu/amd_subvp.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/amdgpu/amd_subvp.c b/tests/amdgpu/amd_subvp.c
index 37879d167e08..61b93e6af509 100644
--- a/tests/amdgpu/amd_subvp.c
+++ b/tests/amdgpu/amd_subvp.c
@@ -64,11 +64,11 @@ static void test_init(struct data *data)
bool subvp_en = false;

for_each_crtc(display, crtc) {
- data->crtc[crtc->pipe] = crtc;
- data->primary[crtc->pipe] = igt_crtc_get_plane_type(crtc,
- DRM_PLANE_TYPE_PRIMARY);
- data->pipe_crc[crtc->pipe] = igt_crtc_crc_new(crtc,
- IGT_PIPE_CRC_SOURCE_AUTO);
+ data->crtc[crtc->crtc_index] = crtc;
+ data->primary[crtc->crtc_index] =
+ igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_PRIMARY);
+ data->pipe_crc[crtc->crtc_index] =
+ igt_crtc_crc_new(crtc, IGT_PIPE_CRC_SOURCE_AUTO);
}

for (i = 0,
@@ -107,7 +107,7 @@ static void test_fini(struct data *data)
igt_crtc_t *crtc;

for_each_crtc(display, crtc) {
- igt_pipe_crc_free(data->pipe_crc[crtc->pipe]);
+ igt_pipe_crc_free(data->pipe_crc[crtc->crtc_index]);
}

igt_display_reset(display);
@@ -127,7 +127,7 @@ static void test_subvp(struct data *data)

for_each_crtc(&data->display, crtc) {
/* Setup the output */
- output = data->output[crtc->pipe];
+ output = data->output[crtc->crtc_index];
if (!output || !igt_output_is_connected(output))
continue;

@@ -140,7 +140,7 @@ static void test_subvp(struct data *data)

igt_output_set_crtc(output,
crtc);
- igt_plane_set_fb(data->primary[crtc->pipe], &rfb);
+ igt_plane_set_fb(data->primary[crtc->crtc_index], &rfb);
igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
}

--
2.47.3