[PATCH i-g-t v2 00/11] Prepare for returning NULL from igt_crtc_for_pipe()

Jani Nikula
2026-03-20T10:39:43Z

v2 of [1]. Patch 1 dropped, as it was handled through other means. Commit
messages amended slightly here and there to explain the logic.

The idea is:

1. In this series, we check crtc->valid for each CRTC returned by
igt_crtc_for_pipe(). It currently always returns a non-NULL CRTC, but
crtc->valid may be false. Such CRTCs should never be used by tests,
obviously. So we check that here, to ensure the tests are sane. (Plus reduce
igt_crtc_for_pipe() usage in general.)

2. In follow-up, sent separately, we change igt_crtc_for_pipe() to return NULL
instead of igt_crtc_t objects that have crtc->valid == false, *and* change
all the crtc->valid to just !NULL checks. After the series at hand, this will
be a non-functional change.

So the point of this series is to do the test crtc->valid sanity checks commit
by commit for easy bisectability in case there are any issues. After a few more
patches, we'll only ever have valid igt_crtc_t objects around, and can simplify
more.

BR,
Jani.

[1] https://lore.kernel.org/r/cover.1773659680.git.jani.nikula@intel.com

Jani Nikula (11):
tests/amdgpu/amd_multidisplay_modeset: Prepare for returning NULL from
igt_crtc_for_pipe()
tests/intel/kms_cdclk: use igt_next_crtc()
tests/intel/kms_joiner: Prepare for returning NULL from
igt_crtc_for_pipe()
tests/intel/kms_joiner_helper: Prepare for returning NULL from
igt_crtc_for_pipe()
tests/intel/kms_pipe_b_c_ivb: Prepare for returning NULL from
igt_crtc_for_pipe()
tests/intel/kms_pipe_stress: Prepare for returning NULL from
igt_crtc_for_pipe()
tests/kms_bw: fix misleading indent
tests/kms_bw: clarify what's going on with proper variable naming
tests/kms_bw: avoid igt_crtc_for_pipe() and crtc->pipe usage
tests/kms_explicit_fence: store igt_crtc_t* instead of pipe in data
lib/kms: convert igt_crtc_for_pipe() into a proper function

lib/igt_kms.c | 8 +++
lib/igt_kms.h | 8 +--
tests/amdgpu/amd_multidisplay_modeset.c | 2 +
tests/intel/kms_cdclk.c | 10 ++--
tests/intel/kms_joiner.c | 66 ++++++++++++++++++-------
tests/intel/kms_joiner_helper.c | 16 +++---
tests/intel/kms_pipe_b_c_ivb.c | 28 +++++++----
tests/intel/kms_pipe_stress.c | 4 ++
tests/kms_bw.c | 48 +++++++++---------
tests/kms_explicit_fence.c | 14 +++---
10 files changed, 129 insertions(+), 75 deletions(-)

--
2.47.3