public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v1] tests/kms_async_flips: validate mode before proceeding with fb creation
@ 2026-02-25 11:05 Santhosh Reddy Guddati
  2026-02-25 22:21 ` ✗ Xe.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Santhosh Reddy Guddati @ 2026-02-25 11:05 UTC (permalink / raw)
  To: igt-dev; +Cc: karthik.b.s, swati2.sharma, Santhosh Reddy Guddati

Validate mode before proceeding with creating frame buffers to avoid
passing invalid parameters to the ioctl.

Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
---
 tests/kms_async_flips.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 014b7f347..d00b36544 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -298,6 +298,12 @@ static void test_init(data_t *data)
 	igt_display_commit(&data->display);
 
 	mode = igt_output_get_mode(data->output);
+	igt_require_f(kmstest_mode_is_valid(mode),
+		      "Invalid mode on %s (%dx%d@%d)",
+		      data->output->name,
+		      mode ? mode->hdisplay : 0,
+		      mode ? mode->vdisplay : 0,
+		      mode ? mode->vrefresh : 0);
 
 	data->crtc_id = data->crtc->crtc_id;
 	data->refresh_rate = mode->vrefresh;
@@ -327,6 +333,12 @@ static void test_init_fbs(data_t *data)
 	drmModeModeInfo *mode;
 
 	mode = igt_output_get_mode(data->output);
+	igt_require_f(kmstest_mode_is_valid(mode),
+		      "Invalid mode on %s (%dx%d@%d)",
+		      data->output->name,
+		      mode ? mode->hdisplay : 0,
+		      mode ? mode->vdisplay : 0,
+		      mode ? mode->vrefresh : 0);
 	width = mode->hdisplay;
 	height = mode->vdisplay;
 
@@ -672,6 +684,12 @@ static void test_invalid(data_t *data)
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
 	mode = igt_output_get_mode(data->output);
+	igt_require_f(kmstest_mode_is_valid(mode),
+		      "Invalid mode on %s (%dx%d@%d)",
+		      data->output->name,
+		      mode ? mode->hdisplay : 0,
+		      mode ? mode->vdisplay : 0,
+		      mode ? mode->vrefresh : 0);
 	width = mode->hdisplay;
 	height = mode->vdisplay;
 
-- 
2.34.1


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

end of thread, other threads:[~2026-02-26 11:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 11:05 [PATCH i-g-t v1] tests/kms_async_flips: validate mode before proceeding with fb creation Santhosh Reddy Guddati
2026-02-25 22:21 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-25 22:30 ` ✗ i915.CI.BAT: " Patchwork
2026-02-26  0:33 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-26  8:48 ` [PATCH i-g-t v1] " Ville Syrjälä
2026-02-26 11:19   ` Reddy Guddati, Santhosh

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