[igt-dev] [PATCH i-g-t 1/2] tests/kms_ccs: Skip with a more meaningful message

Arkadiusz Hiler arkadiusz.hiler at intel.com
Thu Jul 4 13:30:40 UTC 2019


If CCS is not supported, i.e. we have executed no test for it, let's
skip with a message saying so instead of mysterious requirement on
test_output().

A lot of people get confused by current output thinking that there is
something wrong with output/modes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110580
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
 tests/kms_ccs.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 2f08a837..5a1f940e 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -297,7 +297,7 @@ static int test_ccs(data_t *data)
 	return valid_tests;
 }
 
-static int test_output(data_t *data)
+static int __test_output(data_t *data)
 {
 	igt_display_t *display = &data->display;
 	int i, valid_tests = 0;
@@ -322,6 +322,12 @@ static int test_output(data_t *data)
 	return valid_tests;
 }
 
+static void test_output(data_t *data)
+{
+	int valid_tests = __test_output(data);
+	igt_require_f(valid_tests > 0, "CCS not supported, skipping");
+}
+
 static data_t data;
 
 igt_main
@@ -345,19 +351,18 @@ igt_main
 
 		data.flags = TEST_BAD_PIXEL_FORMAT;
 		igt_subtest_f("pipe-%s-bad-pixel-format", pipe_name)
-			igt_require(test_output(&data));
 
 		data.flags = TEST_BAD_ROTATION_90;
 		igt_subtest_f("pipe-%s-bad-rotation-90", pipe_name)
-			igt_require(test_output(&data));
+			test_output(&data);
 
 		data.flags = TEST_CRC;
 		igt_subtest_f("pipe-%s-crc-primary-basic", pipe_name)
-			igt_require(test_output(&data));
+			test_output(&data);
 
 		data.flags = TEST_CRC | TEST_ROTATE_180;
 		igt_subtest_f("pipe-%s-crc-primary-rotation-180", pipe_name)
-			igt_require(test_output(&data));
+			test_output(&data);
 
 		data.flags = TEST_CRC;
 		igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) {
@@ -368,25 +373,25 @@ igt_main
 			for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
 				if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
 					continue;
-				valid_tests += test_output(&data);
+				valid_tests += __test_output(&data);
 			}
 
-			igt_require(valid_tests);
+			igt_require_f(valid_tests > 0, "CCS not supported, skipping");
 		}
 
 		data.plane = NULL;
 
 		data.flags = TEST_NO_AUX_BUFFER;
 		igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name)
-			igt_require(test_output(&data));
+			test_output(&data);
 
 		data.flags = TEST_BAD_CCS_HANDLE;
 		igt_subtest_f("pipe-%s-ccs-on-another-bo", pipe_name)
-			igt_require(test_output(&data));
+			test_output(&data);
 
 		data.flags = TEST_BAD_AUX_STRIDE;
 		igt_subtest_f("pipe-%s-bad-aux-stride", pipe_name)
-			igt_require(test_output(&data));
+			test_output(&data);
 	}
 
 	igt_fixture
-- 
2.21.0



More information about the igt-dev mailing list