All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kazlauskas, Nicholas" <Nicholas.Kazlauskas-5C7GfCeVMHo@public.gmane.org>
To: Mario Kleiner
	<mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 2/4] drm/amd/display: Fix and simplify apply_below_the_range()
Date: Thu, 18 Apr 2019 19:25:38 +0000	[thread overview]
Message-ID: <8fdff85d-933a-3b0b-a866-c170434ae0b5@amd.com> (raw)
In-Reply-To: <20190418035122.15791-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 4/17/19 11:51 PM, Mario Kleiner wrote:
> The comparison of inserted_frame_duration_in_us against a
> duration calculated from max_refresh_in_uhz is both wrong
> in its math and not needed, as the min_duration_in_us value
> is already cached in in_out_vrr for reuse. No need to
> recalculate it wrongly at each invocation.
> 
> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Looks reasonable to me.

> ---
>   drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
> index 71274683da04..e56543c36eba 100644
> --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
> +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
> @@ -437,10 +437,8 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
>   			inserted_frame_duration_in_us = last_render_time_in_us /
>   							frames_to_insert;
>   
> -		if (inserted_frame_duration_in_us <
> -			(1000000 / in_out_vrr->max_refresh_in_uhz))
> -			inserted_frame_duration_in_us =
> -				(1000000 / in_out_vrr->max_refresh_in_uhz);
> +		if (inserted_frame_duration_in_us < in_out_vrr->min_duration_in_us)
> +			inserted_frame_duration_in_us = in_out_vrr->min_duration_in_us;
>   
>   		/* Cache the calculated variables */
>   		in_out_vrr->btr.inserted_duration_in_us =
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-04-18 19:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18  3:51 Improvements to VRR below-the-range/low framerate compensation Mario Kleiner
     [not found] ` <20190418035122.15791-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-04-18  3:51   ` [PATCH 1/4] drm/amd/display: Add some debug output for VRR BTR Mario Kleiner
2019-04-18 19:04     ` Kazlauskas, Nicholas
2019-04-18  3:51   ` [PATCH 2/4] drm/amd/display: Fix and simplify apply_below_the_range() Mario Kleiner
     [not found]     ` <20190418035122.15791-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-04-18 19:25       ` Kazlauskas, Nicholas [this message]
2019-04-18  3:51   ` [PATCH 3/4] drm/amd/display: Enter VRR BTR earlier Mario Kleiner
2019-04-18  3:51 ` [PATCH 4/4] drm/amd/display: Compensate for pre-DCE12 BTR-VRR hw limitations Mario Kleiner
2019-04-24 14:34   ` Kazlauskas, Nicholas
     [not found]     ` <2a45d459-1484-3a99-d2cd-12633e56f2b4-5C7GfCeVMHo@public.gmane.org>
2019-04-26  8:35       ` Mario Kleiner
2019-04-18 14:24 ` Improvements to VRR below-the-range/low framerate compensation Michel Dänzer
     [not found]   ` <65c584af-e2c6-a73a-a8f1-45bbe9ad527d-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-04-18 14:35     ` Kazlauskas, Nicholas

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=8fdff85d-933a-3b0b-a866-c170434ae0b5@amd.com \
    --to=nicholas.kazlauskas-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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.