public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Kamil Konieczny" <kamil.konieczny@linux.intel.com>,
	"Jani Nikula" <jani.nikula@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Jing-Ping Jan" <jingpingjan@google.com>
Subject: [PATCH i-g-t 2/3] lib/igt_kms: Fix assert in igt_display_reset_outputs()
Date: Fri, 24 Apr 2026 17:13:54 +0200	[thread overview]
Message-ID: <20260424151355.129423-3-kamil.konieczny@linux.intel.com> (raw)
In-Reply-To: <20260424151355.129423-1-kamil.konieczny@linux.intel.com>

There is an error manifesting by assert, when primary plane was
not a first one:

sudo ./kms_getfb
INFO: IGT-Version: IGT_VERSION-GIT (arm64) (Linux:
	6.6.118-android15-8-g34da635f9b82-ab14801981-4k aarch64)
...
CRITICAL: Test assertion failure function igt_display_reset_outputs,
	file external/igt-gpu-tools/lib/igt_kms.c:2985:
CRITICAL: Failed assertion: old_primary->index != 0
CRITICAL: error: 0 == 0

It turns out that after swapping data and index, it should also
swap pointers itself so asserts will be correct checks.

Cc: Jani Nikula <jani.nikula@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reported-by: Jing-Ping Jan <jingpingjan@google.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 lib/igt_kms.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 2d758b63c..33092fc85 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2980,6 +2980,7 @@ void igt_display_reset_outputs(igt_display_t *display)
 
 				igt_swap(*old_primary, *new_primary);
 				igt_swap(old_primary->index, new_primary->index);
+				igt_swap(old_primary, new_primary);
 
 				igt_assert_neq(old_primary->index, 0);
 				igt_assert_eq(new_primary->index, 0);
-- 
2.54.0


  parent reply	other threads:[~2026-04-24 15:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 15:13 [PATCH i-g-t 0/3] Few fixes for igt_display_reset_outputs() in lib/igt_kms Kamil Konieczny
2026-04-24 15:13 ` [PATCH i-g-t 1/3] Revert "tests/kms: correct index validation logic" Kamil Konieczny
2026-04-24 15:13 ` Kamil Konieczny [this message]
2026-04-27 15:30   ` [PATCH i-g-t 2/3] lib/igt_kms: Fix assert in igt_display_reset_outputs() Kamil Konieczny
2026-04-24 15:13 ` [PATCH i-g-t 3/3] lib/igt_kms: Fix cleanup " Kamil Konieczny
2026-04-24 16:13 ` ✓ Xe.CI.BAT: success for Few fixes for igt_display_reset_outputs() in lib/igt_kms Patchwork
2026-04-24 16:30 ` ✓ i915.CI.BAT: " Patchwork
2026-04-24 17:57 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-27 14:44   ` Kamil Konieczny
2026-04-24 21:58 ` ✗ i915.CI.Full: " Patchwork
2026-04-27 14:45   ` Kamil Konieczny
2026-04-27 12:24 ` [PATCH i-g-t 0/3] " 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=20260424151355.129423-3-kamil.konieczny@linux.intel.com \
    --to=kamil.konieczny@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jingpingjan@google.com \
    --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