Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 v4] lib/igt_kms: Fix plane type check in igt_crtc_get_plane_type
Date: Wed, 15 Jul 2026 17:24:13 +0800	[thread overview]
Message-ID: <20260715092413.1355785-2-jingpingjan@google.com> (raw)
In-Reply-To: <20260715091541.1010895-2-jingpingjan@google.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>
---
v4:
 - Remove unintended changes
v3:
 - Moving condition after old one
 - print type string instead of enum value
v2:
 - Cc Swati and Karthik.
 - split condition with additional branch

 lib/igt_kms.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e20307923..65bb556bf 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3538,6 +3538,13 @@ igt_plane_t *igt_crtc_get_plane_type(igt_crtc_t *crtc, int plane_type)
 		      "Valid pipe->planes idx not found. plane_idx=%d plane_type=%d n_planes=%d\n",
 		      plane_idx, plane_type, crtc->n_planes);
 
+	igt_require_f(crtc->planes[plane_idx].type == plane_type,
+		      "Valid pipe->planes idx not found. found plane_idx=%d, "
+		      "type=%s, requested plane_type=%s\n", plane_idx,
+		      crtc->planes[plane_idx].type == DRM_PLANE_TYPE_PRIMARY ? "PRIMARY"
+									     : "CURSOR",
+		      plane_type == DRM_PLANE_TYPE_PRIMARY ? "PRIMARY" : "CURSOR");
+
 	return &crtc->planes[plane_idx];
 }
 
-- 
2.55.0.141.g00534a21ce-goog


  reply	other threads:[~2026-07-15  9:24 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   ` [PATCH i-g-t v2] Subject: " Jing-Ping Jan
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         ` Jing-Ping Jan [this message]
2026-07-15 12:57           ` [PATCH i-g-t v4] " 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=20260715092413.1355785-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