Force change to integrated if in nvidia or hybrid mode

Force change to integrated if in nvidia or hybrid mode and user tries
to switch to vfio or compute
This commit is contained in:
Luke D. Jones
2021-06-06 12:24:15 +12:00
parent ffa74d52e5
commit 439b006342
3 changed files with 18 additions and 3 deletions

View File

@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added ability to fade in/out gifs and images for anime. This does break anime configs. See manual for details.
- Added task to CtrlLed to set the keyboard LED brightness on wake from suspend
+ requires a kernel patch which will be upstreamed and in fedora rog kernel
- Make gfx change from nvidia to vfio/compute also force-change to integrated _then_
to requested mode
# [3.6.1] - 2021-05-25
### Changed

View File

@@ -548,8 +548,21 @@ impl CtrlGraphics {
false
};
Self::do_vendor_tasks(vendor, vfio_enable, &devices, &bus)?;
Self::do_display_manager_action("restart")?;
// Need to change to integrated before we can change to vfio or compute
if let Ok(config) = config.try_lock() {
if matches!(vendor, GfxVendors::Compute | GfxVendors::Vfio)
&& matches!(config.gfx_mode, GfxVendors::Nvidia | GfxVendors::Hybrid)
{
Self::do_vendor_tasks(GfxVendors::Integrated, vfio_enable, &devices, &bus)?;
Self::do_display_manager_action("restart")?;
sleep(Duration::from_millis(1000)); // Allow some time for the desktop to start
Self::do_vendor_tasks(vendor, vfio_enable, &devices, &bus)?;
}
} else {
Self::do_vendor_tasks(vendor, vfio_enable, &devices, &bus)?;
Self::do_display_manager_action("restart")?;
}
// Save selected mode in case of reboot
Self::save_gfx_mode(vendor, config);
info!("GFX thread: display-manager started");

View File

@@ -17,7 +17,7 @@ use rog_aura::{
AuraEffect, LedBrightness, LED_MSG_LEN,
};
use rog_types::supported::LedSupportedFunctions;
use std::{fs::OpenOptions, thread::{self, spawn}, time::Duration};
use std::{fs::OpenOptions, thread::spawn};
use std::io::{Read, Write};
use std::path::Path;
use std::sync::Arc;