mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Attempt to provide more info to users gfx switching
This commit is contained in:
@@ -5,6 +5,10 @@ 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]
|
||||||
|
### Changed
|
||||||
|
- Set PM to auto for Nvidia always
|
||||||
|
- Extra info output for gfx dev scan
|
||||||
|
- Extra info in log for G-Sync to help prevent user confusion around gfx switching
|
||||||
|
|
||||||
# [3.6.1] - 2021-05-25
|
# [3.6.1] - 2021-05-25
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use sysfs_class::RuntimePM;
|
||||||
use ::zbus::Connection;
|
use ::zbus::Connection;
|
||||||
use ctrl_gfx::error::GfxError;
|
use ctrl_gfx::error::GfxError;
|
||||||
use ctrl_gfx::*;
|
use ctrl_gfx::*;
|
||||||
@@ -66,7 +67,10 @@ impl CtrlGraphics {
|
|||||||
let mut nvidia = Vec::new();
|
let mut nvidia = Vec::new();
|
||||||
let mut other = Vec::new();
|
let mut other = Vec::new();
|
||||||
for dev in devs.iter() {
|
for dev in devs.iter() {
|
||||||
let c = dev.class()?;
|
let c = dev.class().map_err(|err|{
|
||||||
|
error!("GFX: device error: {}, {}", dev.path().to_string_lossy(), err);
|
||||||
|
err
|
||||||
|
})?;
|
||||||
if 0x03 == (c >> 16) & 0xFF {
|
if 0x03 == (c >> 16) & 0xFF {
|
||||||
match dev.vendor()? {
|
match dev.vendor()? {
|
||||||
0x1002 => {
|
0x1002 => {
|
||||||
@@ -75,6 +79,7 @@ impl CtrlGraphics {
|
|||||||
}
|
}
|
||||||
0x10DE => {
|
0x10DE => {
|
||||||
info!("GFX: {}: NVIDIA graphics", dev.id());
|
info!("GFX: {}: NVIDIA graphics", dev.id());
|
||||||
|
dev.set_runtime_pm(sysfs_class::RuntimePowerManagement::On)?;
|
||||||
nvidia.push(GraphicsDevice::new(dev.id().to_owned(), functions(&dev)));
|
nvidia.push(GraphicsDevice::new(dev.id().to_owned(), functions(&dev)));
|
||||||
}
|
}
|
||||||
0x8086 => {
|
0x8086 => {
|
||||||
@@ -400,6 +405,18 @@ impl CtrlGraphics {
|
|||||||
) -> Result<(), RogError> {
|
) -> Result<(), RogError> {
|
||||||
// Rescan before doing remove or add drivers
|
// Rescan before doing remove or add drivers
|
||||||
bus.rescan()?;
|
bus.rescan()?;
|
||||||
|
// Make sure the power management is set to auto for nvidia devices
|
||||||
|
let devs = PciDevice::all()?;
|
||||||
|
for dev in devs.iter() {
|
||||||
|
let c = dev.class().map_err(|err|{
|
||||||
|
error!("GFX: device error: {}, {}", dev.path().to_string_lossy(), err);
|
||||||
|
err
|
||||||
|
})?;
|
||||||
|
if 0x03 == (c >> 16) & 0xFF && dev.vendor()? == 0x10DE {
|
||||||
|
info!("GFX: {}: NVIDIA graphics, setting PM to auto", dev.id());
|
||||||
|
dev.set_runtime_pm(sysfs_class::RuntimePowerManagement::On)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
Self::write_xorg_conf(vendor)?;
|
Self::write_xorg_conf(vendor)?;
|
||||||
// Write different modprobe to enable boot control to work
|
// Write different modprobe to enable boot control to work
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ impl CtrlRogBios {
|
|||||||
CtrlRogBios::set_path_mutable(ASUS_SWITCH_GRAPHIC_MODE)?;
|
CtrlRogBios::set_path_mutable(ASUS_SWITCH_GRAPHIC_MODE)?;
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
info!("ROG Switchable Graphics (bios) not detected: {}", err);
|
info!("G-Sync Switchable Graphics not detected: {}", err);
|
||||||
|
info!("If your laptop is not a G-Sync enabled laptop then you can ignore this. Standard graphics switching will still work.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +131,7 @@ impl CtrlRogBios {
|
|||||||
CtrlRogBios::set_path_mutable(ASUS_POST_LOGO_SOUND)?;
|
CtrlRogBios::set_path_mutable(ASUS_POST_LOGO_SOUND)?;
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
info!("ROG boot sound toggle (bios) not detected: {}", err);
|
info!("Switch for POST boot sound not detected: {}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user