Instead of voting ACV for all bw corners for A8x GPU, restrict it to BW
votes above the perfmode_bw threshold, similar to the A7x GPUs.

Fixes: 288a93200892 ("drm/msm/adreno: Introduce A8x GPU Support")
Signed-off-by: Akhil P Oommen <[email protected]>
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c   | 8 ++++++--
 drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 +++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c 
b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 6d49c51df1a2..baf77a620572 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -1656,8 +1656,12 @@ static int a6xx_gmu_rpmh_bw_votes_init(struct adreno_gpu 
*adreno_gpu,
                        if (bcm->fixed) {
                                u32 perfmode = 0;
 
-                               /* GMU on A6xx votes perfmode on all valid 
bandwidth */
-                               if (!adreno_is_a7xx(adreno_gpu) ||
+                               /*
+                                * GMU on A6xx votes perfmode on all valid
+                                * bandwidth. A7xx and A8xx only vote perfmode
+                                * above the perfmode_bw threshold.
+                                */
+                               if (adreno_is_a6xx(adreno_gpu) ||
                                    (bcm->perfmode_bw && bw >= 
bcm->perfmode_bw))
                                        perfmode = bcm->perfmode;
 
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index 114a40f79ef3..bd5c440f1753 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -580,6 +580,11 @@ static inline int adreno_is_a750_family(struct adreno_gpu 
*gpu)
        return gpu->info->family == ADRENO_7XX_GEN3;
 }
 
+static inline int adreno_is_a6xx(struct adreno_gpu *gpu)
+{
+       return (gpu->info->family >= ADRENO_6XX_GEN1) && (gpu->info->family < 
ADRENO_7XX_GEN1);
+}
+
 static inline int adreno_is_a7xx(struct adreno_gpu *gpu)
 {
        /* Update with non-fake (i.e. non-A702) Gen 7 GPUs */

-- 
2.55.0

Reply via email to