gfx: enable correct rebootless compute mode switch

This commit is contained in:
Luke D. Jones
2021-04-20 19:33:55 +12:00
parent f95e42e4b9
commit 6926aeed20
3 changed files with 13 additions and 4 deletions

View File

@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Split out all aura functionality that isn't dependent on the daemon in to a
new crate `rog-aura`
- Correctly enable compute mode for nvidia plus no-reboot or logout if switching
from vfio/integrated/compute.
# [3.4.1] - 2021-04-11
### Changed

View File

@@ -282,10 +282,14 @@ impl CtrlGraphics {
fn write_modprobe_conf(vendor: GfxVendors, devices: &[GraphicsDevice]) -> Result<(), RogError> {
info!("GFX: Writing {}", MODPROBE_PATH);
let content = match vendor {
GfxVendors::Nvidia | GfxVendors::Hybrid | GfxVendors::Compute => MODPROBE_BASE.to_vec(),
GfxVendors::Nvidia | GfxVendors::Hybrid => {
let mut base = MODPROBE_BASE.to_vec();
base.append(&mut MODPROBE_DRM_MODESET.to_vec());
base
},
GfxVendors::Vfio => Self::get_vfio_conf(devices),
// GfxVendors::Compute => {}
GfxVendors::Integrated => MODPROBE_INTEGRATED.to_vec(),
GfxVendors::Compute => MODPROBE_BASE.to_vec(),
};
let mut file = std::fs::OpenOptions::new()
@@ -419,8 +423,8 @@ impl CtrlGraphics {
fn logout_required(&self, vendor: GfxVendors) -> GfxRequiredUserAction {
if let Ok(config) = self.config.lock() {
let current = config.gfx_mode;
if matches!(current, GfxVendors::Integrated | GfxVendors::Vfio)
&& matches!(vendor, GfxVendors::Integrated | GfxVendors::Vfio)
if matches!(current, GfxVendors::Integrated | GfxVendors::Vfio | GfxVendors::Compute)
&& matches!(vendor, GfxVendors::Integrated | GfxVendors::Vfio | GfxVendors::Compute)
{
return GfxRequiredUserAction::None;
}

View File

@@ -26,6 +26,9 @@ static MODPROBE_BASE: &[u8] = br#"# Automatically generated by asusd
blacklist nouveau
alias nouveau off
options nvidia NVreg_DynamicPowerManagement=0x02
"#;
static MODPROBE_DRM_MODESET: &[u8] = br#"
options nvidia-drm modeset=1
"#;