From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id E90276E868 for ; Sat, 8 May 2021 08:33:29 +0000 (UTC) From: Bhanuprakash Modem Date: Sat, 8 May 2021 21:52:53 +0530 Message-Id: <20210508162303.8235-5-bhanuprakash.modem@intel.com> In-Reply-To: <20210508162303.8235-1-bhanuprakash.modem@intel.com> References: <20210508162303.8235-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [v5 i-g-t 04/14] tests/debugfs_test: Fix mode selection for MST List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: 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. This patch will find a combination of modes that fit into the BW. V2: * Add support for legacy commit (Ankit) Cc: Imre Deak Cc: Ankit Nautiyal Cc: Daniel Vetter Signed-off-by: Bhanuprakash Modem --- tests/debugfs_test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c index 46ba0a8be..e50f213ae 100644 --- a/tests/debugfs_test.c +++ b/tests/debugfs_test.c @@ -98,12 +98,14 @@ static void kms_tests(int fd, int debugfs) igt_display_t display; struct igt_fb fb[IGT_MAX_PIPES]; enum pipe pipe; + int ret; igt_fixture igt_display_require(&display, fd); igt_subtest("read_all_entries_display_on") { /* try to light all pipes */ +retry: for_each_pipe(&display, pipe) { igt_output_t *output; @@ -128,6 +130,25 @@ static void kms_tests(int fd, int debugfs) } } + if (display.is_atomic) + ret = igt_display_try_commit_atomic(&display, + DRM_MODE_ATOMIC_TEST_ONLY | + DRM_MODE_ATOMIC_ALLOW_MODESET, + NULL); + else + ret = igt_display_try_commit2(&display, COMMIT_LEGACY); + + if (ret) { + igt_output_t *output; + bool found = igt_override_all_active_output_modes_to_fit_bw(&display); + igt_require_f(found, "No valid mode combo found.\n"); + + for_each_connected_output(&display, output) + igt_output_set_pipe(output, PIPE_NONE); + + goto retry; + } + igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); read_and_discard_sysfs_entries(debugfs, 0); -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev