mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-15 22:31:47 -04:00
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>
This commit is contained in:
committed by
Rob Clark
parent
f248d5d515
commit
a477aa67e0
@@ -412,7 +412,10 @@ int a6xx_sptprac_enable(struct a6xx_gmu *gmu)
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
if (!gmu->legacy)
|
||||
WARN_ON(!gmu->legacy);
|
||||
|
||||
/* Nothing to do if GMU does the power management */
|
||||
if (gmu->idle_level > GMU_IDLE_STATE_ACTIVE)
|
||||
return 0;
|
||||
|
||||
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)
|
||||
ret = a6xx_gmu_gfx_rail_on(gmu);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Enable SPTP_PC if the CPU is responsible for it */
|
||||
if (gmu->idle_level < GMU_IDLE_STATE_SPTP) {
|
||||
ret = a6xx_sptprac_enable(gmu);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -50,6 +50,9 @@ struct a6xx_bcm {
|
||||
/* The GMU does not do any idle state management */
|
||||
#define GMU_IDLE_STATE_ACTIVE 0
|
||||
|
||||
/* Unknown power state. Not exposed by the firmware. For documentation purpose only */
|
||||
#define GMU_IDLE_STATE_RESERVED 1
|
||||
|
||||
/* The GMU manages SPTP power collapse */
|
||||
#define GMU_IDLE_STATE_SPTP 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user