[igt-dev] [PATCH i-g-t] kms_chamelium: Fix test failures from missing outputs/unsupported formats.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Jan 17 15:50:16 UTC 2019
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 at 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
More information about the igt-dev
mailing list