diff --git a/src/cpu.rs b/src/cpu.rs index cbd37f8..a5f7c28 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -213,23 +213,24 @@ fn get_available_governors() -> Result> { )) } +// FIXME: I think the Auto Turbo behaviour is still pretty confusing for the end-user +// who might not have read the documentation in detail. We could just make the program +// more verbose here, but I think this is a fundamental design flaw that I will want +// to refactor in the future. For now though, I think this is a good-ish solution. pub fn set_turbo(setting: TurboSetting) -> Result<()> { let value_pstate = match setting { TurboSetting::Always => "0", // no_turbo = 0 means turbo is enabled TurboSetting::Never => "1", // no_turbo = 1 means turbo is disabled - // Auto mode is handled at the engine level, not directly at the sysfs level - TurboSetting::Auto => { - debug!("Turbo Auto mode is managed by engine logic based on system conditions"); - return Ok(()); - } + // For Auto, we need to enable the hardware default (which is turbo enabled) + // and we reset to the system default when explicitly set to Auto + TurboSetting::Auto => "0", // Set to enabled (default hardware state) when Auto is requested }; let value_boost = match setting { TurboSetting::Always => "1", // boost = 1 means turbo is enabled TurboSetting::Never => "0", // boost = 0 means turbo is disabled - TurboSetting::Auto => { - debug!("Turbo Auto mode is managed by engine logic based on system conditions"); - return Ok(()); - } + // For Auto, we need to enable the hardware default (which is turbo enabled) + // and we reset to the system default when explicitly set to Auto + TurboSetting::Auto => "1", // Set to enabled (default hardware state) when Auto is requested }; // AMD specific paths diff --git a/src/engine.rs b/src/engine.rs index c305567..9c93e92 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -118,10 +118,12 @@ pub fn determine_and_apply_settings( manage_auto_turbo(report, selected_profile_config)?; } else { debug!( - "Auto turbo management disabled by configuration, using system default behavior" + "Superfreq's dynamic turbo management is disabled by configuration. Ensuring system uses its default behavior for automatic turbo control." ); + // Make sure the system is set to its default automatic turbo mode. + // This is important if turbo was previously forced off. try_apply_feature("Turbo boost", "system default (Auto)", || { - cpu::set_turbo(turbo_setting) + cpu::set_turbo(TurboSetting::Auto) })?; } }