[i-g-t v2 27/51] tests/kms_plane_scaling: Add support for Bigjoiner
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Fri Aug 12 05:20:01 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 | 201 ++++++++++++++++++++++++--------------
1 file changed, 129 insertions(+), 72 deletions(-)
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index fc8250b5..773fbe20 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -548,22 +548,24 @@ 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)
{
- enum pipe first = PIPE_NONE;
- igt_output_t *first_output = NULL;
+ bool first_output = false;
bool found = false;
+ igt_display_reset(display);
+
for_each_pipe_with_valid_output(display, *pipe, *output) {
- if (first == *pipe || *output == first_output)
- continue;
+ igt_output_set_pipe(*output, *pipe);
+ if (igt_test_constraint(display)) {
+ found = true;
- if (second) {
- first = *pipe;
- first_output = *output;
- second = false;
- continue;
+ if (second) {
+ first_output = true;
+ second = false;
+ continue;
+ }
+ break;
}
-
- return;
+ igt_output_set_pipe(*output, PIPE_NONE);
}
if (first_output)
@@ -861,17 +863,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 +889,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 +915,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