remove display refresh rate on hoag

This commit is contained in:
souldbminersmwc
2026-03-15 10:20:46 -04:00
parent a943d14807
commit 1e4dada672
6 changed files with 93 additions and 50 deletions

View File

@@ -360,8 +360,8 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
NamedValue("115 Hz", 115),
NamedValue("120 Hz", 120)
};
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 1, " Hz", 1, 0, ValueThresholds(), dockedFreqsStandard);
if(configList.values[HorizonOCConfigValue_OverwriteRefreshRate] && !IsHoag())
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 1, " Hz", 1, 0, ValueThresholds(), dockedFreqsStandard);
}
}
}
@@ -378,8 +378,15 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
NamedValue("VRR", GovernorState_Enabled_Vrr),
};
std::vector<NamedValue> governorSettingsH = {
NamedValue("Do Not Override", GovernorState_DoNotOverride),
NamedValue("Disabled", GovernorState_Disabled),
NamedValue("CPU + GPU", GovernorState_Enabled_CpuGpu),
NamedValue("CPU", GovernorState_Enabled_Cpu),
NamedValue("GPU", GovernorState_Enabled_Gpu),
};
this->addModuleListItemValue(profile, HorizonOCModule_Governor, "Governor", 0, 0, 1, "", 1, 0, ValueThresholds(), governorSettingsE, false);
this->addModuleListItemValue(profile, HorizonOCModule_Governor, "Governor", 0, 0, 1, "", 1, 0, ValueThresholds(), IsHoag() ? governorSettingsH : governorSettingsE, false);
}
void AppProfileGui::listUI()

View File

@@ -302,6 +302,14 @@ std::vector<NamedValue> governorSettingsE = {
NamedValue("VRR", GovernorState_Enabled_Vrr),
};
std::vector<NamedValue> governorSettingsH = {
NamedValue("Do Not Override", GovernorState_DoNotOverride),
NamedValue("Disabled", GovernorState_Disabled),
NamedValue("CPU + GPU", GovernorState_Enabled_CpuGpu),
NamedValue("CPU", GovernorState_Enabled_Cpu),
NamedValue("GPU", GovernorState_Enabled_Gpu),
};
void GlobalOverrideGui::listUI()
{
Result rc = sysclkIpcGetConfigValues(&configList); // idk why this is needed, probably some refreshing issue
@@ -317,11 +325,11 @@ void GlobalOverrideGui::listUI()
this->addModuleListItem(SysClkModule_MEM);
#if IS_MINIMAL == 0
ValueThresholds lcdThresholds(60, 65);
if(configList.values[HorizonOCConfigValue_OverwriteRefreshRate])
if(configList.values[HorizonOCConfigValue_OverwriteRefreshRate] && !IsHoag())
this->addModuleListItemValue(HorizonOCModule_Display, "Display", IsAula() ? 45 : 40, configList.values[HorizonOCConfigValue_EnableUnsafeDisplayFreqs] ? IsAula() ? 65 : 72 : 60, 1, " Hz", 1, 0, lcdThresholds);
#endif
this->addModuleListItemValue(HorizonOCModule_Governor, "Governor", 0, 0, 1, "", 1, 0, ValueThresholds(), governorSettingsE, false);
this->addModuleListItemValue(HorizonOCModule_Governor, "Governor", 0, 0, 1, "", 1, 0, ValueThresholds(), IsHoag() ? governorSettingsH : governorSettingsE, false);
}
void GlobalOverrideGui::refresh()

View File

@@ -445,17 +445,18 @@ void MiscGui::listUI()
});
gpuSubmenu->setValue(R_ARROW);
this->listElement->addItem(gpuSubmenu);
tsl::elm::ListItem* displaySubMenu = new tsl::elm::ListItem("Display Settings");
displaySubMenu->setClickListener([](u64 keys) {
if (keys & HidNpadButton_A) {
tsl::changeTo<DisplaySubMenuGui>();
return true;
}
return false;
});
displaySubMenu->setValue(R_ARROW);
this->listElement->addItem(displaySubMenu);
if(!IsHoag()) {
tsl::elm::ListItem* displaySubMenu = new tsl::elm::ListItem("Display Settings");
displaySubMenu->setClickListener([](u64 keys) {
if (keys & HidNpadButton_A) {
tsl::changeTo<DisplaySubMenuGui>();
return true;
}
return false;
});
displaySubMenu->setValue(R_ARROW);
this->listElement->addItem(displaySubMenu);
}
#if IS_MINIMAL == 0
// std::vector<NamedValue> chargerCurrents = {

View File

@@ -276,23 +276,27 @@ void Board::Initialize()
// threadStart(&cpuCore3Thread);
threadStart(&miscThread);
batteryInfoInitialize();
FetchHardwareInfos();
if (hosversionAtLeast(6,0,0) && R_SUCCEEDED(pwmInitialize())) {
pwmCheck = pwmOpenSession2(&g_ICon, 0x3D000001);
}
u64 clkVirtAddr, dsiVirtAddr, outsize;
rc = svcQueryMemoryMapping(&clkVirtAddr, &outsize, 0x60006000, 0x1000);
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (clk)");
rc = svcQueryMemoryMapping(&dsiVirtAddr, &outsize, 0x54300000, 0x40000);
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (dsi)");
DisplayRefreshConfig cfg = {.clkVirtAddr = clkVirtAddr, .dsiVirtAddr = dsiVirtAddr};
if(!IsHoag()) {
u64 clkVirtAddr, dsiVirtAddr, outsize;
rc = svcQueryMemoryMapping(&clkVirtAddr, &outsize, 0x60006000, 0x1000);
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (clk)");
rc = svcQueryMemoryMapping(&dsiVirtAddr, &outsize, 0x54300000, 0x40000);
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (dsi)");
DisplayRefresh_Initialize(&cfg);
DisplayRefreshConfig cfg = {.clkVirtAddr = clkVirtAddr, .dsiVirtAddr = dsiVirtAddr};
DisplayRefresh_Initialize(&cfg);
}
FetchHardwareInfos();
rc = svcQueryMemoryMapping(&cldvfs, &cldvfs_temp, CLDVFS_REGION_BASE, CLDVFS_REGION_SIZE);
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (cldvfs)");
if(Board::GetSocType() == SysClkSocType_Erista) {
cachedEristaUvLowTune0 = *(u32*)(cldvfs + CL_DVFS_TUNE0_0);
cachedEristaUvLowTune1 = *(u32*)(cldvfs + CL_DVFS_TUNE1_0);
@@ -301,6 +305,8 @@ void Board::Initialize()
cachedMarikoUvHighTune0 = *(u32*)(cldvfs + CL_DVFS_TUNE0_0);
Board::ResetToStockCpu();
}
}
void Board::fuseReadSpeedos() {
@@ -420,7 +426,8 @@ void Board::Exit()
batteryInfoExit();
pmdmntExit();
nvExit();
DisplayRefresh_Shutdown();
if(!IsHoag())
DisplayRefresh_Shutdown();
}
SysClkProfile Board::GetProfile()
@@ -455,7 +462,8 @@ void Board::SetHz(SysClkModule module, std::uint32_t hz)
{
Result rc = 0;
if(module == HorizonOCModule_Display) {
DisplayRefresh_SetRate(hz);
if(!IsHoag())
DisplayRefresh_SetRate(hz);
return;
}
if(module > SysClkModule_MEM)
@@ -493,7 +501,10 @@ std::uint32_t Board::GetHz(SysClkModule module)
std::uint32_t hz = 0;
if(module == HorizonOCModule_Display) {
DisplayRefresh_GetRate(&hz, false);
if(!IsHoag())
DisplayRefresh_GetRate(&hz, false);
else
hz = 60;
return hz;
}
@@ -530,7 +541,10 @@ std::uint32_t Board::GetRealHz(SysClkModule module)
case SysClkModule_MEM:
return t210ClkMemFreq();
case HorizonOCModule_Display:
DisplayRefresh_GetRate(&hz, false);
if(!IsHoag())
DisplayRefresh_GetRate(&hz, false);
else
hz = 60;
return hz;
default:
ASSERT_ENUM_VALID(SysClkModule, module);
@@ -725,7 +739,8 @@ void Board::ResetToStockGpu()
}
void Board::ResetToStockDisplay() {
DisplayRefresh_SetRate(60);
if(!IsHoag())
DisplayRefresh_SetRate(60);
}
u8 Board::GetHighestDockedDisplayRate() {
@@ -1306,4 +1321,8 @@ u32 Board::CalculateTbreak(u32 table) {
}
}
}
bool Board::IsHoag() {
return Board::GetConsoleType() == HorizonOCConsoleType_Hoag;
}

View File

@@ -68,6 +68,7 @@ class Board
static void SetDisplayRefreshDockedState(bool docked);
static void SetCpuUvLevel(u32 levelLow, u32 levelHigh, u32 tbreakPoint);
static u32 CalculateTbreak(u32 table);
static bool IsHoag();
protected:
static void FetchHardwareInfos();
static PcvModule GetPcvModule(SysClkModule sysclkModule);

View File

@@ -495,6 +495,11 @@ void ClockManager::VRRThread(void* arg) {
continue;
}
if(Board::IsHoag()) { // don't do anything on lite
svcSleepThread(~0ULL);
continue;
}
std::scoped_lock lock{mgr->contextMutex};
u8 fps;
@@ -506,6 +511,7 @@ void ClockManager::VRRThread(void* arg) {
continue;
}
if(fps == 254) {
svcSleepThread(POLL_NS);
continue;
@@ -745,7 +751,7 @@ void ClockManager::HandleFreqReset(SysClkModule module, bool isBoost) {
DVFSReset();
break;
case HorizonOCModule_Display:
if(this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
if(this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate) && !Board::IsHoag()) {
Board::ResetToStockDisplay();
}
break;
@@ -791,16 +797,17 @@ void ClockManager::SetClocks(bool isBoost) {
bool noCPU = isCpuGovernorEnabled;
bool noGPU = isGpuGovernorEnabled;
bool noDisp = isVRREnabled;
if(!Board::IsHoag()) {
bool noDisp = isVRREnabled;
if(noDisp && module == HorizonOCModule_Display)
continue;
if(noDisp && module == HorizonOCModule_Display)
continue;
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
if(targetHz)
Board::SetHz(HorizonOCModule_Display, targetHz);
else
Board::ResetToStockDisplay();
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
if(targetHz)
Board::SetHz(HorizonOCModule_Display, targetHz);
else
Board::ResetToStockDisplay();
}
}
// Skip GPU and CPU if governors handle them
@@ -1005,20 +1012,20 @@ bool ClockManager::RefreshContext()
}
// this->context->maxDisplayFreq = Board::GetHighestDockedDisplayRate();
if(!Board::IsHoag()) {
u32 targetHz = this->context->overrideFreqs[HorizonOCModule_Display];
if (!targetHz)
{
targetHz = this->config->GetAutoClockHz(this->context->applicationId, HorizonOCModule_Display, this->context->profile, true);
if(!targetHz)
targetHz = this->config->GetAutoClockHz(GLOBAL_PROFILE_ID, HorizonOCModule_Display, this->context->profile, true);
}
u32 targetHz = this->context->overrideFreqs[HorizonOCModule_Display];
if (!targetHz)
{
targetHz = this->config->GetAutoClockHz(this->context->applicationId, HorizonOCModule_Display, this->context->profile, true);
if(!targetHz)
targetHz = this->config->GetAutoClockHz(GLOBAL_PROFILE_ID, HorizonOCModule_Display, this->context->profile, true);
}
if(targetHz && this->context->realFreqs[HorizonOCModule_Display] > targetHz && this->context->profile != SysClkProfile_Docked)
this->context->realFreqs[HorizonOCModule_Display] = targetHz; // clean up display real freqs, should probably be moved to the real freqs loop?
if(targetHz && this->context->realFreqs[HorizonOCModule_Display] > targetHz && this->context->profile != SysClkProfile_Docked)
this->context->realFreqs[HorizonOCModule_Display] = targetHz; // clean up display real freqs, should probably be moved to the real freqs loop?
if(Board::GetConsoleType() != HorizonOCConsoleType_Hoag)
Board::SetDisplayRefreshDockedState(this->context->profile == SysClkProfile_Docked);
}
if(this->context->isSaltyNXInstalled)
this->context->fps = saltyNXIntegration->GetFPS();
else