[PATCH i-g-t 06/10] tests/kms_pipe_crc_basic: use CRTC indexes instead of pipes for CRTC tracking

Jani Nikula
2026-03-09T14:22:25Z

The test tracks "active" CRTCs in a dedicated array. This does not
depend on pipes in any way. Switch to using CRTC indexes instead.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
tests/kms_pipe_crc_basic.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 207707ff2e2d..42e1415452f4 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -78,8 +78,8 @@
*/

static bool extended;
-static enum pipe active_pipes[IGT_MAX_PIPES];
-static uint32_t last_pipe;
+static int active_crtcs[IGT_MAX_PIPES];
+static uint32_t last_crtc_index;

typedef struct {
int drm_fd;
@@ -99,8 +99,8 @@ static struct {
static bool simulation_constraint(igt_crtc_t *crtc)
{
if (igt_run_in_simulation() && !extended &&
- crtc->pipe != active_pipes[0] &&
- crtc->pipe != active_pipes[last_pipe])
+ crtc->crtc_index != active_crtcs[0] &&
+ crtc->crtc_index != active_crtcs[last_crtc_index])
return true;

return false;
@@ -392,7 +392,7 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)
"Hang test for pipe CRC read." },
};
int i;
- last_pipe = 0;
+ last_crtc_index = 0;

igt_fixture() {
data.drm_fd = drm_open_driver_master(DRIVER_ANY);
@@ -409,8 +409,8 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)

/* Get active pipes. */
for_each_crtc(&data.display, crtc)
- active_pipes[last_pipe++] = crtc->pipe;
- last_pipe--;
+ active_crtcs[last_crtc_index++] = crtc->crtc_index;
+ last_crtc_index--;
}

igt_describe("Tests error handling when the bad source is set.");
--
2.47.3