Add disable_nvidia_powerd_on_battery option

This commit is contained in:
Luke D. Jones
2023-01-03 20:17:52 +13:00
parent 067738b94f
commit e3ecaa92bd
4 changed files with 46 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
use async_trait::async_trait;
use log::info;
use log::warn;
use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::fan_curve_set::FanCurveSet;
@@ -200,29 +201,6 @@ impl CtrlTask for ProfileZbus {
}
async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> {
// let ctrl = self.0.clone();
// let mut watch = self.0.lock().await.platform.monitor_platform_profile()?;
// let sig_ctx = signal_ctxt.clone();
// tokio::spawn(async move {
// let mut buffer = [0; 32];
// watch
// .event_stream(&mut buffer)
// .unwrap()
// .for_each(|_| async {
// let mut lock = ctrl.lock().await;
// let new_profile = Profile::get_active_profile().unwrap();
// if new_profile != lock.config.active_profile {
// lock.config.active_profile = new_profile;
// lock.write_profile_curve_to_platform().unwrap();
// lock.save_config();
// }
// Self::notify_profile(&sig_ctx, lock.config.active_profile)
// .await
// .ok();
// })
// .await;
// });
let ctrl = self.0.clone();
let mut watch = self
.0
@@ -241,6 +219,7 @@ impl CtrlTask for ProfileZbus {
let new_thermal = lock.platform.get_throttle_thermal_policy().unwrap();
let new_profile = Profile::from_throttle_thermal_policy(new_thermal);
if new_profile != lock.config.active_profile {
info!("throttle_thermal_policy changed to {new_profile}");
lock.config.active_profile = new_profile;
lock.write_profile_curve_to_platform().unwrap();
lock.save_config();