From: Jing-Ping Jan <jingpingjan@google.com>
To: Development mailing list for IGT GPU Tools
<igt-dev@lists.freedesktop.org>
Cc: "Jing-Ping Jan" <jingpingjan@google.com>,
"Chris Wilson" <chris@chris-wilson.co.uk>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Swati Sharma" <swati2.sharma@intel.com>,
"Karthik B S" <karthik.b.s@intel.com>
Subject: [PATCH i-g-t v2] Subject: [PATCH i-g-t] lib/igt_kms: Fix plane type check in igt_crtc_get_plane_type
Date: Wed, 8 Jul 2026 23:00:55 +0800 [thread overview]
Message-ID: <20260708150054.2146786-2-jingpingjan@google.com> (raw)
In-Reply-To: <20260707102711.qjparlbi7zedneon@kamilkon-DESK.igk.intel.com>
Verify plane type matches requested type to avoid returning invalid
planes.
Fixes: 5426dc0a889a ("lib/kms: Skip rather than fail when a suitable plane can't be found")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Swati Sharma <swati2.sharma@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Jing-Ping Jan <jingpingjan@google.com>
---
v2:
- Cc Swati and Karthik.
- split condition with additional branch
lib/igt_kms.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e20307923..ba8223dd2 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3534,7 +3534,13 @@ igt_plane_t *igt_crtc_get_plane_type(igt_crtc_t *crtc, int plane_type)
}
}
- igt_require_f(plane_idx >= 0 && plane_idx < crtc->n_planes,
+ if (plane_idx >= 0 && plane_idx < crtc->n_planes)
+ igt_require_f(crtc->planes[plane_idx].type == plane_type,
+ "Valid pipe->planes idx not found. found plane_idx=%d, "
+ "type=%d, requested plane_type=%d\n",
+ plane_idx, crtc->planes[plane_idx].type, plane_type);
+
+ igt_require_f(plane_idx >= 0 && plane_idx < crtc->n_planes,
"Valid pipe->planes idx not found. plane_idx=%d plane_type=%d n_planes=%d\n",
plane_idx, plane_type, crtc->n_planes);
--
2.55.0.795.g602f6c329a-goog
next prev parent reply other threads:[~2026-07-08 15:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 10:06 [PATCH i-g-t] lib/igt_kms: Fix plane type check in igt_crtc_get_plane_type Jing-Ping Jan
2026-07-07 4:41 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-07-07 4:55 ` ✓ i915.CI.BAT: " Patchwork
2026-07-07 7:17 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-07 10:27 ` [PATCH i-g-t] " Kamil Konieczny
2026-07-08 15:00 ` Jing-Ping Jan [this message]
2026-07-08 15:02 ` [PATCH i-g-t v2] " Jing-Ping Jan
2026-07-14 16:43 ` Kamil Konieczny
2026-07-15 9:15 ` [PATCH i-g-t v3] " Jing-Ping Jan
2026-07-15 9:24 ` [PATCH i-g-t v4] " Jing-Ping Jan
2026-07-15 12:57 ` Kamil Konieczny
2026-07-07 14:19 ` ✗ i915.CI.Full: failure for " Patchwork
2026-07-08 17:22 ` ✓ Xe.CI.BAT: success for lib/igt_kms: Fix plane type check in igt_crtc_get_plane_type (rev3) Patchwork
2026-07-08 17:47 ` ✓ i915.CI.BAT: " Patchwork
2026-07-08 20:29 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-09 16:01 ` ✗ i915.CI.Full: failure " Patchwork
2026-07-15 10:44 ` ✓ Xe.CI.BAT: success for lib/igt_kms: Fix plane type check in igt_crtc_get_plane_type (rev5) Patchwork
2026-07-15 10:57 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-15 11:13 ` ✓ i915.CI.BAT: " Patchwork
2026-07-15 11:57 ` ✓ i915.CI.Full: " 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=20260708150054.2146786-2-jingpingjan@google.com \
--to=jingpingjan@google.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--cc=karthik.b.s@intel.com \
--cc=swati2.sharma@intel.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