hocclk: fix edge case with middle freqs

This commit is contained in:
souldbminersmwc
2026-05-23 16:40:04 -04:00
parent 8411a14b26
commit 2d0a2c4f6d
3 changed files with 17 additions and 1 deletions

View File

@@ -185,7 +185,23 @@ namespace clockManager {
if (module == HocClkModule_GPU && board::GetSocType() == HocClkSocType_Mariko) {
constexpr u32 kStep = 38400000;
constexpr u32 kPcvStep = 76800000;
constexpr u32 kMax = 1228800000;
u32 kMax = 0;
for (u32 i = 0; i < count; i++) {
for (u32 j = 0; j < count; j++) {
if (freqs[j] == freqs[i] + kStep) {
kMax = freqs[j];
break;
}
}
}
if (kMax == 0) {
for (u32 i = 0; i < count; i++) {
if (freqs[i] > kMax)
kMax = freqs[i];
}
}
for (u32 f = kPcvStep; f <= kMax && gFreqTable[module].count < HOCCLK_FREQ_LIST_MAX; f += kStep) {
if (f % kPcvStep != 0) {