mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-05 14:10:34 -04:00
Add gpu power profile(s) properties.
Add profiles property to give back available profiles on this device. Add profile property to get and set current gpu power profile. Filter possible properties when on deck. Get current profile based on position of * character. Get card0 path based on which cardX has vendor 0x1002 Add some basic tests. TODO: Possibly cache available properties instead of fetching repeatedly.
This commit is contained in:
parent
8c1baa152b
commit
0759ff7077
6 changed files with 261 additions and 4 deletions
|
@ -14,7 +14,10 @@ use zbus::{fdo, interface, Connection, SignalContext};
|
|||
|
||||
use crate::error::{to_zbus_error, to_zbus_fdo_error};
|
||||
use crate::hardware::{variant, FanControl, FanControlState, HardwareVariant};
|
||||
use crate::power::{set_gpu_clocks, set_gpu_performance_level, set_tdp_limit, GPUPerformanceLevel};
|
||||
use crate::power::{
|
||||
set_gpu_clocks, set_gpu_performance_level, set_gpu_power_profile, set_tdp_limit,
|
||||
GPUPerformanceLevel, GPUPowerProfile,
|
||||
};
|
||||
use crate::process::{run_script, script_output, ProcessManager};
|
||||
use crate::wifi::{
|
||||
set_wifi_backend, set_wifi_debug_mode, set_wifi_power_management_state, WifiBackend,
|
||||
|
@ -173,6 +176,14 @@ impl SteamOSManager {
|
|||
.await
|
||||
}
|
||||
|
||||
async fn set_gpu_power_profile(&self, value: u32) -> fdo::Result<()> {
|
||||
let profile = GPUPowerProfile::try_from(value).map_err(to_zbus_fdo_error)?;
|
||||
set_gpu_power_profile(profile)
|
||||
.await
|
||||
.inspect_err(|message| error!("Error setting GPU power profile: {message}"))
|
||||
.map_err(to_zbus_fdo_error)
|
||||
}
|
||||
|
||||
async fn set_gpu_performance_level(&self, level: u32) -> fdo::Result<()> {
|
||||
let level = match GPUPerformanceLevel::try_from(level) {
|
||||
Ok(level) => level,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue