public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Jing-Ping Jan <jingpingjan@google.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	<igt-dev@lists.freedesktop.org>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Juha-Pekka Heikkila <juha-pekka.heikkila@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>
Subject: Re: [PATCH i-g-t] tests/kms: correct index validation logic
Date: Tue, 21 Apr 2026 11:43:09 +0530	[thread overview]
Message-ID: <b4757a01-6cff-4c92-b7ba-5a6578c7c06a@intel.com> (raw)
In-Reply-To: <CAMYCwo6_=W8reh5s+Ne6UZxDXSHdLRzraPbZk8BEJuNfcVUa8A@mail.gmail.com>

Hi Jing-Ping,

On 4/21/2026 7:37 AM, Jing-Ping Jan wrote:
> Hi Kamil,
> On Tue, Apr 21, 2026 at 2:16 AM Kamil Konieczny
> <kamil.konieczny@linux.intel.com> wrote:
>> Hi Jing-Ping,
>> On 2026-04-20 at 15:49:25 +0800, Jing-Ping Jan wrote:
>>> Based on the original implementation and the comment above the function,
>>> it appears the expected behavior is for the plane indices to remain
>>> consistent with those in crtc->planes. Therefore, after swapping the old
>>> and new primary planes, we must update the index in igt_plane_t to
>>> ensure it matches the corresponding index in crtc->planes.
>>>
>>> Therefore, we should expect the indices of the old and new primary
>>> planes to remain unchanged after swapping them.
>>>
>>> Signed-off-by: Jing-Ping Jan <jingpingjan@google.com>
>>> ---
>>>   lib/igt_kms.c | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>>> index bec96f267..405a04640 100644
>>> --- a/lib/igt_kms.c
>>> +++ b/lib/igt_kms.c
>>> @@ -2982,8 +2982,8 @@ void igt_display_reset_outputs(igt_display_t *display)
>>>                                igt_swap(*old_primary, *new_primary);
>>>                                igt_swap(old_primary->index, new_primary->index);
>>>
>>> -                             igt_assert_neq(old_primary->index, 0);
>>> -                             igt_assert_eq(new_primary->index, 0);
>>> +                             igt_assert_eq(old_primary->index, 0);
>>> +                             igt_assert_neq(new_primary->index, 0);
>> Do you have an error report for this? This code is lib
>> and should also trigger in Intel CI, unless it is a dead
>> code.
>>
>> +cc Karthik, Swati, and J-P
>>
>> Regards,
>> Kamil
>>
>>>                        } else {
>>>                                igt_assert(old_primary == new_primary);
>>>
>>> --
>>> 2.54.0.rc1.513.gad8abe7a5a-goog
>>>
> I do not have a specific error report available at this time. This
> change is based on an issue we encountered and the existing comment in
> the code, which indicates that plane indices should remain consistent
> with those in crtc->planes after a swap.
>
> Regarding the lack of Intel CI hits, I suspect the bug depends on the
> primary plane not being the first plane in the driver's index. CI
> likely hasn't encountered this because it doesn't test this specific
> plane ordering.
>
> Please see the following output from our testing:
>
> (kms_getfb:20359) INFO: IGT-Version: IGT_VERSION-GIT (arm64) (Linux:
> 6.6.118-android15-8-g34da635f9b82-ab14801981-4k aarch64)
> (kms_getfb:20359) INFO: Using IGT_SRANDOM=1771906178 for randomisation
> (kms_getfb:20359) INFO: Opened device: /dev/dri/card0
> (kms_getfb:20359) DEBUG: Test requirement passed: !(fd<0)
> (kms_getfb:20359) DEBUG: Test requirement passed: has_getfb_iface(fd)
> (kms_getfb:20359) DEBUG: display: init {
> (kms_getfb:20359) DEBUG: Test requirement passed:
> igt_has_drm_cap(drm_fd, DRM_CAP_VBLANK_HIGH_CRTC)
> (kms_getfb:20359) DEBUG: Test requirement passed:
> resources->count_crtcs <= IGT_MAX_PIPES
> (kms_getfb:20359) DEBUG: display:     DSI-1: Selecting pipe None
> (kms_getfb:20359) DEBUG: display:     DSI-2: Selecting pipe None
> (kms_getfb:20359) DEBUG: display:     DP-1: Selecting pipe None
> (kms_getfb:20359) DEBUG: display:     DP-1: Selecting pipe None
> (kms_getfb:20359) DEBUG: Test requirement passed: !(pipe >=
> igt_display_n_crtcs(display) || !igt_crtc_for_pipe(display,
> pipe)->valid)
> (kms_getfb:20359) DEBUG: Test requirement passed: !(pipe >=
> igt_display_n_crtcs(display) || !igt_crtc_for_pipe(display,
> pipe)->valid)
> (kms_getfb:20359) DEBUG: igt_create_fb_with_bo_size(width=2152,
> height=2076, format=XR24(0x34325258), modifier=0x0, size=0)
> (kms_getfb:20359) DEBUG: igt_create_fb_with_bo_size(handle=1, pitch=8640)
> (kms_getfb:20359) DEBUG: Test requirement passed: igt_has_fb_modifiers(fd)
> (kms_getfb:20359) DEBUG: Test requirement passed:
> cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS
> (kms_getfb:20359) DEBUG: Test requirement passed: !(pipe >=
> igt_display_n_crtcs(display) || !igt_crtc_for_pipe(display,
> pipe)->valid)
> (kms_getfb:20359) DEBUG: Test requirement passed: !(pipe >=
> igt_display_n_crtcs(display) || !igt_crtc_for_pipe(display,
> pipe)->valid)
> (kms_getfb:20359) DEBUG: igt_create_fb_with_bo_size(width=1080,
> height=2364, format=XR24(0x34325258), modifier=0x0, size=0)
> (kms_getfb:20359) DEBUG: igt_create_fb_with_bo_size(handle=1, pitch=4352)
> (kms_getfb:20359) DEBUG: Test requirement passed: igt_has_fb_modifiers(fd)
> (kms_getfb:20359) DEBUG: Test requirement passed:
> cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS
> (kms_getfb:20359) CRITICAL: Test assertion failure function
> igt_display_reset_outputs, file
> external/igt-gpu-tools/lib/igt_kms.c:2985:
> (kms_getfb:20359) CRITICAL: Failed assertion: old_primary->index != 0
> (kms_getfb:20359) CRITICAL: error: 0 == 0
> (kms_getfb:20359) INFO: Stack trace: not implemented

This change LGTM, thanks for the fix.  Looks to be a miss in the 
previous update. Please add fixes tag.

Fixes: ac37e1174cc4 ("lib/kms: Pimp the primary plane swapping")

With this,

Reviewed-by: Karthik B S <karthik.b.s@intel.com>

>
> Regards,
> Jing-Ping Jan

  reply	other threads:[~2026-04-21  6:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  7:49 [PATCH i-g-t] tests/kms: correct index validation logic Jing-Ping Jan
2026-04-20 18:16 ` Kamil Konieczny
2026-04-21  2:07   ` Jing-Ping Jan
2026-04-21  6:13     ` Karthik B S [this message]
2026-04-21  6:43       ` [PATCH i-g-t v2] " Jing-Ping Jan
2026-04-21  9:28         ` Karthik B S
2026-04-21 12:02         ` Jani Nikula
2026-04-22 17:05           ` Kamil Konieczny
2026-04-22 17:23             ` Ville Syrjälä
2026-04-23  9:21               ` Jing-Ping Jan
2026-04-23  9:28                 ` [PATCH i-g-t v3] " Jing-Ping Jan
2026-04-23 10:27                 ` [PATCH i-g-t v2] " Kamil Konieczny
2026-04-23 10:40                 ` Ville Syrjälä
2026-04-21 21:28 ` ✓ i915.CI.BAT: success for tests/kms: correct index validation logic (rev2) Patchwork
2026-04-21 22:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-22  2:36 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-22  5:16 ` ✓ 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=b4757a01-6cff-4c92-b7ba-5a6578c7c06a@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jingpingjan@google.com \
    --cc=juha-pekka.heikkila@intel.com \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=swati2.sharma@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