mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Better control of gfx modes
This commit is contained in:
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
# [3.7.1] - 2021-06-11
|
||||||
### Changed
|
### Changed
|
||||||
- Refine graphics mode switching:
|
- Refine graphics mode switching:
|
||||||
+ Disallow switching to compute or vfio mode unless existing mode is "Integrated"
|
+ Disallow switching to compute or vfio mode unless existing mode is "Integrated"
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -206,7 +206,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "daemon"
|
name = "daemon"
|
||||||
version = "3.7.0"
|
version = "3.7.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -10,10 +10,13 @@ use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2, ANIME_DATA_LEN};
|
|||||||
use rog_aura::{self, AuraEffect};
|
use rog_aura::{self, AuraEffect};
|
||||||
use rog_dbus::RogDbusClient;
|
use rog_dbus::RogDbusClient;
|
||||||
use rog_profiles::profiles::Profile;
|
use rog_profiles::profiles::Profile;
|
||||||
use rog_types::{gfx_vendors::{GfxRequiredUserAction, GfxVendors}, supported::{
|
use rog_types::{
|
||||||
|
gfx_vendors::{GfxRequiredUserAction, GfxVendors},
|
||||||
|
supported::{
|
||||||
FanCpuSupportedFunctions, LedSupportedFunctions, RogBiosSupportedFunctions,
|
FanCpuSupportedFunctions, LedSupportedFunctions, RogBiosSupportedFunctions,
|
||||||
SupportedFunctions,
|
SupportedFunctions,
|
||||||
}};
|
},
|
||||||
|
};
|
||||||
use std::{env::args, path::Path};
|
use std::{env::args, path::Path};
|
||||||
use yansi_term::Colour::Green;
|
use yansi_term::Colour::Green;
|
||||||
use yansi_term::Colour::Red;
|
use yansi_term::Colour::Red;
|
||||||
@@ -312,20 +315,17 @@ fn do_gfx(
|
|||||||
"You must change to Integrated before you can change to {}",
|
"You must change to Integrated before you can change to {}",
|
||||||
<&str>::from(mode)
|
<&str>::from(mode)
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
GfxRequiredUserAction::Logout | GfxRequiredUserAction::Reboot => {
|
GfxRequiredUserAction::Logout | GfxRequiredUserAction::Reboot => {
|
||||||
println!(
|
println!(
|
||||||
"Graphics mode changed to {}. User action required is: {}",
|
"Graphics mode changed to {}. User action required is: {}",
|
||||||
<&str>::from(mode),
|
<&str>::from(mode),
|
||||||
<&str>::from(&res)
|
<&str>::from(&res)
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
GfxRequiredUserAction::None => {
|
GfxRequiredUserAction::None => {
|
||||||
println!(
|
println!("Graphics mode changed to {}", <&str>::from(mode));
|
||||||
"Graphics mode changed to {}",
|
}
|
||||||
<&str>::from(mode)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
std::process::exit(0)
|
std::process::exit(0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "daemon"
|
name = "daemon"
|
||||||
version = "3.7.0"
|
version = "3.7.1"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
authors = ["Luke <luke@ljones.dev>"]
|
||||||
|
|||||||
@@ -662,7 +662,7 @@ impl CtrlGraphics {
|
|||||||
let bus = self.bus.clone();
|
let bus = self.bus.clone();
|
||||||
Self::do_mode_setup_tasks(vendor, vfio_enable, &devices, &bus)?;
|
Self::do_mode_setup_tasks(vendor, vfio_enable, &devices, &bus)?;
|
||||||
info!("GFX: Graphics mode changed to {}", <&str>::from(vendor));
|
info!("GFX: Graphics mode changed to {}", <&str>::from(vendor));
|
||||||
},
|
}
|
||||||
GfxRequiredUserAction::Integrated => {
|
GfxRequiredUserAction::Integrated => {
|
||||||
info!("GFX: mode change requires user to be in Integrated mode first");
|
info!("GFX: mode change requires user to be in Integrated mode first");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ use rog_aura::{
|
|||||||
AuraEffect, LedBrightness, LED_MSG_LEN,
|
AuraEffect, LedBrightness, LED_MSG_LEN,
|
||||||
};
|
};
|
||||||
use rog_types::supported::LedSupportedFunctions;
|
use rog_types::supported::LedSupportedFunctions;
|
||||||
use std::{fs::OpenOptions, thread::spawn};
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use std::{fs::OpenOptions, thread::spawn};
|
||||||
use zbus::Connection;
|
use zbus::Connection;
|
||||||
|
|
||||||
use crate::GetSupported;
|
use crate::GetSupported;
|
||||||
@@ -75,12 +75,13 @@ impl<'a> CtrlKbdLedTask<'a> {
|
|||||||
// wait a fraction for things to wake up properly
|
// wait a fraction for things to wake up properly
|
||||||
//std::thread::sleep(Duration::from_millis(100));
|
//std::thread::sleep(Duration::from_millis(100));
|
||||||
loop {
|
loop {
|
||||||
if let Ok(ref mut lock) = c1.try_lock() {
|
if let Ok(ref mut lock) = c1.try_lock() {
|
||||||
lock.set_brightness(lock.config.brightness).ok();
|
lock.set_brightness(lock.config.brightness).ok();
|
||||||
break;
|
break;
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
|
|||||||
Reference in New Issue
Block a user