power: Add LowPowerMode1 service

Add a new service to limit the platform TDP while handles are still held. This
feature is currently limited to the Steam Deck.
This commit is contained in:
Vicki Pfau 2024-08-21 22:35:57 -07:00
parent e7d2d63ac8
commit 65a81cee47
10 changed files with 666 additions and 56 deletions

View file

@ -15,7 +15,7 @@ use tokio::sync::oneshot;
use tracing::{error, info};
use zbus::object_server::SignalEmitter;
use zbus::zvariant::{self, Fd};
use zbus::{fdo, interface, Connection};
use zbus::{fdo, interface, proxy, Connection};
use crate::daemon::root::{Command, RootCommand};
use crate::daemon::DaemonCommand;
@ -91,6 +91,15 @@ impl SteamOSManager {
}
}
#[proxy(
interface = "com.steampowered.SteamOSManager1.RootManager",
default_service = "com.steampowered.SteamOSManager1",
default_path = "/com/steampowered/SteamOSManager1"
)]
pub(crate) trait RootManager {
fn set_tdp_limit(&self, limit: u32) -> zbus::Result<()>;
}
#[interface(name = "com.steampowered.SteamOSManager1.RootManager")]
impl SteamOSManager {
async fn prepare_factory_reset(&self, kind: u32) -> fdo::Result<u32> {