Compare commits

...

5 Commits

Author SHA1 Message Date
Luke D. Jones 6f4a7e16dc Fixes to RCC 2024-01-05 14:21:31 +13:00
Luke D. Jones f64253d633 Various bugfixes 2024-01-05 13:53:57 +13:00
Luke D. Jones 124c17aadc Add default issue template 2024-01-04 14:30:11 +13:00
Luke D. Jones ab40f9fcbf Add FX705D led support 2024-01-04 09:23:37 +13:00
Luke D. Jones 5cdfa5a8d4 Fix to suspend process in anime thread to let custom anims run on wake 2023-12-27 11:24:39 +13:00
15 changed files with 179 additions and 77 deletions
+24
View File
@@ -0,0 +1,24 @@
## Issue description
(Summarize the bug encountered)
## Steps to reproduce
(How can the issue be reproduced)
## What is the current bug behavior?
(What actually happens)
## What is the expected correct behavior?
(What you should see instead)
## Relevant logs and/or screenshots
(run `journalctl -b -u supergfxd > ~/supergfxd.log` and attach `~/supergfxd.log`)
(Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.)
/label ~bug ~reproducable ~needs-investigation
+7
View File
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [v5.0.7]
### Changed
- Fix to suspend process in anime thread to let custom anims run on wake.
- Fix to reload the fan curves correctly on boot.
- Add new config option `platform_policy_linked_epp` to set if energy_performance_preference should be paired with platform_profile/throttle_thermal_policy
- Small fixes to rog-control-center
## [v5.0.6]
- Revert egui update due to a lot of issues arising from window closing.
Generated
+14 -14
View File
@@ -199,7 +199,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "asusctl"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"asusd",
"cargo-husky",
@@ -218,7 +218,7 @@ dependencies = [
[[package]]
name = "asusd"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"async-trait",
"cargo-husky",
@@ -226,7 +226,7 @@ dependencies = [
"config-traits",
"dmi_id",
"env_logger",
"futures-lite 2.1.0",
"futures-lite 1.13.0",
"log",
"logind-zbus",
"rog_anime",
@@ -243,7 +243,7 @@ dependencies = [
[[package]]
name = "asusd-user"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"cargo-husky",
"config-traits",
@@ -846,7 +846,7 @@ dependencies = [
[[package]]
name = "config-traits"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"cargo-husky",
"log",
@@ -899,7 +899,7 @@ dependencies = [
[[package]]
name = "cpuctl"
version = "5.0.6"
version = "5.0.7"
[[package]]
name = "cpufeatures"
@@ -1026,7 +1026,7 @@ dependencies = [
[[package]]
name = "dmi_id"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"log",
"udev",
@@ -2836,7 +2836,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "rog-control-center"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"asusd",
"cargo-husky",
@@ -2869,7 +2869,7 @@ dependencies = [
[[package]]
name = "rog_anime"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"cargo-husky",
"dmi_id",
@@ -2886,7 +2886,7 @@ dependencies = [
[[package]]
name = "rog_aura"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"cargo-husky",
"dmi_id",
@@ -2900,7 +2900,7 @@ dependencies = [
[[package]]
name = "rog_dbus"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"asusd",
"cargo-husky",
@@ -2913,7 +2913,7 @@ dependencies = [
[[package]]
name = "rog_platform"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"cargo-husky",
"concat-idents",
@@ -2930,7 +2930,7 @@ dependencies = [
[[package]]
name = "rog_profiles"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"cargo-husky",
"log",
@@ -2944,7 +2944,7 @@ dependencies = [
[[package]]
name = "rog_simulators"
version = "5.0.6"
version = "5.0.7"
dependencies = [
"glam",
"log",
+1 -1
View File
@@ -4,7 +4,7 @@ default-members = ["asusctl", "asusd", "asusd-user", "cpuctl", "rog-control-cent
resolver = "2"
[workspace.package]
version = "5.0.6"
version = "5.0.7"
[workspace.dependencies]
async-trait = "^0.1"
+51 -6
View File
@@ -1,4 +1,4 @@
use config_traits::{StdConfig, StdConfigLoad2};
use config_traits::{StdConfig, StdConfigLoad3};
use rog_platform::platform::PlatformPolicy;
use serde_derive::{Deserialize, Serialize};
@@ -13,9 +13,7 @@ pub struct Config {
pub disable_nvidia_powerd_on_battery: bool,
pub ac_command: String,
pub bat_command: String,
/// Restored on boot as well as when power is plugged
#[serde(skip)]
pub platform_policy_to_restore: PlatformPolicy,
pub platform_policy_linked_epp: bool,
pub platform_policy_on_battery: PlatformPolicy,
pub platform_policy_on_ac: PlatformPolicy,
//
@@ -50,9 +48,56 @@ impl StdConfig for Config {
}
}
impl StdConfigLoad2<Config462, Config472> for Config {}
impl StdConfigLoad3<Config462, Config472, Config506> for Config {}
#[derive(Deserialize, Serialize, Default, Debug)]
#[derive(Deserialize, Serialize)]
pub struct Config506 {
/// Save charge limit for restoring on boot
pub charge_control_end_threshold: u8,
pub panel_od: bool,
pub mini_led_mode: bool,
pub disable_nvidia_powerd_on_battery: bool,
pub ac_command: String,
pub bat_command: String,
/// Restored on boot as well as when power is plugged
#[serde(skip)]
pub platform_policy_to_restore: PlatformPolicy,
pub platform_policy_on_battery: PlatformPolicy,
pub platform_policy_on_ac: PlatformPolicy,
//
pub ppt_pl1_spl: Option<u8>,
pub ppt_pl2_sppt: Option<u8>,
pub ppt_fppt: Option<u8>,
pub ppt_apu_sppt: Option<u8>,
pub ppt_platform_sppt: Option<u8>,
pub nv_dynamic_boost: Option<u8>,
pub nv_temp_target: Option<u8>,
}
impl From<Config506> for Config {
fn from(c: Config506) -> Self {
Self {
charge_control_end_threshold: c.charge_control_end_threshold,
panel_od: c.panel_od,
disable_nvidia_powerd_on_battery: c.disable_nvidia_powerd_on_battery,
ac_command: c.ac_command,
bat_command: c.bat_command,
mini_led_mode: c.mini_led_mode,
platform_policy_linked_epp: true,
platform_policy_on_battery: c.platform_policy_on_battery,
platform_policy_on_ac: c.platform_policy_on_ac,
ppt_pl1_spl: c.ppt_pl1_spl,
ppt_pl2_sppt: c.ppt_pl2_sppt,
ppt_fppt: c.ppt_fppt,
ppt_apu_sppt: c.ppt_apu_sppt,
ppt_platform_sppt: c.ppt_platform_sppt,
nv_dynamic_boost: c.nv_dynamic_boost,
nv_temp_target: c.nv_temp_target,
}
}
}
#[derive(Deserialize, Serialize)]
pub struct Config472 {
/// Save charge limit for restoring on boot
pub bat_charge_limit: u8,
+16 -10
View File
@@ -277,16 +277,8 @@ impl crate::CtrlTask for CtrlAnimeZbus {
async move {
let lock = inner.lock().await;
if lock.config.display_enabled {
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(
!(sleeping && lock.config.off_when_suspended),
))
.map_err(|err| {
warn!("create_sys_event_tasks::off_when_suspended {}", err);
})
.ok();
lock.thread_exit.store(true, Ordering::Release); // ensure clean slate
lock.node
.write_bytes(&pkt_set_enable_display(
!(sleeping && lock.config.off_when_suspended),
@@ -296,7 +288,21 @@ impl crate::CtrlTask for CtrlAnimeZbus {
})
.ok();
if !sleeping && !lock.config.builtin_anims_enabled {
if lock.config.builtin_anims_enabled {
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(
!(sleeping && lock.config.off_when_suspended),
))
.map_err(|err| {
warn!("create_sys_event_tasks::off_when_suspended {}", err);
})
.ok();
} else if !sleeping && !lock.config.builtin_anims_enabled {
// Run custom wake animation
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(false))
.ok(); // ensure builtins are disabled
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
.await;
}
+12 -10
View File
@@ -296,16 +296,18 @@ impl CtrlTask for CtrlFanCurveZbus {
impl crate::Reloadable for CtrlFanCurveZbus {
/// Fetch the active profile and use that to set all related components up
async fn reload(&mut self) -> Result<(), RogError> {
// let active = self.platform.get_throttle_thermal_policy()?.into();
// if let Ok(mut device) = find_fan_curve_node() {
// // There is a possibility that the curve was default zeroed, so this call
// // initialises the data from system read and we need to save it
// // after
// self.fan_curves
// .lock()
// .await
// .write_profile_curve_to_platform(active, &mut device)?;
// }
let active = self.platform.get_throttle_thermal_policy()?.into();
if let Ok(mut device) = find_fan_curve_node() {
// There is a possibility that the curve was default zeroed, so this call
// initialises the data from system read and we need to save it
// after
loop {
if let Ok(mut curves) = self.fan_curves.try_lock() {
curves.write_profile_curve_to_platform(active, &mut device)?;
break;
}
}
}
Ok(())
}
}
+25 -12
View File
@@ -180,7 +180,11 @@ impl CtrlPlatform {
}
}
fn check_and_set_epp(&self, profile: PlatformPolicy) {
fn check_and_set_epp(&self, profile: PlatformPolicy, change_epp: bool) {
if !change_epp {
info!("PlatformPolicy unlinked from EPP");
return;
}
info!("PlatformPolicy setting EPP");
if let Some(cpu) = self.cpu_control.as_ref() {
if let Ok(epp) = cpu.get_available_epp() {
@@ -197,7 +201,7 @@ impl CtrlPlatform {
}
}
async fn update_policy_ac_or_bat(&self, power_plugged: bool) {
async fn update_policy_ac_or_bat(&self, power_plugged: bool, change_epp: bool) {
let profile = if power_plugged {
self.config.lock().await.platform_policy_on_ac
} else {
@@ -206,7 +210,7 @@ impl CtrlPlatform {
self.platform
.set_throttle_thermal_policy(profile.into())
.ok();
self.check_and_set_epp(profile);
self.check_and_set_epp(profile, change_epp);
}
}
@@ -340,14 +344,14 @@ impl CtrlPlatform {
let policy = PlatformPolicy::next(&policy);
if self.platform.has_throttle_thermal_policy() {
self.check_and_set_epp(policy);
let change_epp = self.config.lock().await.platform_policy_linked_epp;
self.check_and_set_epp(policy, change_epp);
self.platform
.set_throttle_thermal_policy(policy.into())
.map_err(|err| {
warn!("RogPlatform: throttle_thermal_policy {}", err);
FdoErr::Failed(format!("RogPlatform: throttle_thermal_policy: {err}"))
})?;
self.config.lock().await.platform_policy_to_restore = policy;
Ok(self.throttle_thermal_policy_changed(&ctxt).await?)
} else {
Err(FdoErr::NotSupported(
@@ -366,8 +370,8 @@ impl CtrlPlatform {
async fn set_throttle_thermal_policy(&mut self, policy: PlatformPolicy) -> Result<(), FdoErr> {
// TODO: watch for external changes
if self.platform.has_throttle_thermal_policy() {
self.check_and_set_epp(policy);
self.config.lock().await.platform_policy_to_restore = policy;
let change_epp = self.config.lock().await.platform_policy_linked_epp;
self.check_and_set_epp(policy, change_epp);
self.platform
.set_throttle_thermal_policy(policy.into())
.map_err(|err| {
@@ -534,7 +538,9 @@ impl crate::Reloadable for CtrlPlatform {
if let Ok(power_plugged) = self.power.get_online() {
if self.platform.has_throttle_thermal_policy() {
self.update_policy_ac_or_bat(power_plugged > 0).await;
let change_epp = self.config.lock().await.platform_policy_linked_epp;
self.update_policy_ac_or_bat(power_plugged > 0, change_epp)
.await;
}
self.run_ac_or_bat_cmd(power_plugged > 0).await;
}
@@ -614,7 +620,11 @@ impl CtrlTask for CtrlPlatform {
}
if let Ok(power_plugged) = platform1.power.get_online() {
if !sleeping && platform1.platform.has_throttle_thermal_policy() {
platform1.update_policy_ac_or_bat(power_plugged > 0).await;
let change_epp =
platform1.config.lock().await.platform_policy_linked_epp;
platform1
.update_policy_ac_or_bat(power_plugged > 0, change_epp)
.await;
}
if !sleeping {
platform1.run_ac_or_bat_cmd(power_plugged > 0).await;
@@ -648,7 +658,10 @@ impl CtrlTask for CtrlPlatform {
// power change
async move {
if platform3.platform.has_throttle_thermal_policy() {
platform3.update_policy_ac_or_bat(power_plugged).await;
let change_epp = platform3.config.lock().await.platform_policy_linked_epp;
platform3
.update_policy_ac_or_bat(power_plugged, change_epp)
.await;
}
platform3.run_ac_or_bat_cmd(power_plugged).await;
}
@@ -697,8 +710,8 @@ impl CtrlTask for CtrlPlatform {
error!("Platform: get_throttle_thermal_policy error: {e}");
})
{
ctrl.check_and_set_epp(profile);
ctrl.config.lock().await.platform_policy_to_restore = profile;
let change_epp = ctrl.config.lock().await.platform_policy_linked_epp;
ctrl.check_and_set_epp(profile, change_epp);
}
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ use asusd::ctrl_aura::trait_impls::CtrlAuraZbus;
use asusd::ctrl_fancurves::CtrlFanCurveZbus;
use asusd::ctrl_platform::CtrlPlatform;
use asusd::{print_board_info, CtrlTask, Reloadable, ZbusRun, DBUS_NAME};
use config_traits::{StdConfig, StdConfigLoad2};
use config_traits::{StdConfig, StdConfigLoad2, StdConfigLoad3};
use log::{error, info, warn};
use rog_aura::aura_detection::LaptopLedData;
use tokio::time::sleep;
+8
View File
@@ -71,6 +71,14 @@
advanced_type: None,
power_zones: [Keyboard],
),
(
board_name: "FX705D",
layout_name: "fx505d",
basic_modes: [Static, Breathe, Strobe, Pulse],
basic_zones: [],
advanced_type: None,
power_zones: [Keyboard],
),
(
board_name: "G512",
layout_name: "g512",
+1 -2
View File
@@ -10,10 +10,9 @@ pub mod effects;
pub mod advanced;
/// Convert the `RgbAddress` to `&str` labels
pub mod advanced_to_str;
pub mod error;
pub use advanced_to_str::*;
/// Helper for detecting what is available
pub mod aura_detection;
pub mod error;
/// Helpers for consructing keyboard layouts for UI use and effects
pub mod layouts;
pub mod usb;
+10 -3
View File
@@ -62,8 +62,8 @@ fn main() -> Result<()> {
let native_options = eframe::NativeOptions {
vsync: true,
hardware_acceleration: HardwareAcceleration::Preferred,
// min_window_size: Some(egui::vec2(960.0, 670.0)),
// max_window_size: Some(egui::vec2(960.0, 670.0)),
min_window_size: Some(egui::vec2(980.0, 670.0)),
max_window_size: Some(egui::vec2(980.0, 670.0)),
run_and_return: true,
..Default::default()
};
@@ -186,6 +186,13 @@ fn main() -> Result<()> {
&config,
)?;
if cli_parsed.board_name.is_some() || cli_parsed.layout_viewing {
if let Ok(mut lock) = states.lock() {
lock.run_in_bg = false;
running_in_bg.store(false, Ordering::Release);
}
}
if config.enable_tray_icon {
init_tray(supported_properties, states.clone());
}
@@ -212,7 +219,7 @@ fn main() -> Result<()> {
}
if let Ok(lock) = states.try_lock() {
if !lock.run_in_bg || cli_parsed.board_name.is_some() || cli_parsed.layout_viewing {
if !lock.run_in_bg {
break;
}
-6
View File
@@ -3,9 +3,3 @@ mod app_settings;
mod aura_page;
mod fan_curve_page;
mod system_page;
pub use anime_page::*;
pub use app_settings::*;
pub use aura_page::*;
pub use fan_curve_page::*;
pub use system_page::*;
-2
View File
@@ -15,5 +15,3 @@ pub use aura_power::*;
pub use fan_graph::*;
pub use keyboard_layout::*;
pub use rog_bios::*;
pub use side_panel::*;
pub use top_bar::*;
+9 -10
View File
@@ -1,4 +1,4 @@
use egui::{vec2, Align2, FontId, Id, Sense};
use egui::{vec2, Align2, Button, FontId, Id, Rect, RichText, Sense, Vec2};
use crate::{RogApp, VERSION};
@@ -33,15 +33,14 @@ impl RogApp {
FontId::proportional(height - 2.0),
text_color,
);
// // Add the close button:
// let close_response = ui.put(
// Rect::from_min_size(titlebar_rect.right_top(),
// Vec2::splat(height)),
// Button::new(RichText::new("❌").size(height -
// 4.0)).frame(false), );
// if close_response.clicked() {
// frame.close();
// }
// Add the close button:
let close_response = ui.put(
Rect::from_min_size(titlebar_rect.right_top(), Vec2::splat(height)),
Button::new(RichText::new("").size(height - 4.0)).frame(false),
);
if close_response.clicked() {
frame.close();
}
});
});
}