Skip to content

Commit a477aa6

Browse files
akhilpo-qcomRob Clark
authored andcommitted
drm/msm: a6xx: Refactor a6xx_sptprac_enable()
A minor refactor to combine the subroutines for legacy a6xx GMUs under a single check. This helps to avoid an unnecessary check and return early from the subroutine for majority of a6xx gpus. Also, document an intermediate unknown low power state which is not exposed by the GMU firmware. Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/673364/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
1 parent f248d5d commit a477aa6

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,10 @@ int a6xx_sptprac_enable(struct a6xx_gmu *gmu)
412412
int ret;
413413
u32 val;
414414

415-
if (!gmu->legacy)
415+
WARN_ON(!gmu->legacy);
416+
417+
/* Nothing to do if GMU does the power management */
418+
if (gmu->idle_level > GMU_IDLE_STATE_ACTIVE)
416419
return 0;
417420

418421
gmu_write(gmu, REG_A6XX_GMU_GX_SPTPRAC_POWER_CONTROL, 0x778000);
@@ -936,10 +939,7 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
936939
ret = a6xx_gmu_gfx_rail_on(gmu);
937940
if (ret)
938941
return ret;
939-
}
940942

941-
/* Enable SPTP_PC if the CPU is responsible for it */
942-
if (gmu->idle_level < GMU_IDLE_STATE_SPTP) {
943943
ret = a6xx_sptprac_enable(gmu);
944944
if (ret)
945945
return ret;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ struct a6xx_bcm {
5050
/* The GMU does not do any idle state management */
5151
#define GMU_IDLE_STATE_ACTIVE 0
5252

53+
/* Unknown power state. Not exposed by the firmware. For documentation purpose only */
54+
#define GMU_IDLE_STATE_RESERVED 1
55+
5356
/* The GMU manages SPTP power collapse */
5457
#define GMU_IDLE_STATE_SPTP 2
5558

0 commit comments

Comments
 (0)