[i-g-t v2 27/51] tests/kms_plane_scaling: Add support for Bigjoiner

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Aug 12 16:06:50 UTC 2022


As many 2x tests are currently running on Pipe-A & B only, those
tests will always SKIP with the above config (8K + ). Instead of
Skipping the test, we need to add some intelligence to identify
the valid combo to execute the test.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_plane_scaling.c | 224 +++++++++++++++++++++++++-------------
 1 file changed, 147 insertions(+), 77 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index fc8250b5..6cf196ab 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -546,30 +546,45 @@ static void test_scaler_with_pixel_format_pipe(data_t *d, int width, int height,
 	}
 }
 
-static void find_connected_pipe(igt_display_t *display, bool second, enum pipe *pipe, igt_output_t **output)
+static enum pipe
+find_connected_pipe(igt_display_t *display, bool second, igt_output_t **output)
 {
-	enum pipe first = PIPE_NONE;
-	igt_output_t *first_output = NULL;
+	enum pipe pipe;
+	bool first_output = false;
 	bool found = false;
 
-	for_each_pipe_with_valid_output(display, *pipe, *output) {
-		if (first == *pipe || *output == first_output)
-			continue;
+	igt_display_reset(display);
 
-		if (second) {
-			first = *pipe;
-			first_output = *output;
-			second = false;
-			continue;
-		}
+	for_each_pipe(display, pipe) {
+		for_each_valid_output_on_pipe(display, pipe, *output) {
+			if((*output)->pending_pipe != PIPE_NONE)
+				continue;
+
+			igt_output_set_pipe(*output, pipe);
+			if (igt_test_constraint(display)) {
+				found = true;
 
-		return;
+				if (second) {
+					first_output = true;
+					second = false;
+					found = false;
+				}
+				break;
+			}
+			igt_output_set_pipe(*output, PIPE_NONE);
+		}
+		if (found)
+			break;
 	}
 
+	igt_display_reset(display);
+
 	if (first_output)
 		igt_require_f(found, "No second valid output found\n");
 	else
 		igt_require_f(found, "No valid outputs found\n");
+
+	return pipe;
 }
 
 static void
@@ -749,10 +764,10 @@ static void test_scaler_with_multi_pipe_plane(data_t *d)
 	enum pipe pipe1, pipe2;
 	int ret1, ret2;
 
-	cleanup_crtc(d);
+	cleanup_fbs(d);
 
-	find_connected_pipe(display, false, &pipe1, &output1);
-	find_connected_pipe(display, true, &pipe2, &output2);
+	pipe1 = find_connected_pipe(display, false, &output1);
+	pipe2 = find_connected_pipe(display, true, &output2);
 
 	igt_skip_on(!output1 || !output2);
 
@@ -861,17 +876,25 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		for (int index = 0; index < ARRAY_SIZE(scaler_with_pixel_format_tests); index++) {
 			igt_describe(scaler_with_pixel_format_tests[index].describe);
 			igt_subtest_with_dynamic(scaler_with_pixel_format_tests[index].name) {
-			for_each_pipe_with_single_output(&data.display, pipe, output)
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
-					drmModeModeInfo *mode;
-
-					mode = igt_output_get_mode(output);
-
-					test_scaler_with_pixel_format_pipe(&data,
-							get_width(mode, scaler_with_pixel_format_tests[index].sf),
-							get_height(mode, scaler_with_pixel_format_tests[index].sf),
-							scaler_with_pixel_format_tests[index].is_upscale,
-							pipe, output);
+				for_each_pipe(&data.display, pipe) {
+					for_each_valid_output_on_pipe(&data.display, pipe, output) {
+						igt_output_set_pipe(output, pipe);
+						if (!igt_test_constraint(&data.display)) {
+							igt_output_set_pipe(output, PIPE_NONE);
+							continue;
+						}
+
+						igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+							drmModeModeInfo *mode = igt_output_get_mode(output);
+
+							test_scaler_with_pixel_format_pipe(&data,
+								get_width(mode, scaler_with_pixel_format_tests[index].sf),
+								get_height(mode, scaler_with_pixel_format_tests[index].sf),
+								scaler_with_pixel_format_tests[index].is_upscale,
+								pipe, output);
+						}
+						break;
+					}
 				}
 			}
 		}
@@ -879,17 +902,25 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		for (int index = 0; index < ARRAY_SIZE(scaler_with_rotation_tests); index++) {
 			igt_describe(scaler_with_rotation_tests[index].describe);
 			igt_subtest_with_dynamic(scaler_with_rotation_tests[index].name) {
-			for_each_pipe_with_single_output(&data.display, pipe, output)
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
-					drmModeModeInfo *mode;
-
-					mode = igt_output_get_mode(output);
-
-					test_scaler_with_rotation_pipe(&data,
-							get_width(mode, scaler_with_rotation_tests[index].sf),
-							get_height(mode, scaler_with_rotation_tests[index].sf),
-							scaler_with_rotation_tests[index].is_upscale,
-							pipe, output);
+				for_each_pipe(&data.display, pipe) {
+					for_each_valid_output_on_pipe(&data.display, pipe, output) {
+						igt_output_set_pipe(output, pipe);
+						if (!igt_test_constraint(&data.display)) {
+							igt_output_set_pipe(output, PIPE_NONE);
+							continue;
+						}
+
+						igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+							drmModeModeInfo *mode = igt_output_get_mode(output);
+
+							test_scaler_with_rotation_pipe(&data,
+								get_width(mode, scaler_with_rotation_tests[index].sf),
+								get_height(mode, scaler_with_rotation_tests[index].sf),
+								scaler_with_rotation_tests[index].is_upscale,
+								pipe, output);
+						}
+						break;
+					}
 				}
 			}
 		}
@@ -897,77 +928,116 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		for (int index = 0; index < ARRAY_SIZE(scaler_with_modifiers_tests); index++) {
 			igt_describe(scaler_with_modifiers_tests[index].describe);
 			igt_subtest_with_dynamic(scaler_with_modifiers_tests[index].name) {
-			for_each_pipe_with_single_output(&data.display, pipe, output)
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
-					drmModeModeInfo *mode;
-
-					mode = igt_output_get_mode(output);
-
-					test_scaler_with_modifier_pipe(&data,
-							get_width(mode, scaler_with_rotation_tests[index].sf),
-							get_height(mode, scaler_with_rotation_tests[index].sf),
-							scaler_with_rotation_tests[index].is_upscale,
-							pipe, output);
+				for_each_pipe(&data.display, pipe) {
+					for_each_valid_output_on_pipe(&data.display, pipe, output) {
+						igt_output_set_pipe(output, pipe);
+						if (!igt_test_constraint(&data.display)) {
+							igt_output_set_pipe(output, PIPE_NONE);
+							continue;
+						}
+
+						igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+							drmModeModeInfo *mode = igt_output_get_mode(output);
+
+							test_scaler_with_modifier_pipe(&data,
+								get_width(mode, scaler_with_rotation_tests[index].sf),
+								get_height(mode, scaler_with_rotation_tests[index].sf),
+								scaler_with_rotation_tests[index].is_upscale,
+								pipe, output);
+						}
+						break;
+					}
 				}
 			}
 		}
 
 		igt_describe("Tests scaling with clipping and clamping, pixel formats.");
 		igt_subtest_with_dynamic("plane-scaler-with-clipping-clamping-pixel-formats") {
-			for_each_pipe_with_single_output(&data.display, pipe, output) {
-				drmModeModeInfo *mode;
-
-				mode = igt_output_get_mode(output);
-
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output))
-					test_scaler_with_pixel_format_pipe(&data, mode->hdisplay + 100,
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_output_set_pipe(output, pipe);
+					if (!igt_test_constraint(&data.display)) {
+						igt_output_set_pipe(output, PIPE_NONE);
+						continue;
+					}
+
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+						drmModeModeInfo *mode = igt_output_get_mode(output);
+
+						test_scaler_with_pixel_format_pipe(&data, mode->hdisplay + 100,
 							mode->vdisplay + 100, false, pipe, output);
+					}
+					break;
+				}
 			}
 		}
 
 		igt_describe("Tests scaling with clipping and clamping, rotation.");
 		igt_subtest_with_dynamic("plane-scaler-with-clipping-clamping-rotation") {
-			for_each_pipe_with_single_output(&data.display, pipe, output) {
-				drmModeModeInfo *mode;
-
-				mode = igt_output_get_mode(output);
-
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output))
-					test_scaler_with_rotation_pipe(&data, mode->hdisplay + 100,
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_output_set_pipe(output, pipe);
+					if (!igt_test_constraint(&data.display)) {
+						igt_output_set_pipe(output, PIPE_NONE);
+						continue;
+					}
+
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+						drmModeModeInfo *mode = igt_output_get_mode(output);
+
+						test_scaler_with_rotation_pipe(&data, mode->hdisplay + 100,
 							mode->vdisplay + 100, false, pipe, output);
+					}
+					break;
+				}
 			}
 		}
 
 		igt_describe("Tests scaling with clipping and clamping, modifiers.");
 		igt_subtest_with_dynamic("plane-scaler-with-clipping-clamping-modifiers") {
-			for_each_pipe_with_single_output(&data.display, pipe, output) {
-				drmModeModeInfo *mode;
-
-				mode = igt_output_get_mode(output);
-
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output))
-					test_scaler_with_modifier_pipe(&data, mode->hdisplay + 100,
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_output_set_pipe(output, pipe);
+					if (!igt_test_constraint(&data.display)) {
+						igt_output_set_pipe(output, PIPE_NONE);
+						continue;
+					}
+
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+						drmModeModeInfo *mode = igt_output_get_mode(output);
+						test_scaler_with_modifier_pipe(&data, mode->hdisplay + 100,
 							mode->vdisplay + 100, false, pipe, output);
+					}
+					break;
+				}
 			}
 		}
 
 		for (int index = 0; index < ARRAY_SIZE(scaler_with_2_planes_tests); index++) {
 			igt_describe(scaler_with_2_planes_tests[index].describe);
 			igt_subtest_with_dynamic(scaler_with_2_planes_tests[index].name) {
-			for_each_pipe_with_single_output(&data.display, pipe, output)
-				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
-					drmModeModeInfo *mode;
-
-					mode = igt_output_get_mode(output);
-
-					test_planes_scaling_combo(&data,
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_output_set_pipe(output, pipe);
+					if (!igt_test_constraint(&data.display)) {
+						igt_output_set_pipe(output, PIPE_NONE);
+						continue;
+					}
+
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+						drmModeModeInfo *mode = igt_output_get_mode(output);
+
+						test_planes_scaling_combo(&data,
 							get_width(mode, scaler_with_2_planes_tests[index].sf_plane1),
 							get_height(mode, scaler_with_2_planes_tests[index].sf_plane1),
 							get_width(mode, scaler_with_2_planes_tests[index].sf_plane2),
 							get_height(mode, scaler_with_2_planes_tests[index].sf_plane2),
 							pipe, output, scaler_with_2_planes_tests[index].test_type);
+					}
+					break;
 				}
 			}
+			}
 		}
 
 		igt_describe("Negative test for number of scalers per pipe.");
-- 
2.35.1



More information about the Intel-gfx-trybot mailing list