Board: Fix no sched override

This commit is contained in:
Lightos1
2026-02-20 19:12:51 +01:00
parent e1463dca05
commit 5a2ba5f785
2 changed files with 7 additions and 17 deletions

View File

@@ -290,12 +290,11 @@ void MiscGui::listUI()
ValueThresholds thresholdsDisabled(0, 0); ValueThresholds thresholdsDisabled(0, 0);
std::vector<NamedValue> noNamedValues = {}; std::vector<NamedValue> noNamedValues = {};
this->listElement->addItem(new tsl::elm::CategoryHeader("CPU Settings")); this->listElement->addItem(new tsl::elm::CategoryHeader("CPU Settings"));
addConfigToggle(HocClkConfigValue_OverwriteBoostMode, nullptr); addConfigToggle(HocClkConfigValue_OverwriteBoostMode, nullptr);
std::vector<NamedValue> gpuSchedValues = { std::vector<NamedValue> gpuSchedValues = {
NamedValue("Do not override", GpuSchedulingMode_DoNotOverride), NamedValue("Do not override", GpuSchedulingMode_DoNotOverride),
NamedValue("Enabled", GpuSchedulingMode_Enabled, "96.5% limit"), NamedValue("Enabled (Default)", GpuSchedulingMode_Enabled, "96.6% limit"),
NamedValue("Disabled", GpuSchedulingMode_Disabled, "99.7% limit"), NamedValue("Disabled", GpuSchedulingMode_Disabled, "99.7% limit"),
}; };

View File

@@ -457,7 +457,7 @@ SysClkProfile Board::GetProfile()
void Board::SetHz(SysClkModule module, std::uint32_t hz) void Board::SetHz(SysClkModule module, std::uint32_t hz)
{ {
Result rc = 0; Result rc = 0;
if(module == HorizonOCModule_Display && Board::GetConsoleType() != HorizonOCConsoleType_Hoag) { if(module == HorizonOCModule_Display && Board::GetConsoleType() != HorizonOCConsoleType_Hoag) {
DisplayRefresh_SetRate(hz); DisplayRefresh_SetRate(hz);
return; return;
} }
@@ -1167,16 +1167,7 @@ void Board::SetGpuSchedulingMode(GpuSchedulingMode mode, GpuSchedulingOverrideMe
u32 temp; u32 temp;
bool enabled = false; bool enabled = false;
switch(mode) { switch(mode) {
case GpuSchedulingMode_DoNotOverride: case GpuSchedulingMode_DoNotOverride: break;
if (method == GpuSchedulingOverrideMethod_Ini) {
const char* ini_path = "sdmc:/atmosphere/config/system_settings.ini";
const char* section = "am.gpu";
const char* key = "gpu_scheduling_enabled";
// Remove the key from the INI
ini_puts(section, key, NULL, ini_path);
}
return;
case GpuSchedulingMode_Disabled: case GpuSchedulingMode_Disabled:
if(method == GpuSchedulingOverrideMethod_NvService) if(method == GpuSchedulingOverrideMethod_NvService)
nvIoctl(fd2, NVSCHED_CTRL_DISABLE, &temp); nvIoctl(fd2, NVSCHED_CTRL_DISABLE, &temp);
@@ -1196,7 +1187,7 @@ void Board::SetGpuSchedulingMode(GpuSchedulingMode mode, GpuSchedulingOverrideMe
const char* ini_path = "sdmc:/atmosphere/config/system_settings.ini"; const char* ini_path = "sdmc:/atmosphere/config/system_settings.ini";
const char* section = "am.gpu"; const char* section = "am.gpu";
const char* key = "gpu_scheduling_enabled"; const char* key = "gpu_scheduling_enabled";
const char* value = enabled ? "u8!0x1" : "u8!0x0"; const char* value = enabled ? "u8!0x1" : "u8!0x0";
ini_puts(section, key, value, ini_path); ini_puts(section, key, value, ini_path);
@@ -1261,7 +1252,7 @@ void Board::SetCpuUvLevel(u32 levelLow, u32 levelHigh, u32 tbreakPoint) {
u32* tune0_ptr = (u32*)(cldvfs + CL_DVFS_TUNE0_0); u32* tune0_ptr = (u32*)(cldvfs + CL_DVFS_TUNE0_0);
u32* tune1_ptr = (u32*)(cldvfs + CL_DVFS_TUNE1_0); u32* tune1_ptr = (u32*)(cldvfs + CL_DVFS_TUNE1_0);
if(Board::GetSocType() == SysClkSocType_Mariko) { if(Board::GetSocType() == SysClkSocType_Mariko) {
if(Board::GetHz(SysClkModule_CPU) < tbreakPoint && (levelLow || levelHigh)) { if(Board::GetHz(SysClkModule_CPU) < tbreakPoint && (levelLow || levelHigh)) {
if(levelLow) { if(levelLow) {
*tune0_ptr = marikoCpuUvLow[levelLow-1].tune0_low; *tune0_ptr = marikoCpuUvLow[levelLow-1].tune0_low;
@@ -1287,7 +1278,7 @@ void Board::SetCpuUvLevel(u32 levelLow, u32 levelHigh, u32 tbreakPoint) {
*tune0_ptr = cachedMarikoUvHighTune0; // per console? *tune0_ptr = cachedMarikoUvHighTune0; // per console?
*tune1_ptr = 0xFFF7FF3F; *tune1_ptr = 0xFFF7FF3F;
return; return;
} }
} else { } else {
if(Board::GetHz(SysClkModule_CPU) < tbreakPoint || (!levelLow)) { // account for tbreak if(Board::GetHz(SysClkModule_CPU) < tbreakPoint || (!levelLow)) { // account for tbreak
*tune0_ptr = cachedEristaUvLowTune0; // I think each erista has a different tune0/tune1? *tune0_ptr = cachedEristaUvLowTune0; // I think each erista has a different tune0/tune1?
@@ -1326,5 +1317,5 @@ u32 Board::CalculateTbreak(u32 table) {
return 1581000000; return 1581000000;
} }
} }
} }