Fix dvfs yet again, todo make this not shit

This commit is contained in:
Lightos1
2026-03-16 20:01:52 +01:00
parent 2215b17a54
commit bb44d0907d

View File

@@ -675,22 +675,18 @@ void ClockManager::DVFSBeforeSet(u32 targetHz) {
void ClockManager::DVFSAfterSet(u32 targetHz) { void ClockManager::DVFSAfterSet(u32 targetHz) {
s32 dvfsOffset = this->config->GetConfigValue(HorizonOCConfigValue_DVFSOffset); s32 dvfsOffset = this->config->GetConfigValue(HorizonOCConfigValue_DVFSOffset);
dvfsOffset = std::max(dvfsOffset, -50); dvfsOffset = std::max(dvfsOffset, -80);
u32 vmin = Board::GetMinimumGpuVoltage(targetHz / 1000000) + dvfsOffset; u32 vmin = Board::GetMinimumGpuVoltage(targetHz / 1000000);
Board::PcvHijackDvfs(vmin);
targetHz = this->context->overrideFreqs[SysClkModule_GPU]; if (vmin) {
if (!targetHz) vmin += dvfsOffset;
{
targetHz = this->config->GetAutoClockHz(this->context->applicationId, SysClkModule_GPU, this->context->profile, false);
if(!targetHz)
targetHz = this->config->GetAutoClockHz(GLOBAL_PROFILE_ID, SysClkModule_GPU, this->context->profile, false);
} }
u32 maxHz = this->GetMaxAllowedHz(SysClkModule_GPU, this->context->profile); u32 maxHz = this->GetMaxAllowedHz(SysClkModule_GPU, this->context->profile);
u32 nearestHz = this->GetNearestHz(SysClkModule_GPU, targetHz, maxHz); u32 nearestHz = this->GetNearestHz(SysClkModule_GPU, targetHz, maxHz);
Board::PcvHijackDvfs(vmin);
if(targetHz) { if (targetHz) {
Board::SetHz(SysClkModule_GPU, ~0); Board::SetHz(SysClkModule_GPU, ~0);
Board::SetHz(SysClkModule_GPU, nearestHz); Board::SetHz(SysClkModule_GPU, nearestHz);
} else { } else {