[igt-dev] [i-g-t 12/51] tests/kms_cursor_crc: Add support for Bigjoiner

Bhanuprakash Modem bhanuprakash.modem at intel.com
Sun Aug 14 18:08:29 UTC 2022


This patch will add a check to Skip the subtest if a selected pipe/output
combo won't support Bigjoiner or 8K mode.

Example:
* Pipe-D wont support a mode > 5K
* To use 8K mode on a pipe then consecutive pipe must be available & free.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_cursor_crc.c | 49 +++++++++++++++++++++++++++++++++---------
 1 file changed, 39 insertions(+), 10 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 14d4c4ca..65004a84 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -687,6 +687,21 @@ static void test_rapid_movement(data_t *data)
 	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
 }
 
+static bool is_valid_combo(data_t *data, enum pipe pipe)
+{
+	bool ret = true;
+	igt_display_t *display = &data->display;
+
+	igt_display_reset(display);
+
+	igt_output_set_pipe(data->output, pipe);
+	if (!igt_test_constraint(display))
+		ret = false;
+	igt_output_set_pipe(data->output, PIPE_NONE);
+
+	return ret;
+}
+
 static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
 			   int w, int h)
 {
@@ -695,22 +710,21 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
 
 	snprintf(name, sizeof(name), "%dx%d", w, h);
 
-	create_cursor_fb(data, w, h);
-	if (require_cursor_size(data, w, h)) {
-		igt_debug("Cursor size %dx%d not supported by driver\n", w, h);
-
-		igt_remove_fb(data->drm_fd, &data->fb);
-		return;
-	}
-
 	for_each_pipe(&data->display, pipe) {
 		data->pipe = pipe;
+
+		if (!is_valid_combo(data, pipe))
+			continue;
+
+		if (require_cursor_size(data, w, h)) {
+			igt_debug("Cursor size %dx%d not supported by driver\n", w, h);
+			continue;
+		}
+
 		igt_dynamic_f("pipe-%s-%s-%s",
 			      kmstest_pipe_name(pipe), data->output->name, name)
 			run_test(data, testfunc, w, h);
 	}
-
-	igt_remove_fb(data->drm_fd, &data->fb);
 }
 
 static void run_tests_on_pipe(data_t *data)
@@ -749,6 +763,9 @@ static void run_tests_on_pipe(data_t *data)
 		for_each_pipe(&data->display, pipe) {
 			data->pipe = pipe;
 
+			if (!is_valid_combo(data, pipe))
+				continue;
+
 			igt_dynamic_f("pipe-%s-%s",
 				      kmstest_pipe_name(pipe),
 				      data->output->name)
@@ -763,6 +780,9 @@ static void run_tests_on_pipe(data_t *data)
 		for_each_pipe(&data->display, pipe) {
 			data->pipe = pipe;
 
+			if (!is_valid_combo(data, pipe))
+				continue;
+
 			igt_dynamic_f("pipe-%s-%s",
 				      kmstest_pipe_name(pipe),
 				      data->output->name)
@@ -777,6 +797,9 @@ static void run_tests_on_pipe(data_t *data)
 		for_each_pipe(&data->display, pipe) {
 			data->pipe = pipe;
 
+			if (!is_valid_combo(data, pipe))
+				continue;
+
 			igt_dynamic_f("pipe-%s-%s",
 				      kmstest_pipe_name(pipe),
 				      data->output->name)
@@ -795,6 +818,9 @@ static void run_tests_on_pipe(data_t *data)
 			data->pipe = pipe;
 			data->flags = TEST_DPMS;
 
+			if (!is_valid_combo(data, pipe))
+				continue;
+
 			if (require_cursor_size(data, data->cursor_max_w, data->cursor_max_h)) {
 				igt_debug("Cursor size %dx%d not supported by driver\n",
 					  data->cursor_max_w, data->cursor_max_h);
@@ -816,6 +842,9 @@ static void run_tests_on_pipe(data_t *data)
 			data->pipe = pipe;
 			data->flags = TEST_SUSPEND;
 
+			if (!is_valid_combo(data, pipe))
+				continue;
+
 			if (require_cursor_size(data, data->cursor_max_w, data->cursor_max_h)) {
 				igt_debug("Cursor size %dx%d not supported by driver\n",
 					  data->cursor_max_w, data->cursor_max_h);
-- 
2.35.1



More information about the igt-dev mailing list