]> git.baikalelectronics.ru Git - kernel.git/commit
drm/rockchip: Properly adjust to a true clock in adjusted_mode
authorDouglas Anderson <dianders@chromium.org>
Fri, 14 Jun 2019 22:47:29 +0000 (15:47 -0700)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 16 Jun 2019 13:35:21 +0000 (15:35 +0200)
commit8083e6007dc52c3b3dcea206504ff3fd4c36ae30
treef961562a6c5d5c4bc672827db840ecdf6a1d82e4
parent65b54a8a76fb71b6a79af5e8e32386cfbcd16c71
drm/rockchip: Properly adjust to a true clock in adjusted_mode

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.

Fixes: f6084fe533c7 ("drm/rockchip: return a true clock rate to adjusted_mode")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20190614224730.98622-1-dianders@chromium.org
drivers/gpu/drm/rockchip/rockchip_drm_vop.c