summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_gpu.c
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2017-03-07 10:02:54 -0700
committerRob Clark <robdclark@gmail.com>2017-04-08 06:59:37 -0400
commitbf5af4ae875d8803db98d38ed988c2ec4c941a00 (patch)
tree270c6d656181487d442b0c5f83372c5b8a149ea3 /drivers/gpu/drm/msm/msm_gpu.c
parente3689e470fa0d9ebaa9d13d069e8d73c8d82a11d (diff)
drm/msm: Hard code the GPU "slow frequency"
Some A3XX and A4XX GPU targets required that the GPU clock be programmed to a non zero value when it was disabled so 27Mhz was chosen as the "invalid" frequency. Even though newer targets do not have the same clock restrictions we still write 27Mhz on clock disable and expect the clock subsystem to round down to zero. For unknown reasons even though the slow clock speed is always 27Mhz and it isn't actually a functional level the legacy device tree frequency tables always defined it and then did gymnastics to work around it. Instead of playing the same silly games just hard code the "slow" clock speed in the code as 27MHz and save ourselves a bit of infrastructure. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gpu.c')
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 937f1a0c5d3c..f8ee1489e691 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -123,8 +123,12 @@ static int disable_clk(struct msm_gpu *gpu)
if (gpu->grp_clks[i])
clk_unprepare(gpu->grp_clks[i]);
- if (gpu->grp_clks[0] && gpu->slow_rate)
- clk_set_rate(gpu->grp_clks[0], gpu->slow_rate);
+ /*
+ * Set the clock to a deliberately low rate. On older targets the clock
+ * speed had to be non zero to avoid problems. On newer targets this
+ * will be rounded down to zero anyway so it all works out.
+ */
+ clk_set_rate(gpu->grp_clks[0], 27000000);
if (gpu->grp_clks[2])
clk_set_rate(gpu->grp_clks[2], 0);