Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3beb8eb4 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

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: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent a0c5da88
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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