Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jonathan.cavitt@intel.com, alex.zuo@intel.com,
	daniele.ceraolospurio@intel.com, ville.syrjala@linux.intel.com
Subject: [PATCH i-g-t] tests/intel/xe_pxp: Require output for display tests
Date: Tue, 21 Jul 2026 06:46:35 +0800	[thread overview]
Message-ID: <20260720224635.1963815-1-jonathan.cavitt@intel.com> (raw)

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


             reply	other threads:[~2026-07-20 22:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 22:46 Jonathan Cavitt [this message]
2026-07-20 22:50 ` [PATCH i-g-t] tests/intel/xe_pxp: Require output for display tests Cavitt, Jonathan

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=20260720224635.1963815-1-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --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