All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Sean Paul <seanpaul@chromium.org>,
	dianders@chromium.org, ykk@rock-chips.com,
	dri-devel@lists.freedesktop.org
Cc: linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] drm/rockchip: Properly adjust to a true clock in adjusted_mode
Date: Tue, 9 Aug 2016 11:28:54 +0800	[thread overview]
Message-ID: <57A94DF6.6080600@rock-chips.com> (raw)
In-Reply-To: <1470684571-37955-1-git-send-email-seanpaul@chromium.org>

On 2016年08月09日 03:29, Sean Paul wrote:
> From: Douglas Anderson <dianders@chromium.org>
>
> When fixing up the clock in vop_crtc_mode_fixup() we're not doing it
> quite correctly.  Specifically if we've got the true clock 266666667 Hz,
> we'll perform this calculation:
>     266666667 / 1000 => 266666
>
> Later when we try to set the clock we'll do clk_set_rate(266666 *
> 1000).  The common clock framework won't actually pick the proper clock
> in this case since it always wants clocks <= the specified one.
>
> Let's solve this by using DIV_ROUND_UP.
Good, applied to my drm fixes.

Thanks

> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 31744fe..1bbffaf 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -891,7 +891,8 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
>   	struct vop *vop = to_vop(crtc);
>   
>   	adjusted_mode->clock =
> -		clk_round_rate(vop->dclk, mode->clock * 1000) / 1000;
> +		DIV_ROUND_UP(clk_round_rate(vop->dclk, mode->clock * 1000),
> +			     1000);
>   
>   	return true;
>   }


-- 
Mark Yao


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2016-08-09  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 19:29 [PATCH] drm/rockchip: Properly adjust to a true clock in adjusted_mode Sean Paul
2016-08-09  2:53 ` Yakir Yang
2016-08-09  3:28 ` Mark yao [this message]

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=57A94DF6.6080600@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=seanpaul@chromium.org \
    --cc=ykk@rock-chips.com \
    /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.