[Intel-gfx] [PATCH i-g-t 2/2] kms_pipe_crc_basic: Skip sequence tests if the source doesn't provide frame numbers

Tomeu Vizoso tomeu.vizoso at collabora.com
Thu Mar 2 10:08:26 UTC 2017


Some frame sources such as sinks aren't able to provide meaningful frame
numbers, so in those cases just skip the TEST_SEQUENCE tests.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---
 tests/kms_pipe_crc_basic.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index dd2ad3c366bc..6c65cfe6e9d3 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -89,7 +89,7 @@ static void test_bad_source(data_t *data)
 #define TEST_SEQUENCE (1<<0)
 #define TEST_NONBLOCK (1<<1)
 
-static void
+static bool
 test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
 			 unsigned flags)
 {
@@ -163,9 +163,24 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
 		for (j = 0; j < (n_crcs - 1); j++)
 			igt_assert_crc_equal(&crcs[j], &crcs[j + 1]);
 
-		if (flags & TEST_SEQUENCE)
-			for (j = 0; j < (n_crcs - 1); j++)
-				igt_assert_eq(crcs[j].frame + 1, crcs[j + 1].frame);
+		if (flags & TEST_SEQUENCE) {
+			if (!crcs[0].has_valid_frame) {
+				igt_info("Skipping connector, its 'auto' source doesn't give us frame numbers.\n");
+
+				free(crcs);
+				igt_pipe_crc_free(pipe_crc);
+				igt_remove_fb(data->drm_fd, &data->fb);
+				igt_plane_set_fb(primary, NULL);
+
+				igt_output_set_pipe(output, PIPE_ANY);
+
+				return false;
+			} else {
+				for (j = 0; j < (n_crcs - 1); j++)
+					igt_assert_eq(crcs[j].frame + 1,
+				crcs[j + 1].frame);
+			}
+		}
 
 		free(crcs);
 		igt_pipe_crc_free(pipe_crc);
@@ -174,6 +189,8 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
 
 		igt_output_set_pipe(output, PIPE_ANY);
 	}
+
+	return true;
 }
 
 static void test_read_crc(data_t *data, int pipe, unsigned flags)
@@ -190,8 +207,8 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags)
 			 igt_subtest_name(), igt_output_name(output),
 			 kmstest_pipe_name(pipe));
 
-		test_read_crc_for_output(data, pipe, output, flags);
-		valid_connectors ++;
+		if (test_read_crc_for_output(data, pipe, output, flags))
+			valid_connectors ++;
 	}
 
 	igt_require_f(valid_connectors, "No connector found for pipe %i\n", pipe);
-- 
2.9.3



More information about the Intel-gfx mailing list