Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-16 14:48:59 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-16 14:49:04 +0200
commite2187f1f81f8f4b4a51762ccf2f4a950e3e6f0a9 (patch)
tree9d4f5772930af613f3a6787ea24ac75df4d4a01e
parentabd68160534c6a0ae3cc145f0e7eae66682f94a9 (diff)
drm/rockchip: Properly adjust to a true clock in adjusted_mode
(bsc#1051510).
-rw-r--r--patches.drm/drm-rockchip-Properly-adjust-to-a-true-clock-in-adju.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.drm/drm-rockchip-Properly-adjust-to-a-true-clock-in-adju.patch b/patches.drm/drm-rockchip-Properly-adjust-to-a-true-clock-in-adju.patch
new file mode 100644
index 0000000000..b21335679a
--- /dev/null
+++ b/patches.drm/drm-rockchip-Properly-adjust-to-a-true-clock-in-adju.patch
@@ -0,0 +1,48 @@
+From 99b9683f2142b20bad78e61f7f829e8714e45685 Mon Sep 17 00:00:00 2001
+From: Douglas Anderson <dianders@chromium.org>
+Date: Fri, 14 Jun 2019 15:47:29 -0700
+Subject: [PATCH] drm/rockchip: Properly adjust to a true clock in adjusted_mode
+Git-commit: 99b9683f2142b20bad78e61f7f829e8714e45685
+Patch-mainline: v5.3-rc1
+References: bsc#1051510
+
+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: b59b8de31497 ("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
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ 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 4189ca17f381..771bf5d53cf0 100644
+--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
++++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+@@ -1013,7 +1013,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;
+ }
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index a0708a3191..d282564d0b 100644
--- a/series.conf
+++ b/series.conf
@@ -22916,6 +22916,7 @@
patches.arch/powerpc-mm-Consolidate-numa_enable-check-and-min_com.patch
patches.drivers/platform-x86-pmc_atom-Add-CB4063-Beckhoff-Automation.patch
patches.drm/drm-meson-Add-support-for-XBGR8888-ABGR8888-formats.patch
+ patches.drm/drm-rockchip-Properly-adjust-to-a-true-clock-in-adju.patch
# powerpc/linux next
patches.arch/powerpc-pseries-dlpar-Fix-a-missing-check-in-dlpar_p.patch