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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

v2: Rebased

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
---
 tests/kms_pipe_crc_basic.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 49e856abbf4c..5a01fc6c2777 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)
 {
@@ -167,9 +167,23 @@ 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_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_remove_fb(data->drm_fd, &data->fb);
@@ -177,6 +191,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)
@@ -193,8 +209,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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux