Skip to content

Commit 30f55f3

Browse files
konradybciorobclark
authored andcommitted
drm/msm/a6xx: Move CX GMU power counter enablement to hw_init
Since the introduction of A6xx support, we've been enabling the CX GMU power counter 0 in a bit of a weird spot. Move it to hw_init so that GMU wrapper GPUs can reuse the same code paths. As a bonus, this order makes it easier to compare mainline and downstream register access traces. Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/542765/ Signed-off-by: Rob Clark <[email protected]>
1 parent df5bb40 commit 30f55f3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gmu.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,6 @@ static int a6xx_rpmh_start(struct a6xx_gmu *gmu)
479479

480480
gmu_write(gmu, REG_A6XX_GMU_RSCC_CONTROL_REQ, 0);
481481

482-
/* Set up CX GMU counter 0 to count busy ticks */
483-
gmu_write(gmu, REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK, 0xff000000);
484-
gmu_rmw(gmu, REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0, 0xff, 0x20);
485-
486-
/* Enable the power counter */
487-
gmu_write(gmu, REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE, 1);
488482
return 0;
489483
}
490484

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,13 @@ static int hw_init(struct msm_gpu *gpu)
12561256
0x3f0243f0);
12571257
}
12581258

1259+
/* Set up the CX GMU counter 0 to count busy ticks */
1260+
gmu_write(gmu, REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK, 0xff000000);
1261+
1262+
/* Enable the power counter */
1263+
gmu_rmw(gmu, REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0, 0xff, BIT(5));
1264+
gmu_write(gmu, REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE, 1);
1265+
12591266
/* Protect registers from the CP */
12601267
a6xx_set_cp_protect(gpu);
12611268

0 commit comments

Comments
 (0)