From: Jani Nikula <jani.nikula@intel.com>
To: Alex Hung <alex.hung@amd.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
igt-dev@lists.freedesktop.org,
Vitaly Prosyak <vitaly.prosyak@amd.com>,
Harry Wentland <Harry.Wentland@amd.com>
Subject: Re: [PATCH i-g-t 02/12] tests/amdgpu/amd_multidisplay_modeset: Prepare for returning NULL from igt_crtc_for_pipe()
Date: Fri, 20 Mar 2026 12:42:50 +0200 [thread overview]
Message-ID: <c456912da25907ea3d08b7bdfa892a0acf5f7b31@intel.com> (raw)
In-Reply-To: <f2a800dc-34c5-4a78-87ac-ca210340a7c5@amd.com>
On Wed, 18 Mar 2026, Alex Hung <alex.hung@amd.com> wrote:
> On 3/18/26 12:03, Kamil Konieczny wrote:
>> Hi Jani,
>> On 2026-03-16 at 13:19:04 +0200, Jani Nikula wrote:
>>> AMD should always have enough CRTCs for the test. Assert this is the
>>> case by checking the CRTC is valid.
>>>
>>> This prepares for returning NULL for invalid pipes from
>>> igt_crtc_for_pipe() by ensuring the test logic is sound.
>>>
>> +cc AMD devs
>> Cc: Alex Hung <alex.hung@amd.com>
>> Cc: Hersen Wu <hersenxs.wu@amd.com>
>> Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
>>
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>> ---
>>> tests/amdgpu/amd_multidisplay_modeset.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/tests/amdgpu/amd_multidisplay_modeset.c b/tests/amdgpu/amd_multidisplay_modeset.c
>>> index 40d1e5d7f42b..ebcfea8ee35f 100644
>>> --- a/tests/amdgpu/amd_multidisplay_modeset.c
>>> +++ b/tests/amdgpu/amd_multidisplay_modeset.c
>>> @@ -327,6 +327,8 @@ static void multiple_display_test(struct data_t *data, enum sub_test test_mode)
>>>
>>> crtc = igt_crtc_for_pipe(display, j);
>>>
>>> + igt_assert_f(crtc->valid, "There is no pipe %s\n", kmstest_pipe_name(j));
>>> +
>
> As pointed out by Harry in patch 1, igt_crtc_for_pipe can return NULL
> when pipe == PIPE_NONE, and it would be a NULL dereference.
>
> How about just checking crtc?
>
> "igt_assert_f(crtc, "There is no pipe %s\n", kmstest_pipe_name(j));"
Like I said, currently crtc is always != NULL, but might have
!crtc->valid, and the latter is what we want to ensure in this series.
I've sent v2 of the series with more explanation in the cover letter and
commit messages [1].
BR,
Jani.
[1] https://lore.kernel.org/r/cover.1774002591.git.jani.nikula@intel.com
>
>>> igt_create_pattern_fb(data->fd, kmode->hdisplay,
>>> kmode->vdisplay, DRM_FORMAT_XRGB8888,
>>> 0, (buf + j));
>>> --
>>> 2.47.3
>>>
>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-03-20 10:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 11:19 [PATCH i-g-t 00/12] Prepare for returning NULL from igt_crtc_for_pipe() Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 01/12] tests/amdgpu/amd_mode_switch: " Jani Nikula
2026-03-18 18:01 ` Kamil Konieczny
2026-03-18 20:01 ` Harry Wentland
2026-03-18 21:00 ` Alex Hung
2026-03-19 8:36 ` Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 02/12] tests/amdgpu/amd_multidisplay_modeset: " Jani Nikula
2026-03-18 18:03 ` Kamil Konieczny
2026-03-18 21:03 ` Alex Hung
2026-03-20 10:42 ` Jani Nikula [this message]
2026-03-16 11:19 ` [PATCH i-g-t 03/12] tests/intel/kms_cdclk: use igt_next_crtc() Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 04/12] tests/intel/kms_joiner: Prepare for returning NULL from igt_crtc_for_pipe() Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 05/12] tests/intel/kms_joiner_helper: " Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 06/12] tests/intel/kms_pipe_b_c_ivb: " Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 07/12] tests/intel/kms_pipe_stress: " Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 08/12] tests/kms_bw: fix misleading indent Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 09/12] tests/kms_bw: clarify what's going on with proper variable naming Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 10/12] tests/kms_bw: avoid igt_crtc_for_pipe() and crtc->pipe usage Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 11/12] tests/kms_explicit_fence: store igt_crtc_t* instead of pipe in data Jani Nikula
2026-03-16 11:19 ` [PATCH i-g-t 12/12] lib/kms: convert igt_crtc_for_pipe() into a proper function Jani Nikula
2026-03-16 14:54 ` [PATCH i-g-t 00/12] Prepare for returning NULL from igt_crtc_for_pipe() Ville Syrjälä
2026-03-17 7:50 ` Jani Nikula
2026-03-17 6:02 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-17 11:45 ` ✗ i915.CI.BAT: failure " Patchwork
2026-03-18 11:06 ` ✗ Xe.CI.FULL: " Patchwork
2026-03-19 16:07 ` [PATCH i-g-t 00/12] " Ville Syrjälä
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=c456912da25907ea3d08b7bdfa892a0acf5f7b31@intel.com \
--to=jani.nikula@intel.com \
--cc=Harry.Wentland@amd.com \
--cc=alex.hung@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=vitaly.prosyak@amd.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