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 02/14] tests/kms_frontbuffer_tracking: Fix mode selection for 2x tests
Date: Tue, 11 May 2021 09:57:05 +0530	[thread overview]
Message-ID: <f8092e5d-7b4f-222c-0d08-49fb222f9206@intel.com> (raw)
In-Reply-To: <20210508162303.8235-3-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.
>
> 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_frontbuffer_tracking.c | 40 ++++++++++++++++++++++++++++++++
>   1 file changed, 40 insertions(+)
>
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 2e74bec6f..65c2ddb5c 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -1683,14 +1683,54 @@ static void enable_prim_screen_and_wait(const struct test_mode *t)
>   	do_assertions(ASSERT_NO_ACTION_CHANGE);
>   }
>   
> +static void update_modeset_cached_params(void)
> +{
> +	bool found = false;
> +
> +	igt_output_set_pipe(prim_mode_params.output, prim_mode_params.pipe);
> +	igt_output_set_pipe(scnd_mode_params.output, scnd_mode_params.pipe);
> +
> +	found = igt_override_all_active_output_modes_to_fit_bw(&drm.display);
> +	igt_require_f(found, "No valid mode combo found.\n");
> +
> +	prim_mode_params.mode_copy = *igt_output_get_mode(prim_mode_params.output);
> +	prim_mode_params.mode = &prim_mode_params.mode_copy;
> +	prim_mode_params.primary.w = prim_mode_params.mode->hdisplay;
> +	prim_mode_params.primary.h = prim_mode_params.mode->vdisplay;
> +
> +	scnd_mode_params.mode_copy = *igt_output_get_mode(scnd_mode_params.output);
> +	scnd_mode_params.mode = &scnd_mode_params.mode_copy;
> +	scnd_mode_params.primary.w = scnd_mode_params.mode->hdisplay;
> +	scnd_mode_params.primary.h = scnd_mode_params.mode->vdisplay;
> +
> +	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
> +	fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
> +
> +	__set_mode_for_params(&prim_mode_params);
> +	__set_mode_for_params(&scnd_mode_params);
> +}
> +
>   static void enable_both_screens_and_wait(const struct test_mode *t)
>   {
> +	int ret;
> +
>   	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
>   	fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
>   
>   	__set_mode_for_params(&prim_mode_params);
>   	__set_mode_for_params(&scnd_mode_params);
>   
> +	if (drm.display.is_atomic)
> +		ret = igt_display_try_commit_atomic(&drm.display,
> +				DRM_MODE_ATOMIC_TEST_ONLY |
> +				DRM_MODE_ATOMIC_ALLOW_MODESET,
> +				NULL);
> +	else
> +		ret = igt_display_try_commit2(&drm.display, COMMIT_LEGACY);
> +
> +	if (ret)
> +		update_modeset_cached_params();
> +
>   	igt_display_commit2(&drm.display, drm.display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);

I think this statement should now be the part of the above if-block.

In case either of the try commit passes without need to call 
update_modeset_chached_params(), igt_display_commit again will be redundant.

With that changed:

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

>   
>   	wanted_crc = &blue_crcs[t->format].crc;
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-05-11  4:27 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 [this message]
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
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=f8092e5d-7b4f-222c-0d08-49fb222f9206@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.