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

Jani Nikula
2026-03-20T11:25:36Z

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_plane.c | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c
index 6831fc43e4a6..da0dc7822575 100644
--- a/tests/amdgpu/amd_plane.c
+++ b/tests/amdgpu/amd_plane.c
@@ -155,20 +155,17 @@ static void test_init(data_t *data)
igt_crtc_t *crtc;

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->overlay[crtc->pipe] = igt_crtc_get_plane_type_index(crtc,
- DRM_PLANE_TYPE_OVERLAY,
- 0);
- data->overlay2[crtc->pipe] = igt_crtc_get_plane_type_index(crtc,
- DRM_PLANE_TYPE_OVERLAY,
- 1);
- data->cursor[crtc->pipe] = igt_crtc_get_plane_type(crtc,
- DRM_PLANE_TYPE_CURSOR);
- 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->overlay[crtc->crtc_index] =
+ igt_crtc_get_plane_type_index(crtc, DRM_PLANE_TYPE_OVERLAY, 0);
+ data->overlay2[crtc->crtc_index] =
+ igt_crtc_get_plane_type_index(crtc, DRM_PLANE_TYPE_OVERLAY, 1);
+ data->cursor[crtc->crtc_index] =
+ igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_CURSOR);
+ data->pipe_crc[crtc->crtc_index] =
+ igt_crtc_crc_new(crtc, IGT_PIPE_CRC_SOURCE_AUTO);
}

for (i = 0, n = 0; i < display->n_outputs && n < max_pipes; ++i) {
@@ -199,7 +196,7 @@ static void test_fini(data_t *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);
--
2.47.3