Skip to content

Commit d9e19d7

Browse files
fltorobclark
authored andcommitted
drm/msm/a6xx: skip HFI set freq if GMU is powered down
Also skip the newly added HFI set freq path if the GMU is powered down, which was missing because of patches crossing paths. Signed-off-by: Jonathan Marek <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent fb212ad commit d9e19d7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ static void __a6xx_gmu_set_freq(struct a6xx_gmu *gmu, int index)
110110
struct msm_gpu *gpu = &adreno_gpu->base;
111111
int ret;
112112

113-
/*
114-
* This can get called from devfreq while the hardware is idle. Don't
115-
* bring up the power if it isn't already active
116-
*/
117-
if (pm_runtime_get_if_in_use(gmu->dev) == 0)
118-
return;
119-
120113
gmu_write(gmu, REG_A6XX_GMU_DCVS_ACK_OPTION, 0);
121114

122115
gmu_write(gmu, REG_A6XX_GMU_DCVS_PERF_SETTING,
@@ -141,7 +134,6 @@ static void __a6xx_gmu_set_freq(struct a6xx_gmu *gmu, int index)
141134
* for now leave it at max so that the performance is nominal.
142135
*/
143136
icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
144-
pm_runtime_put(gmu->dev);
145137
}
146138

147139
void a6xx_gmu_set_freq(struct msm_gpu *gpu, unsigned long freq)
@@ -159,13 +151,21 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, unsigned long freq)
159151
break;
160152

161153
gmu->current_perf_index = perf_index;
154+
gmu->freq = gmu->gpu_freqs[perf_index];
155+
156+
/*
157+
* This can get called from devfreq while the hardware is idle. Don't
158+
* bring up the power if it isn't already active
159+
*/
160+
if (pm_runtime_get_if_in_use(gmu->dev) == 0)
161+
return;
162162

163163
if (gmu->legacy)
164164
__a6xx_gmu_set_freq(gmu, perf_index);
165165
else
166166
a6xx_hfi_set_freq(gmu, perf_index);
167167

168-
gmu->freq = gmu->gpu_freqs[perf_index];
168+
pm_runtime_put(gmu->dev);
169169
}
170170

171171
unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)

0 commit comments

Comments
 (0)