summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2017-07-20 10:52:33 -0600
committerJordan Crouse <jcrouse@codeaurora.org>2017-07-24 13:01:14 -0600
commit3beb8eb46765be81cde0dc413aebf87b7db6dcb7 (patch)
tree3078c4ad4879900d530ee3d5bf0c54520ea84354 /drivers/gpu/drm
parenta0c5da88c9bdcd496ab1d587e00871fa2634fc73 (diff)
drm/msm: Turn off hardware clock gating before reading A5XX registers
On A5XX GPU hardware clock gating needs to be turned off before reading certain GPU registers via AHB. Turn off HWCG before calling adreno_show() to safely dump all the registers without a system hang. Change-Id: Ic0dedbad550ab5d414cea7837672e586a7acd370 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/msm/adreno/a5xx_gpu.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index e66079cdd53e..45a38b247727 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1248,12 +1248,28 @@ static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)
#ifdef CONFIG_DEBUG_FS
static void a5xx_show(struct msm_gpu *gpu, struct seq_file *m)
{
+ struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
+ struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
+ bool enabled = test_bit(A5XX_HWCG_ENABLED, &a5xx_gpu->flags);
+
gpu->funcs->pm_resume(gpu);
seq_printf(m, "status: %08x\n",
gpu_read(gpu, REG_A5XX_RBBM_STATUS));
+ /*
+ * Temporarily disable hardware clock gating before going into
+ * adreno_show to avoid issues while reading the registers
+ */
+
+ if (enabled)
+ a5xx_set_hwcg(gpu, false);
+
adreno_show(gpu, m);
+
+ if (enabled)
+ a5xx_set_hwcg(gpu, true);
+
gpu->funcs->pm_suspend(gpu);
}
#endif