[igt-dev] [PATCH i-g-t 3/3] tests/kms_cursor_crc: Test maximum cursor size

Ville Syrjala ville.syrjala at linux.intel.com
Wed Mar 24 18:17:35 UTC 2021


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Run the standard set of tests using the max cursor size
if the other tests didn't already cover it.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/kms_cursor_crc.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 5f3eeaa0c5ac..525e6952f1a5 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -666,32 +666,49 @@ static void test_rapid_movement(data_t *data)
 static void run_size_tests(data_t *data, enum pipe pipe,
 			   int w, int h)
 {
+	char name[16];
+
+	if (w == 0 && h == 0)
+		strcpy(name, "max-size");
+	else
+		snprintf(name, sizeof(name), "%dx%d", w, h);
+
 	igt_fixture {
+		if (w == 0 && h == 0) {
+			w = data->cursor_max_w;
+			h = data->cursor_max_h;
+			/*
+			 * No point in doing the "max-size" test if
+			 * it was already covered by the other tests.
+			 */
+			igt_require(w != h || w > 512 || h > 512 ||
+				    !is_power_of_two(w) || !is_power_of_two(h));
+		}
 		create_cursor_fb(data, w, h);
 		require_cursor_size(data, w, h);
 	}
 
 	/* Using created cursor FBs to test cursor support */
 	igt_describe("Check if a given-size cursor is well-positioned inside the screen.");
-	igt_subtest_f("pipe-%s-cursor%dx%donscreen", kmstest_pipe_name(pipe), w, h)
+	igt_subtest_f("pipe-%s-cursor-%s-onscreen", kmstest_pipe_name(pipe), name)
 		run_test(data, test_crc_onscreen, w, h);
 
 	igt_describe("Check if a given-size cursor is well-positioned outside the "
 		     "screen.");
-	igt_subtest_f("pipe-%s-cursor%dx%doffscreen", kmstest_pipe_name(pipe), w, h)
+	igt_subtest_f("pipe-%s-cursor-%s-offscreen", kmstest_pipe_name(pipe), name)
 		run_test(data, test_crc_offscreen, w, h);
 
 	igt_describe("Check the smooth and pixel-by-pixel given-size cursor "
 		     "movements on horizontal, vertical and diagonal.");
-	igt_subtest_f("pipe-%s-cursor%dx%dsliding", kmstest_pipe_name(pipe), w, h)
+	igt_subtest_f("pipe-%s-cursor-%s-sliding", kmstest_pipe_name(pipe), name)
 		run_test(data, test_crc_sliding, w, h);
 
 	igt_describe("Check random placement of a cursor with given size.");
-	igt_subtest_f("pipe-%s-cursor%dx%drandom", kmstest_pipe_name(pipe), w, h)
+	igt_subtest_f("pipe-%s-cursor-%s-random", kmstest_pipe_name(pipe), name)
 		run_test(data, test_crc_random, w, h);
 
 	igt_describe("Check the rapid update of given-size cursor movements.");
-	igt_subtest_f("pipe-%s-cursor%dx%drapid-movement", kmstest_pipe_name(pipe), w, h)
+	igt_subtest_f("pipe-%s-cursor-%s-rapid-movement", kmstest_pipe_name(pipe), name)
 		run_test(data, test_rapid_movement, w, h);
 
 	igt_fixture
@@ -760,6 +777,8 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)
 		igt_subtest_group
 			run_size_tests(data, pipe, w, h);
 	}
+
+	run_size_tests(data, pipe, 0, 0);
 }
 
 static data_t data;
-- 
2.26.2



More information about the igt-dev mailing list