Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_kms: Fix plane type check in igt_crtc_get_plane_type
@ 2026-07-06 10:06 Jing-Ping Jan
  2026-07-07  4:41 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Jing-Ping Jan @ 2026-07-06 10:06 UTC (permalink / raw)
  To: Development mailing list for IGT GPU Tools
  Cc: Jing-Ping, Chris Wilson, Ville Syrjälä

From: Jing-Ping <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>
Signed-off-by: Jing-Ping <jingpingjan@google.com>
---
 lib/igt_kms.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e20307923..43da9a6d9 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3534,11 +3534,14 @@ 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,
-		      "Valid pipe->planes idx not found. plane_idx=%d plane_type=%d n_planes=%d\n",
-		      plane_idx, plane_type, crtc->n_planes);
-
-	return &crtc->planes[plane_idx];
+        igt_require_f(plane_idx >= 0 && plane_idx < crtc->n_planes &&
+                          crtc->planes[plane_idx].type == plane_type,
+                      "Valid pipe->planes idx not found. plane_idx=%d "
+                      "plane_type=%d n_planes=%d found plane_type=%d\n",
+                      plane_idx, plane_type, crtc->n_planes,
+                      crtc->planes[plane_idx].type);
+
+        return &crtc->planes[plane_idx];
 }
 
 /**
-- 
2.55.0.rc0.799.gd6f94ed593-goog


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-07-15 12:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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         ` [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox