mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-05 22:20:33 -04:00
Add CPU Scheduler Governors.
Add a new enumeration for cpu scheduler governors. Adds a property to get the available governors as a map of value to strings similar to how we expose GPU Power Profiles. Adds another property to get and set the current governor which is applied to all cpus when set.
This commit is contained in:
parent
71827ac7ee
commit
7f9d25074e
4 changed files with 223 additions and 4 deletions
|
@ -20,8 +20,8 @@ use crate::daemon::DaemonCommand;
|
|||
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_gpu_power_profile, set_tdp_limit,
|
||||
GPUPerformanceLevel, GPUPowerProfile,
|
||||
set_cpu_governor, set_gpu_clocks, set_gpu_performance_level, set_gpu_power_profile,
|
||||
set_tdp_limit, CPUGovernor, GPUPerformanceLevel, GPUPowerProfile,
|
||||
};
|
||||
use crate::process::{run_script, script_output, ProcessManager};
|
||||
use crate::wifi::{
|
||||
|
@ -191,6 +191,14 @@ impl SteamOSManager {
|
|||
.map_err(to_zbus_fdo_error)
|
||||
}
|
||||
|
||||
async fn set_cpu_governor(&self, governor: u32) -> fdo::Result<()> {
|
||||
let governor = CPUGovernor::try_from(governor).map_err(to_zbus_fdo_error)?;
|
||||
set_cpu_governor(governor)
|
||||
.await
|
||||
.inspect_err(|message| error!("Error setting CPU governor: {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