From 67b23f68e24b56aa58037368655ee013d84645ec Mon Sep 17 00:00:00 2001 From: Thomas Syms Date: Tue, 3 Jun 2025 17:12:32 -0300 Subject: [PATCH] Updated tlp config --- hosts/common/optional/thermal-management.nix | 47 ++++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/hosts/common/optional/thermal-management.nix b/hosts/common/optional/thermal-management.nix index 9797636..338242f 100644 --- a/hosts/common/optional/thermal-management.nix +++ b/hosts/common/optional/thermal-management.nix @@ -4,16 +4,55 @@ services.tlp = { enable = true; settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; + # Set CPU driver operation mode to 'active' to allow the CPU to manage its own frequency scaling + CPU_DRIVER_OPMODE_ON_AC = "active"; + CPU_DRIVER_OPMODE_ON_BAT = "active"; + + # Use 'powersave' governor, which, with intel_pstate in active mode, allows HWP to manage frequencies efficiently + CPU_SCALING_GOVERNOR_ON_AC = "powersave"; CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + # Set Energy Performance Preference (EPP) to balance performance on AC and favor power savings on battery + CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; + # Define CPU performance limits: full performance on AC, limited to 50% on battery to save power CPU_MIN_PERF_ON_AC = 0; CPU_MAX_PERF_ON_AC = 100; CPU_MIN_PERF_ON_BAT = 0; - CPU_MAX_PERF_ON_BAT = 20; + CPU_MAX_PERF_ON_BAT = 50; + + # Enable Turbo Boost on AC for maximum performance; disable on battery to conserve energy + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 0; + + # Enable Intel's Hardware P-States (HWP) dynamic boost on AC; disable on battery + CPU_HWP_DYN_BOOST_ON_AC = 1; + CPU_HWP_DYN_BOOST_ON_BAT = 1; + + # Set platform profile to 'performance' on AC and 'low-power' on battery, if supported by the system + PLATFORM_PROFILE_ON_AC = "balanced"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + + # Enable Wi-Fi power saving on both AC and battery + WIFI_PWR_ON_AC = "on"; + WIFI_PWR_ON_BAT = "on"; + + # Configure PCIe Active State Power Management: default on AC, aggressive power saving on battery + PCIE_ASPM_ON_AC = "default"; + PCIE_ASPM_ON_BAT = "powersupersave"; + + # Enable runtime power management for PCIe devices: 'on' for AC, 'auto' for battery + RUNTIME_PM_ON_AC = "on"; + RUNTIME_PM_ON_BAT = "auto"; + + # Enable sound power saving on both AC and battery; '1' sets a 1-second timeout + SOUND_POWER_SAVE_ON_AC = 1; + SOUND_POWER_SAVE_ON_BAT = 1; + SOUND_POWER_SAVE_CONTROLLER = "Y"; + + # Enable USB autosuspend to save power when devices are idle + USB_AUTOSUSPEND = 1; #Optional helps save long term battery health #START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge