[igt-dev] [v5 i-g-t 04/14] tests/debugfs_test: Fix mode selection for MST

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Tue May 11 10:07:03 UTC 2021


On 5/8/2021 9:52 PM, Bhanuprakash Modem wrote:
> 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 <imre.deak at intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>   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);

I think this commit is not required. We will get here after only when 
try_commit is already a success, either in first try or after retry.

Also request to modify the subject and commit msg to remove MST specific 
use.

With that fixed:

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>


>   
>   		read_and_discard_sysfs_entries(debugfs, 0);


More information about the igt-dev mailing list