Commit bd3fe811 authored by Rob Clark's avatar Rob Clark

drm/msm/a6xx: restore previous freq on resume

Previously, if the freq were overriden (ie. via sysfs), it would get
reset to max on resume.
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 7ec9741b
...@@ -149,6 +149,8 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, unsigned long freq) ...@@ -149,6 +149,8 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, unsigned long freq)
if (freq == gmu->gpu_freqs[perf_index]) if (freq == gmu->gpu_freqs[perf_index])
break; break;
gmu->current_perf_index = perf_index;
__a6xx_gmu_set_freq(gmu, perf_index); __a6xx_gmu_set_freq(gmu, perf_index);
} }
...@@ -741,8 +743,8 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu) ...@@ -741,8 +743,8 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
gmu_write(gmu, REG_A6XX_GMU_GMU2HOST_INTR_MASK, ~A6XX_HFI_IRQ_MASK); gmu_write(gmu, REG_A6XX_GMU_GMU2HOST_INTR_MASK, ~A6XX_HFI_IRQ_MASK);
enable_irq(gmu->hfi_irq); enable_irq(gmu->hfi_irq);
/* Set the GPU to the highest power frequency */ /* Set the GPU to the current freq */
__a6xx_gmu_set_freq(gmu, gmu->nr_gpu_freqs - 1); __a6xx_gmu_set_freq(gmu, gmu->current_perf_index);
/* /*
* "enable" the GX power domain which won't actually do anything but it * "enable" the GX power domain which won't actually do anything but it
...@@ -1166,6 +1168,8 @@ static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu) ...@@ -1166,6 +1168,8 @@ static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu)
gmu->nr_gpu_freqs = a6xx_gmu_build_freq_table(&gpu->pdev->dev, gmu->nr_gpu_freqs = a6xx_gmu_build_freq_table(&gpu->pdev->dev,
gmu->gpu_freqs, ARRAY_SIZE(gmu->gpu_freqs)); gmu->gpu_freqs, ARRAY_SIZE(gmu->gpu_freqs));
gmu->current_perf_index = gmu->nr_gpu_freqs - 1;
/* Build the list of RPMh votes that we'll send to the GMU */ /* Build the list of RPMh votes that we'll send to the GMU */
return a6xx_gmu_rpmh_votes_init(gmu); return a6xx_gmu_rpmh_votes_init(gmu);
} }
......
...@@ -63,6 +63,9 @@ struct a6xx_gmu { ...@@ -63,6 +63,9 @@ struct a6xx_gmu {
struct clk_bulk_data *clocks; struct clk_bulk_data *clocks;
struct clk *core_clk; struct clk *core_clk;
/* current performance index set externally */
int current_perf_index;
int nr_gpu_freqs; int nr_gpu_freqs;
unsigned long gpu_freqs[16]; unsigned long gpu_freqs[16];
u32 gx_arc_votes[16]; u32 gx_arc_votes[16];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment