Should correctly set AMD boost

This commit is contained in:
Luke
2020-05-23 19:19:11 +12:00
parent da05b8d90c
commit 727aa3066d
7 changed files with 44 additions and 16 deletions

View File

@@ -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

4
Cargo.lock generated
View File

@@ -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",

View File

@@ -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 <luke@ljones.dev>"]

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
rog-core (0.9.9) focal; urgency=medium
* Correctly set AMD boost
-- Luke Jones <luke@ljones.dev> Sat, 23 May 2020 19:24:36 +1200
rog-core (0.9.8) focal; urgency=medium
* Fix fan-mode cli help

View File

@@ -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 <luke@ljones.dev>"]

View File

@@ -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 {

View File

@@ -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);
}