summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip
diff options
context:
space:
mode:
authorChris Zhong <zyw@rock-chips.com>2016-01-06 12:03:53 +0800
committerMark Yao <mark.yao@rock-chips.com>2016-01-06 13:51:09 +0800
commitb59b8de3149736e5094cb786978a1ba8d6d55b34 (patch)
tree932624f6f1c833f38744c1ecef3266ea8e2c9f8c /drivers/gpu/drm/rockchip
parentc11b8989635166c5a1e6aac1853a847bd664f8db (diff)
downloadop-kernel-dev-b59b8de3149736e5094cb786978a1ba8d6d55b34.zip
op-kernel-dev-b59b8de3149736e5094cb786978a1ba8d6d55b34.tar.gz
drm/rockchip: return a true clock rate to adjusted_mode
Since the mipi dsi driver need to use the clock of vop to make the calculation of Blanking. But sometimes the clock driver can not set a accurate clock_rate for vop, get it by clk_round_rate before mode_set, so we can get the true value. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Acked-by: Mark Yao <mark.yao@rock-chips.com>
Diffstat (limited to 'drivers/gpu/drm/rockchip')
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index f5b3da2..056cac3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -878,9 +878,14 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
+ struct vop *vop = to_vop(crtc);
+
if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0)
return false;
+ adjusted_mode->clock =
+ clk_round_rate(vop->dclk, mode->clock * 1000) / 1000;
+
return true;
}
OpenPOWER on IntegriCloud