From e48cab36b73c4dba254f39b230b45ea07772a03a Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Wed, 27 May 2026 16:21:56 -0400 Subject: [PATCH] hocclk: remove handheld TDP --- Source/hoc-clk/common/include/hocclk/config.h | 22 ---------------- .../src/ui/gui/config_info_strings.cpp | 13 ---------- .../hoc-clk/overlay/src/ui/gui/misc_gui.cpp | 26 ------------------- Source/hoc-clk/sysmodule/src/file/config.cpp | 4 +++ Source/hoc-clk/sysmodule/src/file/config.hpp | 3 ++- Source/hoc-clk/sysmodule/src/file/kip.cpp | 10 +++++-- .../sysmodule/src/mgr/clock_manager.cpp | 14 ---------- 7 files changed, 14 insertions(+), 78 deletions(-) diff --git a/Source/hoc-clk/common/include/hocclk/config.h b/Source/hoc-clk/common/include/hocclk/config.h index 6f93d780..98993be6 100644 --- a/Source/hoc-clk/common/include/hocclk/config.h +++ b/Source/hoc-clk/common/include/hocclk/config.h @@ -46,11 +46,6 @@ typedef enum { HocClkConfigValue_ThermalThrottle, HocClkConfigValue_ThermalThrottleThreshold, - HocClkConfigValue_HandheldTDP, - HocClkConfigValue_HandheldTDPLimit, - - HocClkConfigValue_LiteTDPLimit, - HocClkConfigValue_BatteryChargeCurrent, HocClkConfigValue_OverwriteRefreshRate, @@ -235,15 +230,6 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr case HocClkConfigValue_ThermalThrottleThreshold: return pretty ? "Thermal Throttle Threshold" : "thermal_throttle_threshold"; - case HocClkConfigValue_HandheldTDP: - return pretty ? "Handheld TDP" : "handheld_tdp"; - - case HocClkConfigValue_HandheldTDPLimit: - return pretty ? "Handheld TDP Limit" : "tdp_limit"; - - case HocClkConfigValue_LiteTDPLimit: - return pretty ? "Handheld TDP Limit" : "tdp_limit_l"; - case HocClkConfigValue_BatteryChargeCurrent: return pretty ? "Battery Charge Current" : "bat_charge_current"; @@ -504,16 +490,11 @@ static inline uint64_t hocclkDefaultConfigValue(HocClkConfigValue val) return 1963ULL; case HocClkConfigValue_ThermalThrottle: - case HocClkConfigValue_HandheldTDP: case HocClkConfigValue_IsFirstLoad: case HocClkConfigValue_DVFSMode: return 1ULL; case HocClkConfigValue_ThermalThrottleThreshold: return 70ULL; - case HocClkConfigValue_HandheldTDPLimit: - return 9600ULL; // 8600mW will trigger on erista stock, so raise it a bit - case HocClkConfigValue_LiteTDPLimit: - return 6400ULL; // 0.5C case HocClkConfigValue_CpuGovernorMinimumFreq: return 612000000ULL; // 612MHz case HocClkConfigValue_MaxDisplayClockH: @@ -534,8 +515,6 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in case HocClkConfigValue_EristaMaxCpuClock: case HocClkConfigValue_MarikoMaxCpuClock: case HocClkConfigValue_ThermalThrottleThreshold: - case HocClkConfigValue_HandheldTDPLimit: - case HocClkConfigValue_LiteTDPLimit: case HocClkConfigValue_PollingIntervalMs: case HocClkConfigValue_MaxDisplayClockH: return input > 0; @@ -547,7 +526,6 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in case HocClkConfigValue_UncappedClocks: case HocClkConfigValue_OverwriteBoostMode: case HocClkConfigValue_ThermalThrottle: - case HocClkConfigValue_HandheldTDP: case HocClkConfigValue_OverwriteRefreshRate: case HocClkConfigValue_IsFirstLoad: case HocClkConfigValue_EnableExperimentalSettings: diff --git a/Source/hoc-clk/overlay/src/ui/gui/config_info_strings.cpp b/Source/hoc-clk/overlay/src/ui/gui/config_info_strings.cpp index 6409eabb..571c50e9 100644 --- a/Source/hoc-clk/overlay/src/ui/gui/config_info_strings.cpp +++ b/Source/hoc-clk/overlay/src/ui/gui/config_info_strings.cpp @@ -170,19 +170,6 @@ std::vector ConfigInfoStrings(HocClkConfigValue val, bool isMariko, "Default: ON", }; - case HocClkConfigValue_HandheldTDP: - return { - "If enabled, Resets to stock clocks when power consumption is above the threshold in handheld mode", - "Default: ON", - }; - - case HocClkConfigValue_HandheldTDPLimit: - case HocClkConfigValue_LiteTDPLimit: - return { - "The power consumption threshold (in mW) for resetting to stock clocks in handheld mode when Handheld TDP is enabled.", - isHoag ? "Default: 6400mW" : "Default: 9600mW" - }; - case HocClkConfigValue_ThermalThrottleThreshold: return { "The temperature threshold (in °C) for resetting to stock clocks when Thermal Throttle is enabled.", diff --git a/Source/hoc-clk/overlay/src/ui/gui/misc_gui.cpp b/Source/hoc-clk/overlay/src/ui/gui/misc_gui.cpp index 3d5bc401..120a85d8 100644 --- a/Source/hoc-clk/overlay/src/ui/gui/misc_gui.cpp +++ b/Source/hoc-clk/overlay/src/ui/gui/misc_gui.cpp @@ -955,34 +955,8 @@ protected: this->listElement->addItem(new CompactCategoryHeader("Safety Settings")); addConfigToggle(HocClkConfigValue_UncappedClocks, nullptr); addConfigToggle(HocClkConfigValue_ThermalThrottle, nullptr); - addConfigToggle(HocClkConfigValue_HandheldTDP, nullptr); #if IS_MINIMAL == 0 - std::map labels_pwr_l = { - {6400, "Official Rating"} - }; - - if(IsHoag()) { - ValueThresholds tdpThresholdsLite(6400, 7500); - addConfigButton( - HocClkConfigValue_LiteTDPLimit, - "TDP Threshold", - ValueRange(4000, 8000, 100, "mW", 1), - "Power", - &tdpThresholdsLite, - labels_pwr_l - ); - } else { - ValueThresholds tdpThresholds(9600, 11000); - addConfigButton( - HocClkConfigValue_HandheldTDPLimit, - "TDP Threshold", - ValueRange(8000, 12000, 100, "mW", 1), - "Power", - &tdpThresholds - ); - } - ValueThresholds throttleThresholds(70, 80); addConfigButton( HocClkConfigValue_ThermalThrottleThreshold, diff --git a/Source/hoc-clk/sysmodule/src/file/config.cpp b/Source/hoc-clk/sysmodule/src/file/config.cpp index 7b0d2569..caa39989 100644 --- a/Source/hoc-clk/sysmodule/src/file/config.cpp +++ b/Source/hoc-clk/sysmodule/src/file/config.cpp @@ -480,4 +480,8 @@ namespace config { return true; } + void DeleteKey(const char* section, const char* key) { + std::scoped_lock lock{gConfigMutex}; + ini_puts(section, key, NULL, gPath.c_str()); + } } diff --git a/Source/hoc-clk/sysmodule/src/file/config.hpp b/Source/hoc-clk/sysmodule/src/file/config.hpp index 1b260fb9..bcc50fb3 100644 --- a/Source/hoc-clk/sysmodule/src/file/config.hpp +++ b/Source/hoc-clk/sysmodule/src/file/config.hpp @@ -55,7 +55,8 @@ namespace config { bool SetConfigValues(HocClkConfigValueList* configValues, bool immediate); bool ResetConfigValue(HocClkConfigValue kval); bool SetConfigValue(HocClkConfigValue kval, std::uint64_t value, bool immediate = true); - + void DeleteKey(const char* section, const char* key); + extern uint64_t configValues[HocClkConfigValue_EnumMax]; } diff --git a/Source/hoc-clk/sysmodule/src/file/kip.cpp b/Source/hoc-clk/sysmodule/src/file/kip.cpp index 1c1bc0a6..2950975a 100644 --- a/Source/hoc-clk/sysmodule/src/file/kip.cpp +++ b/Source/hoc-clk/sysmodule/src/file/kip.cpp @@ -311,11 +311,17 @@ namespace kip { config::GetConfigValues(&configValues); u32 previousVersion = configValues.values[KipConfigValue_KipVersion]; if(previousVersion < 240 && version >= 240) { - // <2.4.0 -> 2.4.0 migration: add marikoGpuBootVolt with default value of 800mV + // <2.4.0 -> 2.4.0 migration + + // add marikoGpuBootVolt with default value of 800mV configValues.values[KipConfigValue_marikoGpuBootVolt] = 800; + + // delete handheld TDP config entries + config::DeleteKey(CONFIG_VAL_SECTION, "handheld_tdp"); + config::DeleteKey(CONFIG_VAL_SECTION, "tdp_limit"); + config::DeleteKey(CONFIG_VAL_SECTION, "tdp_limit_l"); } config::SetConfigValues(&configValues, true); - // This function cannot do anything at the moment. The capabilities will be expanded in the next release } } diff --git a/Source/hoc-clk/sysmodule/src/mgr/clock_manager.cpp b/Source/hoc-clk/sysmodule/src/mgr/clock_manager.cpp index b2bd1470..147ff0e1 100644 --- a/Source/hoc-clk/sysmodule/src/mgr/clock_manager.cpp +++ b/Source/hoc-clk/sysmodule/src/mgr/clock_manager.cpp @@ -293,20 +293,6 @@ namespace clockManager { bool HandleSafetyFeatures() { - if (config::GetConfigValue(HocClkConfigValue_HandheldTDP) && (gContext.profile != HocClkProfile_Docked)) { - if (board::GetConsoleType() == HocClkConsoleType_Hoag) { - if (board::GetPowerMw(HocClkPowerSensor_Avg) < -(int)config::GetConfigValue(HocClkConfigValue_LiteTDPLimit)) { - ResetToStockClocks(); - return true; - } - } else { - if (board::GetPowerMw(HocClkPowerSensor_Avg) < -(int)config::GetConfigValue(HocClkConfigValue_HandheldTDPLimit)) { - ResetToStockClocks(); - return true; - } - } - } - if (((tmp451TempSoc() / 1000) > (int)config::GetConfigValue(HocClkConfigValue_ThermalThrottleThreshold)) && config::GetConfigValue(HocClkConfigValue_ThermalThrottle)) { ResetToStockClocks(); return true;