Skip to contentSkip to conversation

drm/msm/adreno/a6xx: Fix HFI clock votes

PATCH New Jordan Crouse 1 participant 1 message Aug 3, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/adreno/a6xx: Fix HFI clock votes

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.

---
 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(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +4 -3
index 9ecd7afe6321..c49ca275a3b3 100644
@@ -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;
 			}
 		}
 
drivers/gpu/drm/msm/adreno/a6xx_hfi.c +2 -2
index 221eaafc8b5f..f19ef4cb6ea4 100644
@@ -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),
Signature · 6 lines
2.18.0

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno