From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 4/5] lib/kms: Make igt_first_crtc() skip if no CRTCs are around
Date: Fri, 06 Mar 2026 13:17:54 +0200 [thread overview]
Message-ID: <0d1cff70993e04c94fa2e5d77aaafcb60626661b@intel.com> (raw)
In-Reply-To: <20260305134038.6995-5-ville.syrjala@linux.intel.com>
On Thu, 05 Mar 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Everyone using igt_first_crtc() really needs a CRTC, and thus
> we should just skip if none are around.
>
> Most of the callers neglected to even require the non-NULL
> CRTC, but I think all of the do want a CRTC.
*them
Yeah, I think they'd NULL pointer dereference if this returned NULL.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> Maybe igt_display_require() should even require at least one
> CRTC, but let's do this one small step at a time.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> lib/igt_kms.c | 2 ++
> tests/nouveau_crc.c | 1 -
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 9ebf77b74d04..a9673a9a6565 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7996,6 +7996,8 @@ igt_crtc_t *igt_first_crtc(igt_display_t *display)
> for_each_crtc(display, crtc)
> return crtc;
>
> + igt_skip("No CRTCs on device\n");
> +
> return NULL;
> }
>
> diff --git a/tests/nouveau_crc.c b/tests/nouveau_crc.c
> index b71aac45bb79..cad7edc38f20 100644
> --- a/tests/nouveau_crc.c
> +++ b/tests/nouveau_crc.c
> @@ -402,7 +402,6 @@ int igt_main()
> "is reset to its default value after a single capture.");
> igt_subtest("ctx-flip-threshold-reset-after-capture") {
> data.crtc = igt_first_crtc(&data.display);
> - igt_require(data.crtc);
>
> run_test(&data, test_ctx_flip_threshold_reset_after_capture);
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-03-06 11:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 13:40 [PATCH i-g-t 0/5] kms: A bit more cleanup around igt_kms Ville Syrjala
2026-03-05 13:40 ` [PATCH i-g-t 1/5] tests/nouveau_crc: Extract {setup,cleanup}_test() Ville Syrjala
2026-03-06 11:00 ` Jani Nikula
2026-03-06 20:57 ` Lyude Paul
2026-03-05 13:40 ` [PATCH i-g-t 2/5] tests/nouveau_crc: Convert to dynamic subtests Ville Syrjala
2026-03-06 11:13 ` Jani Nikula
2026-03-06 11:38 ` Ville Syrjälä
2026-03-05 13:40 ` [PATCH i-g-t 3/5] tests/nouveau_crc: Use igt_first_crtc() instead of igt_crtc_for_pipe() Ville Syrjala
2026-03-06 11:14 ` Jani Nikula
2026-03-06 20:57 ` Lyude Paul
2026-03-05 13:40 ` [PATCH i-g-t 4/5] lib/kms: Make igt_first_crtc() skip if no CRTCs are around Ville Syrjala
2026-03-06 11:17 ` Jani Nikula [this message]
2026-03-05 13:40 ` [PATCH i-g-t 5/5] lib/kms: Make igt_first_crtc_with_single_output() skip if no CRTC/output can be found Ville Syrjala
2026-03-06 11:19 ` Jani Nikula
2026-03-05 23:16 ` ✗ Xe.CI.BAT: failure for kms: A bit more cleanup around igt_kms Patchwork
2026-03-05 23:20 ` ✓ i915.CI.BAT: success " Patchwork
2026-03-06 16:32 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-07 3:53 ` ✓ i915.CI.Full: success " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d1cff70993e04c94fa2e5d77aaafcb60626661b@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox