[Freedreno] [PATCH] drm/msm/adreno/a6xx: Fix HFI clock votes
Jordan Crouse
jcrouse at codeaurora.org
Fri Aug 3 14:39:08 UTC 2018
Fix two issues with the GPU clock vote on HFI. First, pick the
largest non-zero arc value for the MX rail instead of just
the maximum index (which is likely zero on sdm845). Secondly
fix a typo that was blowing away the correct vote value in the
GMU table.
Signed-off-by: Jordan Crouse <jcrouse at codeaurora.org>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 7 ++++---
drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 4 ++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 9ecd7afe6321..c49ca275a3b3 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -904,14 +904,15 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,
/*
* Look for a level in in the secondary list that matches. If
- * nothing fits, use the maximum
+ * nothing fits, use the maximum non zero vote
*/
- sindex = sec_count - 1;
- for (j = 0; j < sec_count - 1; j++) {
+ for (j = 0; j < sec_count; j++) {
if (sec[j] >= level) {
sindex = j;
break;
+ } else if (sec[j]) {
+ sindex = j;
}
}
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
index 221eaafc8b5f..f19ef4cb6ea4 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
@@ -255,12 +255,12 @@ static int a6xx_hfi_send_perf_table(struct a6xx_gmu *gmu)
for (i = 0; i < gmu->nr_gpu_freqs; i++) {
msg.gx_votes[i].vote = gmu->gx_arc_votes[i];
- msg.gx_votes[i].vote = gmu->gpu_freqs[i] / 1000;
+ msg.gx_votes[i].freq = gmu->gpu_freqs[i] / 1000;
}
for (i = 0; i < gmu->nr_gmu_freqs; i++) {
msg.cx_votes[i].vote = gmu->cx_arc_votes[i];
- msg.cx_votes[i].vote = gmu->gmu_freqs[i] / 1000;
+ msg.cx_votes[i].freq = gmu->gmu_freqs[i] / 1000;
}
return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_PERF_TABLE, &msg, sizeof(msg),
--
2.18.0
More information about the Freedreno
mailing list