diff --git a/Cargo.lock b/Cargo.lock index 1d7170e..9a9094c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1001,7 +1001,7 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "powerstation" -version = "0.1.6" +version = "0.2.0" dependencies = [ "libryzenadj", "log", diff --git a/src/main.rs b/src/main.rs index 85672b9..c96d3d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,11 +3,11 @@ use std::{error::Error, future::pending}; use zbus::Connection; use crate::constants::{BUS_NAME, CPU_PATH, GPU_PATH}; -use crate::performance::cpu::cpu; -use crate::performance::gpu::dbus; -use crate::dbus::gpu::GPUBus; use crate::dbus::gpu::get_connectors; use crate::dbus::gpu::get_gpus; +use crate::dbus::gpu::GPUBus; +use crate::performance::cpu::cpu; +use crate::performance::gpu::dbus; mod constants; mod performance; @@ -15,7 +15,8 @@ mod performance; #[tokio::main(flavor = "multi_thread", worker_threads = 2)] async fn main() -> Result<(), Box> { SimpleLogger::new().init().unwrap(); - log::info!("Starting PowerStation"); + const VERSION: &str = env!("CARGO_PKG_VERSION"); + log::info!("Starting PowerStation v{}", VERSION); // Discover all CPUs let cpu = cpu::CPU::new(); diff --git a/src/performance/gpu/amd/tdp.rs b/src/performance/gpu/amd/tdp.rs index 4f83cf0..e408fe8 100644 --- a/src/performance/gpu/amd/tdp.rs +++ b/src/performance/gpu/amd/tdp.rs @@ -4,6 +4,7 @@ use crate::performance::gpu::tdp::{TDPDevice, TDPError, TDPResult}; /// Steam Deck GPU ID const DEV_ID_VANGOGH: &str = "163f"; +const DEV_ID_SEPHIROTH: &str = "1435"; /// Implementation of TDP control for AMD GPUs pub struct TDP { @@ -27,14 +28,17 @@ impl TDP { // Set fake TDP limits for GPUs that don't support ryzenadj monitoring (e.g. Steam Deck) let unsupported_stapm_limit: f32 = match device_id.as_str() { DEV_ID_VANGOGH => 12.0, + DEV_ID_SEPHIROTH => 12.0, _ => 10.0, }; let unsupported_ppt_limit_fast: f32 = match device_id.as_str() { DEV_ID_VANGOGH => 15.0, + DEV_ID_SEPHIROTH => 15.0, _ => 10.0, }; let unsupported_thm_limit: f32 = match device_id.as_str() { DEV_ID_VANGOGH => 95.0, + DEV_ID_SEPHIROTH => 95.0, _ => 95.0, }; @@ -50,7 +54,7 @@ impl TDP { /// Returns true if ryzenadj cannot read values from the given GPU fn is_unsupported_gpu(&self) -> bool { - self.device_id == DEV_ID_VANGOGH + matches!(self.device_id.as_str(), DEV_ID_VANGOGH | DEV_ID_SEPHIROTH) } /// Set the current Slow PPT limit using ryzenadj