diff --git a/CHANGELOG.md b/CHANGELOG.md index 881f6ddb..256fbb23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.9] - 2020-23-05 +### Changed +- Correctly set AMD boost + ## [0.9.7] - 2020-23-05 ### Changed - Start differentiating between models using the 0x1866 USB device diff --git a/Cargo.lock b/Cargo.lock index ccb56d36..1a6ea2a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -673,7 +673,7 @@ checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" [[package]] name = "rog-aura" -version = "0.9.2" +version = "0.9.3" dependencies = [ "dbus", "gumdrop", @@ -684,7 +684,7 @@ dependencies = [ [[package]] name = "rog-daemon" -version = "0.9.8" +version = "0.9.9" dependencies = [ "dbus", "dbus-tokio", diff --git a/aura/Cargo.toml b/aura/Cargo.toml index b6c9d9be..e125992b 100644 --- a/aura/Cargo.toml +++ b/aura/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rog-aura" -version = "0.9.2" +version = "0.9.3" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/debian/changelog b/debian/changelog index 8c4106f8..55996caf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +rog-core (0.9.9) focal; urgency=medium + + * Correctly set AMD boost + + -- Luke Jones Sat, 23 May 2020 19:24:36 +1200 + rog-core (0.9.8) focal; urgency=medium * Fix fan-mode cli help diff --git a/rog-core/Cargo.toml b/rog-core/Cargo.toml index f9f21e3d..bc24bb36 100644 --- a/rog-core/Cargo.toml +++ b/rog-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rog-daemon" -version = "0.9.8" +version = "0.9.9" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/rog-core/src/main.rs b/rog-core/src/main.rs index 183f5512..72ce500e 100644 --- a/rog-core/src/main.rs +++ b/rog-core/src/main.rs @@ -8,7 +8,7 @@ use rog_aura::{ AuraDbusWriter, LED_MSG_LEN, }; -static VERSION: &'static str = "0.9.8"; +static VERSION: &'static str = "0.9.9"; #[derive(Debug, Options)] struct CLIStart { diff --git a/rog-core/src/rogcore.rs b/rog-core/src/rogcore.rs index c6266edb..b425cf65 100644 --- a/rog-core/src/rogcore.rs +++ b/rog-core/src/rogcore.rs @@ -15,7 +15,7 @@ use std::time::Duration; static FAN_TYPE_1_PATH: &str = "/sys/devices/platform/asus-nb-wmi/throttle_thermal_policy"; static FAN_TYPE_2_PATH: &str = "/sys/devices/platform/asus-nb-wmi/fan_boost_mode"; -static AMD_BOOST_APTH: &str = "/sys/devices/system/cpu/cpufreq/boost"; +static AMD_BOOST_PATH: &str = "/sys/devices/system/cpu/cpufreq/boost"; /// ROG device controller /// @@ -194,26 +194,44 @@ impl RogCore { } else { info!("Setting pstate for AMD CPU"); // must be AMD CPU - let mut file = OpenOptions::new().write(true).open(AMD_BOOST_APTH)?; + let mut file = OpenOptions::new() + .write(true) + .open(AMD_BOOST_PATH) + .map_err(|err| { + warn!("Failed to open AMD boost: {:?}", err); + err + })?; match mode { FanLevel::Normal => { - let boost = !config.mode_performance.normal.no_turbo as u8; // opposite of Intel - file.write_all(&[boost]).unwrap_or_else(|err| { - error!("Could not write to {}, {:?}", AMD_BOOST_APTH, err) + let boost = if config.mode_performance.normal.no_turbo { + "0" + } else { + "1" + }; // opposite of Intel + file.write_all(boost.as_bytes()).unwrap_or_else(|err| { + error!("Could not write to {}, {:?}", AMD_BOOST_PATH, err) }); info!("CPU Power: turbo: {:?}", boost); } FanLevel::Boost => { - let boost = !config.mode_performance.boost.no_turbo as u8; // opposite of Intel - file.write_all(&[boost]).unwrap_or_else(|err| { - error!("Could not write to {}, {:?}", AMD_BOOST_APTH, err) + let boost = if config.mode_performance.boost.no_turbo { + "0" + } else { + "1" + }; + file.write_all(boost.as_bytes()).unwrap_or_else(|err| { + error!("Could not write to {}, {:?}", AMD_BOOST_PATH, err) }); info!("CPU Power: turbo: {:?}", boost); } FanLevel::Silent => { - let boost = !config.mode_performance.silent.no_turbo as u8; // opposite of Intel - file.write_all(&[boost]).unwrap_or_else(|err| { - error!("Could not write to {}, {:?}", AMD_BOOST_APTH, err) + let boost = if config.mode_performance.silent.no_turbo { + "0" + } else { + "1" + }; + file.write_all(boost.as_bytes()).unwrap_or_else(|err| { + error!("Could not write to {}, {:?}", AMD_BOOST_PATH, err) }); info!("CPU Power: turbo: {:?}", boost); }