public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] kms_chamelium: Fix test failures from missing outputs/unsupported formats.
Date: Thu, 17 Jan 2019 16:50:16 +0100	[thread overview]
Message-ID: <20190117155016.19855-1-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20190117145130.32549-1-maarten.lankhorst@linux.intel.com>

Newer platforms don't support this format, but the tests don't check
if the format is supported on the primary plane.

After enabling an output we also don't refresh the output connection,
calling igt_output_set_pipe(output, PIPE_NONE) will do so, and prevent
skips because no connected output is detected.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_chamelium.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 2d848c2f0620..f5e25a583a2f 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -436,6 +436,9 @@ prepare_output(data_t *data,
 
 	output = igt_output_from_connector(display, connector);
 
+	/* Refresh pipe to update connected status */
+	igt_output_set_pipe(output, PIPE_NONE);
+
 	for_each_pipe(display, pipe) {
 		if (!igt_pipe_connector_valid(pipe, output))
 			continue;
@@ -576,6 +579,20 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
 	igt_remove_fb(data->drm_fd, &fb);
 }
 
+static bool plane_supports_format(igt_plane_t *plane, uint32_t format)
+{
+	int i;
+
+	if (!igt_fb_supported_format(format))
+		return false;
+
+	for (i = 0; i < plane->drm_plane->count_formats; i++)
+		if (plane->drm_plane->formats[i] == format)
+			return true;
+
+	return false;
+}
+
 static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
 				      uint32_t fourcc, int count)
 {
@@ -590,6 +607,8 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_assert(primary);
 
+	igt_require(plane_supports_format(primary, fourcc));
+
 	do_test_display_crc(data, port, output, &connector->modes[0], fourcc, count);
 
 	drmModeFreeConnector(connector);
@@ -610,6 +629,8 @@ static void test_display_crc_all_modes(data_t *data, struct chamelium_port *port
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_assert(primary);
 
+	igt_require(plane_supports_format(primary, fourcc));
+
 	for (i = 0; i < connector->count_modes; i++) {
 		drmModeModeInfo *mode = &connector->modes[i];
 
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-01-17 15:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 14:51 [igt-dev] [PATCH i-g-t] kms_chamelium: Fix test failures from missing outputs/unsupported formats Maarten Lankhorst
2019-01-17 15:40 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2019-01-17 15:50 ` Maarten Lankhorst [this message]
2019-01-17 16:18 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_chamelium: Fix test failures from missing outputs/unsupported formats. (rev2) Patchwork
2019-01-17 23:42 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20190117155016.19855-1-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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