public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] kms_chamelium: Fix test failures from missing outputs/unsupported formats.
@ 2019-01-17 14:51 Maarten Lankhorst
  2019-01-17 15:40 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2019-01-17 14:51 UTC (permalink / raw)
  To: igt-dev

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..9f7dd50072e5 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -434,6 +434,9 @@ prepare_output(data_t *data,
 
 	igt_display_reset(display);
 
+	/* Refresh pipe to update connected status */
+	igt_output_set_pipe(output, PIPE_NONE);
+
 	output = igt_output_from_connector(display, connector);
 
 	for_each_pipe(display, pipe) {
@@ -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

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

end of thread, other threads:[~2019-01-17 23:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [igt-dev] [PATCH i-g-t] " Maarten Lankhorst
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

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