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

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

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_cursor_crc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index bd0226c4800f..1e062c38b668 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -165,8 +165,8 @@ typedef struct {
} data_t;

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;

#define TEST_DPMS (1<<0)
#define TEST_SUSPEND (1<<1)
@@ -900,12 +900,12 @@ static bool valid_pipe_output_combo(data_t *data)
static bool execution_constraint(igt_crtc_t *crtc)
{
if (!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;

if (!extended && igt_run_in_simulation() &&
- crtc->pipe != active_pipes[0])
+ crtc->crtc_index != active_crtcs[0])
return true;

return false;
@@ -1278,7 +1278,7 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)
igt_fixture() {
igt_crtc_t *crtc;

- last_pipe = 0;
+ last_crtc_index = 0;

data.drm_fd = drm_open_driver_master(DRIVER_ANY);

@@ -1286,8 +1286,8 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)
igt_display_require_output(&data.display);
/* 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--;

ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
igt_assert(ret == 0 || errno == EINVAL);
--
2.47.3