mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add "info" output for gfx driver check
This commit is contained in:
@@ -168,6 +168,7 @@ impl CtrlGraphics {
|
|||||||
.iter()
|
.iter()
|
||||||
.any(|module| module.name == "nouveau" || module.name == "nvidia")
|
.any(|module| module.name == "nouveau" || module.name == "nvidia")
|
||||||
{
|
{
|
||||||
|
info!("nvidia or nouveau module found");
|
||||||
let mode = match Self::get_prime_discrete() {
|
let mode = match Self::get_prime_discrete() {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
Err(_) => "nvidia".to_string(),
|
Err(_) => "nvidia".to_string(),
|
||||||
@@ -181,6 +182,7 @@ impl CtrlGraphics {
|
|||||||
"nvidia".to_string()
|
"nvidia".to_string()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
info!("No dGPU driver (nouveau or nvidia) loaded");
|
||||||
"integrated".to_string()
|
"integrated".to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -212,10 +214,10 @@ impl CtrlGraphics {
|
|||||||
|
|
||||||
// Switching from hybrid to/from nvidia shouldn't require a ramdisk update
|
// Switching from hybrid to/from nvidia shouldn't require a ramdisk update
|
||||||
// or a reboot.
|
// or a reboot.
|
||||||
let switching_prime_modes = Self::is_switching_prime_modes(&vendor)?;
|
let no_reboot = Self::is_switching_prime_modes(&vendor)?;
|
||||||
|
|
||||||
{
|
{
|
||||||
info!("Creating {}", MODPROBE_PATH);
|
info!("Writing {}", MODPROBE_PATH);
|
||||||
|
|
||||||
let mut file = std::fs::OpenOptions::new()
|
let mut file = std::fs::OpenOptions::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
@@ -239,7 +241,7 @@ impl CtrlGraphics {
|
|||||||
.map_err(|err| GfxError::Write(MODPROBE_PATH.into(), err))?;
|
.map_err(|err| GfxError::Write(MODPROBE_PATH.into(), err))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Creating {}", PRIMARY_GPU_XORG_PATH);
|
info!("Writing {}", PRIMARY_GPU_XORG_PATH);
|
||||||
|
|
||||||
// begin section for non-separated Nvidia xorg modules
|
// begin section for non-separated Nvidia xorg modules
|
||||||
// eg, not put in their own directory
|
// eg, not put in their own directory
|
||||||
@@ -283,7 +285,7 @@ impl CtrlGraphics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut required_action = GfxCtrlAction::None;
|
let mut required_action = GfxCtrlAction::None;
|
||||||
if !switching_prime_modes {
|
if !no_reboot {
|
||||||
info!("Updating initramfs");
|
info!("Updating initramfs");
|
||||||
if let Some(cmd) = self.initfs_cmd.as_mut() {
|
if let Some(cmd) = self.initfs_cmd.as_mut() {
|
||||||
let status = cmd
|
let status = cmd
|
||||||
@@ -296,7 +298,7 @@ impl CtrlGraphics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
required_action = GfxCtrlAction::Reboot;
|
required_action = GfxCtrlAction::Reboot;
|
||||||
} else if switching_prime_modes {
|
} else if no_reboot {
|
||||||
required_action = GfxCtrlAction::RestartX;
|
required_action = GfxCtrlAction::RestartX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user