All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [v5 i-g-t 03/14] tests/kms_cursor_legacy: Fix mode selection for 2x tests
Date: Tue, 11 May 2021 10:53:27 +0530	[thread overview]
Message-ID: <3e583ee9-43e1-7b57-eb7d-851126a6bbe8@intel.com> (raw)
In-Reply-To: <20210508162303.8235-4-bhanuprakash.modem@intel.com>


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.

Change looks good to me.

For this patch as well as other patches, the commit message can be 
modified as the change is no longer specific for MST, but any 2x setup 
in general.

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


>
> This patch will find a combination of modes that fit into the BW.
>
> V2:
> * Remove MST specific logic (Daniel)
> V3:
> * Add support for legacy commit (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>
> ---
>   tests/kms_cursor_legacy.c | 50 ++++++++++++++++++++++++++++++++++++---
>   1 file changed, 47 insertions(+), 3 deletions(-)
>
> diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
> index 4723e1ff9..571ea59cf 100644
> --- a/tests/kms_cursor_legacy.c
> +++ b/tests/kms_cursor_legacy.c
> @@ -50,6 +50,27 @@ IGT_TEST_DESCRIPTION("Stress legacy cursor ioctl");
>   
>   igt_pipe_crc_t *pipe_crc;
>   
> +static int try_commit(igt_display_t *display)
> +{
> +	return (display->is_atomic) ?
> +			igt_display_try_commit_atomic(display,
> +					DRM_MODE_ATOMIC_TEST_ONLY |
> +					DRM_MODE_ATOMIC_ALLOW_MODESET,
> +					NULL) :
> +			igt_display_try_commit2(display, COMMIT_LEGACY);
> +}
> +
> +static void override_output_modes(igt_display_t *display,
> +				  igt_output_t *output1,
> +				  igt_output_t *output2)
> +{
> +	bool found = igt_override_all_active_output_modes_to_fit_bw(display);
> +	igt_require_f(found, "No valid mode combo found.\n");
> +
> +	igt_output_set_pipe(output1, PIPE_NONE);
> +	igt_output_set_pipe(output2, PIPE_NONE);
> +}
> +
>   static void stress(igt_display_t *display,
>   		   enum pipe pipe, int num_children, unsigned mode,
>   		   int timeout)
> @@ -393,6 +414,7 @@ static void flip(igt_display_t *display,
>   	struct drm_mode_cursor arg[2];
>   	uint64_t *results;
>   	struct igt_fb fb_info, fb_info2, argb_fb, cursor_fb, cursor_fb2;
> +	igt_output_t *output, *output2;
>   
>   	results = mmap(NULL, PAGE_SIZE, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
>   	igt_assert(results != MAP_FAILED);
> @@ -406,9 +428,17 @@ static void flip(igt_display_t *display,
>   	if (mode >= flip_test_atomic)
>   		igt_require(display->is_atomic);
>   
> -	igt_require(set_fb_on_crtc(display, flip_pipe, &fb_info));
> -	if (flip_pipe != cursor_pipe)
> -		igt_require(set_fb_on_crtc(display, cursor_pipe, &fb_info2));
> +	igt_require((output = set_fb_on_crtc(display, flip_pipe, &fb_info)));
> +	if (flip_pipe != cursor_pipe) {
> +		igt_require((output2 = set_fb_on_crtc(display, cursor_pipe, &fb_info2)));
> +
> +		if (try_commit(display)) {
> +			override_output_modes(display, output, output2);
> +
> +			igt_require((output = set_fb_on_crtc(display, flip_pipe, &fb_info)));
> +			igt_require((output2 = set_fb_on_crtc(display, cursor_pipe, &fb_info2)));
> +		}
> +	}
>   
>   	igt_create_color_fb(display->drm_fd, fb_info.width, fb_info.height, DRM_FORMAT_ARGB8888, 0, .5, .5, .5, &cursor_fb);
>   
> @@ -879,6 +909,13 @@ static void two_screens_flip_vs_cursor(igt_display_t *display, int nloops, bool
>   	igt_require((output = set_fb_on_crtc(display, pipe, &fb_info)));
>   	igt_require((output2 = set_fb_on_crtc(display, pipe2, &fb2_info)));
>   
> +	if (try_commit(display)) {
> +		override_output_modes(display, output, output2);
> +
> +		igt_require((output = set_fb_on_crtc(display, pipe, &fb_info)));
> +		igt_require((output2 = set_fb_on_crtc(display, pipe2, &fb2_info)));
> +	}
> +
>   	igt_create_color_fb(display->drm_fd, 64, 64, DRM_FORMAT_ARGB8888, 0, 1., 1., 1., &cursor_fb);
>   	set_cursor_on_pipe(display, pipe, &cursor_fb);
>   	populate_cursor_args(display, pipe, arg1, &cursor_fb);
> @@ -1129,6 +1166,13 @@ static void two_screens_cursor_vs_flip(igt_display_t *display, int nloops, bool
>   	igt_require((outputs[0] = set_fb_on_crtc(display, pipe[0], &fb_info[0])));
>   	igt_require((outputs[1] = set_fb_on_crtc(display, pipe[1], &fb_info[1])));
>   
> +	if (try_commit(display)) {
> +		override_output_modes(display, outputs[0], outputs[1]);
> +
> +		igt_require((outputs[0] = set_fb_on_crtc(display, pipe[0], &fb_info[0])));
> +		igt_require((outputs[1] = set_fb_on_crtc(display, pipe[1], &fb_info[1])));
> +	}
> +
>   	igt_create_color_fb(display->drm_fd, 64, 64, DRM_FORMAT_ARGB8888, 0, 1., 1., 1., &cursor_fb);
>   
>   	set_cursor_on_pipe(display, pipe[0], &cursor_fb);
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-05-11  5:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 16:22 [igt-dev] [v5 i-g-t 00/14] Fix mode selection for 2x tests Bhanuprakash Modem
2021-05-08  9:23 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix mode selection for 2x tests (rev5) Patchwork
2021-05-08 10:19 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 01/14] lib/igt_kms: helper to override the mode on all connectors Bhanuprakash Modem
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 02/14] tests/kms_frontbuffer_tracking: Fix mode selection for 2x tests Bhanuprakash Modem
2021-05-11  4:27   ` Nautiyal, Ankit K
2021-05-12  6:37     ` Modem, Bhanuprakash
2021-05-12  6:46       ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 03/14] tests/kms_cursor_legacy: " Bhanuprakash Modem
2021-05-11  5:23   ` Nautiyal, Ankit K [this message]
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 04/14] tests/debugfs_test: Fix mode selection for MST Bhanuprakash Modem
2021-05-11 10:07   ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 05/14] tests/kms_content_protection: Fix mode selection for 2x tests Bhanuprakash Modem
2021-05-11  5:54   ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 06/14] tests/kms_plane_scaling: " Bhanuprakash Modem
2021-05-11  6:02   ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 07/14] tests/kms_atomic_transition: " Bhanuprakash Modem
2021-05-11  9:30   ` Nautiyal, Ankit K
2021-05-11 11:58     ` Modem, Bhanuprakash
2021-05-12  6:19       ` Nautiyal, Ankit K
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 08/14] tests/kms_plane: Reset the state before exiting the test Bhanuprakash Modem
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 09/14] tests/kms_plane_alpha_blend: " Bhanuprakash Modem
2021-05-08 16:22 ` [igt-dev] [v5 i-g-t 10/14] tests/kms_cursor_edge_walk: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 11/14] tests/kms_plane_lowres: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 12/14] tests/kms_plane_cursor: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 13/14] tests/kms_flip_scaled_crc: " Bhanuprakash Modem
2021-05-08 16:23 ` [igt-dev] [v5 i-g-t 14/14] tests/kms_vblank: " Bhanuprakash Modem

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e583ee9-43e1-7b57-eb7d-851126a6bbe8@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.