summaryrefslogtreecommitdiff
path: root/tests/kms_plane_scaling.c
diff options
context:
space:
mode:
authorBhanuprakash Modem <bhanuprakash.modem@intel.com>2021-05-12 22:35:28 +0530
committerPetri Latvala <petri.latvala@intel.com>2021-05-18 10:03:49 +0300
commitf5b2c104c1077ae86330e22826eb8d55f35e4017 (patch)
tree6db565c757fb9344621258a7af27f7b57b10961f /tests/kms_plane_scaling.c
parente4179322b350b019631b64f04ef84224c965210a (diff)
tests/kms_plane_scaling: Fix mode selection for 2x tests
This patch will find the connector/mode combination that fits into the bandwidth when more than one monitor is connected. Example: When two monitors connected through MST, the second monitor also tries to use the same mode. So two such modes may not fit into the link bandwidth. So, iterate through connected outputs & modes and find a combination of modes those fit into the link BW. V2: * Fix commit message (Ankit) Cc: Imre Deak <imre.deak@intel.com> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Diffstat (limited to 'tests/kms_plane_scaling.c')
-rw-r--r--tests/kms_plane_scaling.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 34efc588..7464b5bd 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -630,9 +630,6 @@ static void test_scaler_with_multi_pipe_plane(data_t *d)
d->plane3 = igt_output_get_plane(output2, 0);
d->plane4 = get_num_scalers(d, pipe2) >= 2 ? igt_output_get_plane(output2, 1) : NULL;
- mode1 = igt_output_get_mode(output1);
- mode2 = igt_output_get_mode(output2);
-
igt_skip_on(!igt_display_has_format_mod(display, DRM_FORMAT_XRGB8888,
tiling));
@@ -658,8 +655,20 @@ static void test_scaler_with_multi_pipe_plane(data_t *d)
igt_plane_set_fb(d->plane3, &d->fb[2]);
if (d->plane4)
igt_plane_set_fb(d->plane4, &d->fb[3]);
+
+ if (igt_display_try_commit_atomic(display,
+ DRM_MODE_ATOMIC_TEST_ONLY |
+ DRM_MODE_ATOMIC_ALLOW_MODESET,
+ NULL) != 0) {
+ bool found = igt_override_all_active_output_modes_to_fit_bw(display);
+ igt_require_f(found, "No valid mode combo found.\n");
+ }
+
igt_display_commit2(display, COMMIT_ATOMIC);
+ mode1 = igt_output_get_mode(output1);
+ mode2 = igt_output_get_mode(output2);
+
/* Upscaling Primary */
igt_plane_set_size(d->plane1, mode1->hdisplay, mode1->vdisplay);
igt_plane_set_size(d->plane3, mode2->hdisplay, mode2->vdisplay);