Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_pxp: Require output for display tests
@ 2026-07-20 22:46 Jonathan Cavitt
  2026-07-20 22:50 ` Cavitt, Jonathan
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cavitt @ 2026-07-20 22:46 UTC (permalink / raw)
  To: igt-dev; +Cc: jonathan.cavitt, alex.zuo, daniele.ceraolospurio, ville.syrjala

The subtests display-pxp-fb and display-black-pxp-fb both call the
function igt_create_color_fb with a width and height value generated by
getting outputs from for_each_connected_output and selecting the maximum
width and height among all available connected outputs.  If there are no
such outputs, then the resulting values will be zero, which is an invalid
input for the DRM_XE_CREATE_DUMB ioctl.

Skip these tests if there are no connected outputs.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/intel/xe_pxp.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/intel/xe_pxp.c b/tests/intel/xe_pxp.c
index 9320078733..080dc9519e 100644
--- a/tests/intel/xe_pxp.c
+++ b/tests/intel/xe_pxp.c
@@ -868,6 +868,18 @@ static void compare_crcs(int fd, igt_display_t *display, igt_fb_t *ref_fb, igt_f
 	}
 }
 
+static void require_connected_output(igt_display_t *display)
+{
+	igt_output_t *output;
+	bool connected_output = false;
+
+	for_each_connected_output(display, output) {
+		connected_output = true;
+		break;
+	}
+	igt_require_f(connected_output, "Display has no connected outputs\n");
+}
+
 /**
  * SUBTEST: display-pxp-fb
  * Description: Test that an encrypted fb is displayed correctly by comparing
@@ -1165,12 +1177,14 @@ int igt_main()
 		igt_subtest("display-pxp-fb") {
 			require_display(xe_fd, &display);
 			require_pxp_render(xe_fd, pxp_supported);
+			require_connected_output(&display);
 			test_display_pxp_fb(xe_fd, &display);
 		}
 
 		igt_subtest("display-black-pxp-fb") {
 			require_display(xe_fd, &display);
 			require_pxp_render(xe_fd, pxp_supported);
+			require_connected_output(&display);
 			test_display_black_pxp_fb(xe_fd, &display);
 		}
 	}
-- 
2.53.0


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

end of thread, other threads:[~2026-07-20 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 22:46 [PATCH i-g-t] tests/intel/xe_pxp: Require output for display tests Jonathan Cavitt
2026-07-20 22:50 ` Cavitt, Jonathan

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