Merge "drm/msm: Turn off hardware clock gating before reading A5XX registers"
This commit is contained in:
commit
74d929874d
5 changed files with 48 additions and 20 deletions
|
@ -409,8 +409,8 @@ static void a3xx_show(struct msm_gpu *gpu, struct seq_file *m)
|
||||||
gpu->funcs->pm_resume(gpu);
|
gpu->funcs->pm_resume(gpu);
|
||||||
seq_printf(m, "status: %08x\n",
|
seq_printf(m, "status: %08x\n",
|
||||||
gpu_read(gpu, REG_A3XX_RBBM_STATUS));
|
gpu_read(gpu, REG_A3XX_RBBM_STATUS));
|
||||||
gpu->funcs->pm_suspend(gpu);
|
|
||||||
adreno_show(gpu, m);
|
adreno_show(gpu, m);
|
||||||
|
gpu->funcs->pm_suspend(gpu);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -447,9 +447,9 @@ static void a4xx_show(struct msm_gpu *gpu, struct seq_file *m)
|
||||||
|
|
||||||
seq_printf(m, "status: %08x\n",
|
seq_printf(m, "status: %08x\n",
|
||||||
gpu_read(gpu, REG_A4XX_RBBM_STATUS));
|
gpu_read(gpu, REG_A4XX_RBBM_STATUS));
|
||||||
gpu->funcs->pm_suspend(gpu);
|
|
||||||
|
|
||||||
adreno_show(gpu, m);
|
adreno_show(gpu, m);
|
||||||
|
gpu->funcs->pm_suspend(gpu);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -375,6 +375,7 @@ static const struct {
|
||||||
void a5xx_set_hwcg(struct msm_gpu *gpu, bool state)
|
void a5xx_set_hwcg(struct msm_gpu *gpu, bool state)
|
||||||
{
|
{
|
||||||
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
||||||
|
struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(a5xx_hwcg); i++)
|
for (i = 0; i < ARRAY_SIZE(a5xx_hwcg); i++)
|
||||||
|
@ -391,6 +392,11 @@ void a5xx_set_hwcg(struct msm_gpu *gpu, bool state)
|
||||||
|
|
||||||
gpu_write(gpu, REG_A5XX_RBBM_CLOCK_CNTL, state ? 0xAAA8AA00 : 0);
|
gpu_write(gpu, REG_A5XX_RBBM_CLOCK_CNTL, state ? 0xAAA8AA00 : 0);
|
||||||
gpu_write(gpu, REG_A5XX_RBBM_ISDB_CNT, state ? 0x182 : 0x180);
|
gpu_write(gpu, REG_A5XX_RBBM_ISDB_CNT, state ? 0x182 : 0x180);
|
||||||
|
|
||||||
|
if (state)
|
||||||
|
set_bit(A5XX_HWCG_ENABLED, &a5xx_gpu->flags);
|
||||||
|
else
|
||||||
|
clear_bit(A5XX_HWCG_ENABLED, &a5xx_gpu->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int a5xx_me_init(struct msm_gpu *gpu)
|
static int a5xx_me_init(struct msm_gpu *gpu)
|
||||||
|
@ -1168,6 +1174,10 @@ static int a5xx_pm_resume(struct msm_gpu *gpu)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* If we are already up, don't mess with what works */
|
||||||
|
if (gpu->active_cnt > 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Turn the RBCCU domain first to limit the chances of voltage droop */
|
/* Turn the RBCCU domain first to limit the chances of voltage droop */
|
||||||
gpu_write(gpu, REG_A5XX_GPMU_RBCCU_POWER_CNTL, 0x778000);
|
gpu_write(gpu, REG_A5XX_GPMU_RBCCU_POWER_CNTL, 0x778000);
|
||||||
|
|
||||||
|
@ -1198,10 +1208,13 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)
|
||||||
{
|
{
|
||||||
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
||||||
|
|
||||||
|
/* Only do this next bit if we are about to go down */
|
||||||
|
if (gpu->active_cnt == 1) {
|
||||||
/* Clear the VBIF pipe before shutting down */
|
/* Clear the VBIF pipe before shutting down */
|
||||||
|
|
||||||
gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0xF);
|
gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0xF);
|
||||||
spin_until((gpu_read(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL1) & 0xF) == 0xF);
|
spin_until((gpu_read(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL1) & 0xF)
|
||||||
|
== 0xF);
|
||||||
|
|
||||||
gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0);
|
gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0);
|
||||||
|
|
||||||
|
@ -1209,11 +1222,13 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)
|
||||||
* Reset the VBIF before power collapse to avoid issue with FIFO
|
* Reset the VBIF before power collapse to avoid issue with FIFO
|
||||||
* entries
|
* entries
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (adreno_is_a530(adreno_gpu)) {
|
if (adreno_is_a530(adreno_gpu)) {
|
||||||
/* These only need to be done for A530 */
|
/* These only need to be done for A530 */
|
||||||
gpu_write(gpu, REG_A5XX_RBBM_BLOCK_SW_RESET_CMD, 0x003C0000);
|
gpu_write(gpu, REG_A5XX_RBBM_BLOCK_SW_RESET_CMD,
|
||||||
gpu_write(gpu, REG_A5XX_RBBM_BLOCK_SW_RESET_CMD, 0x00000000);
|
0x003C0000);
|
||||||
|
gpu_write(gpu, REG_A5XX_RBBM_BLOCK_SW_RESET_CMD,
|
||||||
|
0x00000000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return msm_gpu_pm_suspend(gpu);
|
return msm_gpu_pm_suspend(gpu);
|
||||||
|
@ -1233,13 +1248,29 @@ static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
static void a5xx_show(struct msm_gpu *gpu, struct seq_file *m)
|
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);
|
gpu->funcs->pm_resume(gpu);
|
||||||
|
|
||||||
seq_printf(m, "status: %08x\n",
|
seq_printf(m, "status: %08x\n",
|
||||||
gpu_read(gpu, REG_A5XX_RBBM_STATUS));
|
gpu_read(gpu, REG_A5XX_RBBM_STATUS));
|
||||||
gpu->funcs->pm_suspend(gpu);
|
|
||||||
|
/*
|
||||||
|
* 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);
|
adreno_show(gpu, m);
|
||||||
|
|
||||||
|
if (enabled)
|
||||||
|
a5xx_set_hwcg(gpu, true);
|
||||||
|
|
||||||
|
gpu->funcs->pm_suspend(gpu);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
A5XX_ZAP_SHADER_LOADED = 1,
|
A5XX_ZAP_SHADER_LOADED = 1,
|
||||||
|
A5XX_HWCG_ENABLED = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct a5xx_gpu {
|
struct a5xx_gpu {
|
||||||
|
|
|
@ -297,8 +297,6 @@ void adreno_show(struct msm_gpu *gpu, struct seq_file *m)
|
||||||
seq_printf(m, "rb wptr: %d\n", get_wptr(ring));
|
seq_printf(m, "rb wptr: %d\n", get_wptr(ring));
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu->funcs->pm_resume(gpu);
|
|
||||||
|
|
||||||
/* dump these out in a form that can be parsed by demsm: */
|
/* dump these out in a form that can be parsed by demsm: */
|
||||||
seq_printf(m, "IO:region %s 00000000 00020000\n", gpu->name);
|
seq_printf(m, "IO:region %s 00000000 00020000\n", gpu->name);
|
||||||
for (i = 0; adreno_gpu->registers[i] != ~0; i += 2) {
|
for (i = 0; adreno_gpu->registers[i] != ~0; i += 2) {
|
||||||
|
@ -311,8 +309,6 @@ void adreno_show(struct msm_gpu *gpu, struct seq_file *m)
|
||||||
seq_printf(m, "IO:R %08x %08x\n", addr<<2, val);
|
seq_printf(m, "IO:R %08x %08x\n", addr<<2, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu->funcs->pm_suspend(gpu);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue