remove display refresh rate on hoag
This commit is contained in:
@@ -360,8 +360,8 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
|
|||||||
NamedValue("115 Hz", 115),
|
NamedValue("115 Hz", 115),
|
||||||
NamedValue("120 Hz", 120)
|
NamedValue("120 Hz", 120)
|
||||||
};
|
};
|
||||||
|
if(configList.values[HorizonOCConfigValue_OverwriteRefreshRate] && !IsHoag())
|
||||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 1, " Hz", 1, 0, ValueThresholds(), dockedFreqsStandard);
|
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),
|
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()
|
void AppProfileGui::listUI()
|
||||||
|
|||||||
@@ -302,6 +302,14 @@ std::vector<NamedValue> governorSettingsE = {
|
|||||||
NamedValue("VRR", GovernorState_Enabled_Vrr),
|
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()
|
void GlobalOverrideGui::listUI()
|
||||||
{
|
{
|
||||||
Result rc = sysclkIpcGetConfigValues(&configList); // idk why this is needed, probably some refreshing issue
|
Result rc = sysclkIpcGetConfigValues(&configList); // idk why this is needed, probably some refreshing issue
|
||||||
@@ -317,11 +325,11 @@ void GlobalOverrideGui::listUI()
|
|||||||
this->addModuleListItem(SysClkModule_MEM);
|
this->addModuleListItem(SysClkModule_MEM);
|
||||||
#if IS_MINIMAL == 0
|
#if IS_MINIMAL == 0
|
||||||
ValueThresholds lcdThresholds(60, 65);
|
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);
|
this->addModuleListItemValue(HorizonOCModule_Display, "Display", IsAula() ? 45 : 40, configList.values[HorizonOCConfigValue_EnableUnsafeDisplayFreqs] ? IsAula() ? 65 : 72 : 60, 1, " Hz", 1, 0, lcdThresholds);
|
||||||
#endif
|
#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()
|
void GlobalOverrideGui::refresh()
|
||||||
|
|||||||
@@ -445,17 +445,18 @@ void MiscGui::listUI()
|
|||||||
});
|
});
|
||||||
gpuSubmenu->setValue(R_ARROW);
|
gpuSubmenu->setValue(R_ARROW);
|
||||||
this->listElement->addItem(gpuSubmenu);
|
this->listElement->addItem(gpuSubmenu);
|
||||||
|
if(!IsHoag()) {
|
||||||
tsl::elm::ListItem* displaySubMenu = new tsl::elm::ListItem("Display Settings");
|
tsl::elm::ListItem* displaySubMenu = new tsl::elm::ListItem("Display Settings");
|
||||||
displaySubMenu->setClickListener([](u64 keys) {
|
displaySubMenu->setClickListener([](u64 keys) {
|
||||||
if (keys & HidNpadButton_A) {
|
if (keys & HidNpadButton_A) {
|
||||||
tsl::changeTo<DisplaySubMenuGui>();
|
tsl::changeTo<DisplaySubMenuGui>();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
displaySubMenu->setValue(R_ARROW);
|
displaySubMenu->setValue(R_ARROW);
|
||||||
this->listElement->addItem(displaySubMenu);
|
this->listElement->addItem(displaySubMenu);
|
||||||
|
}
|
||||||
|
|
||||||
#if IS_MINIMAL == 0
|
#if IS_MINIMAL == 0
|
||||||
// std::vector<NamedValue> chargerCurrents = {
|
// std::vector<NamedValue> chargerCurrents = {
|
||||||
|
|||||||
@@ -276,23 +276,27 @@ void Board::Initialize()
|
|||||||
// threadStart(&cpuCore3Thread);
|
// threadStart(&cpuCore3Thread);
|
||||||
threadStart(&miscThread);
|
threadStart(&miscThread);
|
||||||
batteryInfoInitialize();
|
batteryInfoInitialize();
|
||||||
|
FetchHardwareInfos();
|
||||||
|
|
||||||
if (hosversionAtLeast(6,0,0) && R_SUCCEEDED(pwmInitialize())) {
|
if (hosversionAtLeast(6,0,0) && R_SUCCEEDED(pwmInitialize())) {
|
||||||
pwmCheck = pwmOpenSession2(&g_ICon, 0x3D000001);
|
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);
|
rc = svcQueryMemoryMapping(&cldvfs, &cldvfs_temp, CLDVFS_REGION_BASE, CLDVFS_REGION_SIZE);
|
||||||
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (cldvfs)");
|
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (cldvfs)");
|
||||||
|
|
||||||
if(Board::GetSocType() == SysClkSocType_Erista) {
|
if(Board::GetSocType() == SysClkSocType_Erista) {
|
||||||
cachedEristaUvLowTune0 = *(u32*)(cldvfs + CL_DVFS_TUNE0_0);
|
cachedEristaUvLowTune0 = *(u32*)(cldvfs + CL_DVFS_TUNE0_0);
|
||||||
cachedEristaUvLowTune1 = *(u32*)(cldvfs + CL_DVFS_TUNE1_0);
|
cachedEristaUvLowTune1 = *(u32*)(cldvfs + CL_DVFS_TUNE1_0);
|
||||||
@@ -301,6 +305,8 @@ void Board::Initialize()
|
|||||||
cachedMarikoUvHighTune0 = *(u32*)(cldvfs + CL_DVFS_TUNE0_0);
|
cachedMarikoUvHighTune0 = *(u32*)(cldvfs + CL_DVFS_TUNE0_0);
|
||||||
Board::ResetToStockCpu();
|
Board::ResetToStockCpu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Board::fuseReadSpeedos() {
|
void Board::fuseReadSpeedos() {
|
||||||
@@ -420,7 +426,8 @@ void Board::Exit()
|
|||||||
batteryInfoExit();
|
batteryInfoExit();
|
||||||
pmdmntExit();
|
pmdmntExit();
|
||||||
nvExit();
|
nvExit();
|
||||||
DisplayRefresh_Shutdown();
|
if(!IsHoag())
|
||||||
|
DisplayRefresh_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
SysClkProfile Board::GetProfile()
|
SysClkProfile Board::GetProfile()
|
||||||
@@ -455,7 +462,8 @@ void Board::SetHz(SysClkModule module, std::uint32_t hz)
|
|||||||
{
|
{
|
||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
if(module == HorizonOCModule_Display) {
|
if(module == HorizonOCModule_Display) {
|
||||||
DisplayRefresh_SetRate(hz);
|
if(!IsHoag())
|
||||||
|
DisplayRefresh_SetRate(hz);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(module > SysClkModule_MEM)
|
if(module > SysClkModule_MEM)
|
||||||
@@ -493,7 +501,10 @@ std::uint32_t Board::GetHz(SysClkModule module)
|
|||||||
std::uint32_t hz = 0;
|
std::uint32_t hz = 0;
|
||||||
|
|
||||||
if(module == HorizonOCModule_Display) {
|
if(module == HorizonOCModule_Display) {
|
||||||
DisplayRefresh_GetRate(&hz, false);
|
if(!IsHoag())
|
||||||
|
DisplayRefresh_GetRate(&hz, false);
|
||||||
|
else
|
||||||
|
hz = 60;
|
||||||
return hz;
|
return hz;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,7 +541,10 @@ std::uint32_t Board::GetRealHz(SysClkModule module)
|
|||||||
case SysClkModule_MEM:
|
case SysClkModule_MEM:
|
||||||
return t210ClkMemFreq();
|
return t210ClkMemFreq();
|
||||||
case HorizonOCModule_Display:
|
case HorizonOCModule_Display:
|
||||||
DisplayRefresh_GetRate(&hz, false);
|
if(!IsHoag())
|
||||||
|
DisplayRefresh_GetRate(&hz, false);
|
||||||
|
else
|
||||||
|
hz = 60;
|
||||||
return hz;
|
return hz;
|
||||||
default:
|
default:
|
||||||
ASSERT_ENUM_VALID(SysClkModule, module);
|
ASSERT_ENUM_VALID(SysClkModule, module);
|
||||||
@@ -725,7 +739,8 @@ void Board::ResetToStockGpu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Board::ResetToStockDisplay() {
|
void Board::ResetToStockDisplay() {
|
||||||
DisplayRefresh_SetRate(60);
|
if(!IsHoag())
|
||||||
|
DisplayRefresh_SetRate(60);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 Board::GetHighestDockedDisplayRate() {
|
u8 Board::GetHighestDockedDisplayRate() {
|
||||||
@@ -1306,4 +1321,8 @@ u32 Board::CalculateTbreak(u32 table) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Board::IsHoag() {
|
||||||
|
return Board::GetConsoleType() == HorizonOCConsoleType_Hoag;
|
||||||
}
|
}
|
||||||
@@ -68,6 +68,7 @@ class Board
|
|||||||
static void SetDisplayRefreshDockedState(bool docked);
|
static void SetDisplayRefreshDockedState(bool docked);
|
||||||
static void SetCpuUvLevel(u32 levelLow, u32 levelHigh, u32 tbreakPoint);
|
static void SetCpuUvLevel(u32 levelLow, u32 levelHigh, u32 tbreakPoint);
|
||||||
static u32 CalculateTbreak(u32 table);
|
static u32 CalculateTbreak(u32 table);
|
||||||
|
static bool IsHoag();
|
||||||
protected:
|
protected:
|
||||||
static void FetchHardwareInfos();
|
static void FetchHardwareInfos();
|
||||||
static PcvModule GetPcvModule(SysClkModule sysclkModule);
|
static PcvModule GetPcvModule(SysClkModule sysclkModule);
|
||||||
|
|||||||
@@ -495,6 +495,11 @@ void ClockManager::VRRThread(void* arg) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Board::IsHoag()) { // don't do anything on lite
|
||||||
|
svcSleepThread(~0ULL);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
std::scoped_lock lock{mgr->contextMutex};
|
std::scoped_lock lock{mgr->contextMutex};
|
||||||
|
|
||||||
u8 fps;
|
u8 fps;
|
||||||
@@ -506,6 +511,7 @@ void ClockManager::VRRThread(void* arg) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(fps == 254) {
|
if(fps == 254) {
|
||||||
svcSleepThread(POLL_NS);
|
svcSleepThread(POLL_NS);
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +751,7 @@ void ClockManager::HandleFreqReset(SysClkModule module, bool isBoost) {
|
|||||||
DVFSReset();
|
DVFSReset();
|
||||||
break;
|
break;
|
||||||
case HorizonOCModule_Display:
|
case HorizonOCModule_Display:
|
||||||
if(this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
|
if(this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate) && !Board::IsHoag()) {
|
||||||
Board::ResetToStockDisplay();
|
Board::ResetToStockDisplay();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -791,16 +797,17 @@ void ClockManager::SetClocks(bool isBoost) {
|
|||||||
|
|
||||||
bool noCPU = isCpuGovernorEnabled;
|
bool noCPU = isCpuGovernorEnabled;
|
||||||
bool noGPU = isGpuGovernorEnabled;
|
bool noGPU = isGpuGovernorEnabled;
|
||||||
bool noDisp = isVRREnabled;
|
if(!Board::IsHoag()) {
|
||||||
|
bool noDisp = isVRREnabled;
|
||||||
|
if(noDisp && module == HorizonOCModule_Display)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(noDisp && module == HorizonOCModule_Display)
|
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
|
||||||
continue;
|
if(targetHz)
|
||||||
|
Board::SetHz(HorizonOCModule_Display, targetHz);
|
||||||
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
|
else
|
||||||
if(targetHz)
|
Board::ResetToStockDisplay();
|
||||||
Board::SetHz(HorizonOCModule_Display, targetHz);
|
}
|
||||||
else
|
|
||||||
Board::ResetToStockDisplay();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip GPU and CPU if governors handle them
|
// Skip GPU and CPU if governors handle them
|
||||||
@@ -1005,20 +1012,20 @@ bool ClockManager::RefreshContext()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this->context->maxDisplayFreq = Board::GetHighestDockedDisplayRate();
|
// 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 && this->context->realFreqs[HorizonOCModule_Display] > targetHz && this->context->profile != SysClkProfile_Docked)
|
||||||
if (!targetHz)
|
this->context->realFreqs[HorizonOCModule_Display] = targetHz; // clean up display real freqs, should probably be moved to the real freqs loop?
|
||||||
{
|
|
||||||
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(Board::GetConsoleType() != HorizonOCConsoleType_Hoag)
|
|
||||||
Board::SetDisplayRefreshDockedState(this->context->profile == SysClkProfile_Docked);
|
Board::SetDisplayRefreshDockedState(this->context->profile == SysClkProfile_Docked);
|
||||||
|
}
|
||||||
if(this->context->isSaltyNXInstalled)
|
if(this->context->isSaltyNXInstalled)
|
||||||
this->context->fps = saltyNXIntegration->GetFPS();
|
this->context->fps = saltyNXIntegration->GetFPS();
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user