mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] video: ipuv3: use closest fractional divider
Date: Wed, 14 Nov 2018 09:59:55 +0100	[thread overview]
Message-ID: <20181114085955.o5hz7riqxbg2kbt6@pengutronix.de> (raw)
In-Reply-To: <20181112162257.2209-1-l.stach@pengutronix.de>

On Mon, Nov 12, 2018 at 05:22:56PM +0100, Lucas Stach wrote:
> Currently the divider is always rounded down, which may lead to a
> rather big overshoot of the display clock. Try to match the clock
> better by rounding to closest.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/video/imx-ipu-v3/ipu-di.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/video/imx-ipu-v3/ipu-di.c b/drivers/video/imx-ipu-v3/ipu-di.c
> index b6e64fe16a85..5751c678b28e 100644
> --- a/drivers/video/imx-ipu-v3/ipu-di.c
> +++ b/drivers/video/imx-ipu-v3/ipu-di.c
> @@ -140,10 +140,7 @@ static int ipu_di_clk_calc_div(unsigned long inrate, unsigned long outrate)
>  	int div;
>  
>  	tmp *= 16;
> -
> -	do_div(tmp, outrate);
> -
> -	div = tmp;
> +	div = DIV_ROUND_CLOSEST(tmp, outrate);
>  
>  	if (div < 0x10)
>  		div = 0x10;
> -- 
> 2.19.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-11-14  9:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 16:22 Lucas Stach
2018-11-12 16:22 ` [PATCH 2/2] video: ipuv3: use non-fractional clock for parallel display Lucas Stach
2018-11-14  8:59 ` Sascha Hauer [this message]
2018-11-19 10:05 ` [PATCH 1/2] video: ipuv3: use closest fractional divider Sascha Hauer

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=20181114085955.o5hz7riqxbg2kbt6@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox