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

Ville Syrjälä
2026-03-10T10:05:53Z

On Mon, Mar 09, 2026 at 04:21:38PM +0200, Jani Nikula wrote:
> 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--;

It looks like when we get rid of the n_crtcs==MAX_PIPES mess
all of these array things could just be nuked. But I suppose
we're not quite there yet.

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

--
Ville Syrjälä
Intel