[igt-dev] [i-g-t] tests/kms_cursor_crc: Add max-size test back

Bhanuprakash Modem bhanuprakash.modem at intel.com
Tue Aug 9 16:58:32 UTC 2022


This patch reverts the max-size test but keeps the clean-up
part of the original commit.

This reverts commit 5a8fa05a824032aab4c8980727a075f71065e27c.

Cc: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_cursor_crc.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 14d4c4ca..cf8d4b68 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -693,7 +693,24 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
 	char name[32];
 	enum pipe pipe;
 
-	snprintf(name, sizeof(name), "%dx%d", w, h);
+	if (w == 0 && h == 0)
+		strcpy(name, "max-size");
+	else
+		snprintf(name, sizeof(name), "%dx%d", w, h);
+
+	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.
+		 */
+		if ((w == h) && (w <= 512) && (h <= 512) &&
+		    is_power_of_two(w) && is_power_of_two(h)) {
+			igt_debug("Cursor max size %dx%d already covered by other tests\n", w, h);
+			return;
+		}
+	}
 
 	create_cursor_fb(data, w, h);
 	if (require_cursor_size(data, w, h)) {
@@ -855,6 +872,9 @@ static void run_tests_on_pipe(data_t *data)
 					igt_subtest_group
 						run_size_tests(data, size_tests[i].testfunc, w, h);
 				}
+
+				igt_subtest_group
+					run_size_tests(data, size_tests[i].testfunc, 0, 0);
 			}
 		}
 	}
-- 
2.35.1



More information about the igt-dev mailing list