[igt-dev] [i-g-t V3 34/52] tests/kms_universal_plane: Add support for Bigjoiner

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Sep 9 14:03:13 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.

V2: - Use updated helper name

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

diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 3cb6d704..92749df8 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -366,6 +366,9 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	igt_require_pipe(&data->display, pipe);
 
+	igt_info("Using (pipe %s + %s) to run the subtest.\n",
+		 kmstest_pipe_name(pipe), igt_output_name(output));
+
 	igt_output_set_pipe(output, pipe);
 	mode = igt_output_get_mode(output);
 
@@ -479,6 +482,9 @@ pageflip_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	igt_require_pipe(&data->display, pipe);
 
+	igt_info("Using (pipe %s + %s) to run the subtest.\n",
+		 kmstest_pipe_name(pipe), igt_output_name(output));
+
 	igt_output_set_pipe(output, pipe);
 
 	pageflip_test_init(&test, output, pipe);
@@ -582,6 +588,9 @@ cursor_leak_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 	igt_require(display->has_cursor_plane);
 	igt_require_intel(data->drm_fd);
 
+	igt_info("Using (pipe %s + %s) to run the subtest.\n",
+		 kmstest_pipe_name(pipe), igt_output_name(output));
+
 	igt_output_set_pipe(output, pipe);
 	mode = igt_output_get_mode(output);
 
@@ -710,6 +719,9 @@ gen9_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 	igt_skip_on(data->display_ver < 9);
 	igt_require_pipe(&data->display, pipe);
 
+	igt_info("Using (pipe %s + %s) to run the subtest.\n",
+		 kmstest_pipe_name(pipe), igt_output_name(output));
+
 	igt_output_set_pipe(output, pipe);
 
 	gen9_test_init(&test, output, pipe);
@@ -745,6 +757,22 @@ gen9_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 	gen9_test_fini(&test, output);
 }
 
+static bool
+pipe_output_combo_valid(igt_display_t *display,
+			enum pipe pipe, igt_output_t *output)
+{
+	bool ret = true;
+
+	igt_display_reset(display);
+
+	igt_output_set_pipe(output, pipe);
+	if (!i915_pipe_output_combo_valid(display))
+		ret = false;
+	igt_output_set_pipe(output, PIPE_NONE);
+
+	return ret;
+}
+
 static void
 run_tests_for_pipe(data_t *data, enum pipe pipe)
 {
@@ -763,34 +791,79 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
 
 	igt_describe("Check the switching between different primary plane fbs with CRTC off");
 	igt_subtest_f("universal-plane-pipe-%s-functional",
-		      kmstest_pipe_name(pipe))
-		for_each_valid_output_on_pipe(&data->display, pipe, output)
+		      kmstest_pipe_name(pipe)) {
+		bool found = false;
+
+		for_each_valid_output_on_pipe(&data->display, pipe, output) {
+			if (!pipe_output_combo_valid(&data->display, pipe, output))
+				continue;
+
+			found = true;
 			functional_test_pipe(data, pipe, output);
+		}
+		igt_require_f(found, "No valid pipe/output combo found.\n");
+	}
 
 	igt_describe("Test for scale-up or scale-down using universal plane API without covering CRTC");
 	igt_subtest_f("universal-plane-pipe-%s-sanity",
-		      kmstest_pipe_name(pipe))
-		for_each_valid_output_on_pipe(&data->display, pipe, output)
+		      kmstest_pipe_name(pipe)) {
+		bool found = false;
+
+		for_each_valid_output_on_pipe(&data->display, pipe, output) {
+			if (!pipe_output_combo_valid(&data->display, pipe, output))
+				continue;
+
+			found = true;
 			sanity_test_pipe(data, pipe, output);
+		}
+		igt_require_f(found, "No valid pipe/output combo found.\n");
+	}
 
 	igt_describe("Check pageflips while primary plane is disabled before IOCTL or between IOCTL"
 			" and pageflip execution");
 	igt_subtest_f("disable-primary-vs-flip-pipe-%s",
-		      kmstest_pipe_name(pipe))
-		for_each_valid_output_on_pipe(&data->display, pipe, output)
+		      kmstest_pipe_name(pipe)) {
+		bool found = false;
+
+		for_each_valid_output_on_pipe(&data->display, pipe, output) {
+			if (!pipe_output_combo_valid(&data->display, pipe, output))
+				continue;
+
+			found = true;
 			pageflip_test_pipe(data, pipe, output);
+		}
+		igt_require_f(found, "No valid pipe/output combo found.\n");
+	}
 
 	igt_describe("Check for cursor leaks after performing cursor operations");
 	igt_subtest_f("cursor-fb-leak-pipe-%s",
-		      kmstest_pipe_name(pipe))
-		for_each_valid_output_on_pipe(&data->display, pipe, output)
+		      kmstest_pipe_name(pipe)) {
+		bool found = false;
+
+		for_each_valid_output_on_pipe(&data->display, pipe, output) {
+			if (!pipe_output_combo_valid(&data->display, pipe, output))
+				continue;
+
+			found = true;
 			cursor_leak_test_pipe(data, pipe, output);
+		}
+		igt_require_f(found, "No valid pipe/output combo found.\n");
+	}
 
 	igt_describe("Check if pageflip succeeds in windowed setting");
 	igt_subtest_f("universal-plane-gen9-features-pipe-%s",
-		      kmstest_pipe_name(pipe))
-		for_each_valid_output_on_pipe(&data->display, pipe, output)
+		      kmstest_pipe_name(pipe)) {
+		bool found = false;
+
+		for_each_valid_output_on_pipe(&data->display, pipe, output) {
+			if (!pipe_output_combo_valid(&data->display, pipe, output))
+				continue;
+
+			found = true;
 			gen9_test_pipe(data, pipe, output);
+		}
+		igt_require_f(found, "No valid pipe/output combo found.\n");
+	}
 }
 
 static data_t data;
@@ -808,6 +881,7 @@ igt_main
 
 		igt_require_pipe_crc(data.drm_fd);
 		igt_display_require(&data.display, data.drm_fd);
+		igt_display_require_output(&data.display);
 	}
 
 	for_each_pipe_static(pipe) {
-- 
2.35.1



More information about the igt-dev mailing list