From f6498337feeb4c504ba3a2b57e19db2cf4945664 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Tue, 4 Oct 2022 11:37:23 +1300 Subject: [PATCH] RCC: disable vsync due to NoAvailablePixelFormat error: --- daemon/src/ctrl_platform.rs | 4 ++-- rog-control-center/src/main.rs | 1 + rog-control-center/src/widgets/rog_bios.rs | 3 ++- rog-platform/src/platform.rs | 16 ++++++++-------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/daemon/src/ctrl_platform.rs b/daemon/src/ctrl_platform.rs index d7ae4aed..fc56cbe7 100644 --- a/daemon/src/ctrl_platform.rs +++ b/daemon/src/ctrl_platform.rs @@ -147,7 +147,7 @@ impl CtrlPlatform { ) { self.set_gfx_mode(mode) .map_err(|err| { - warn!("CtrlRogBios: set_asus_switch_graphic_mode {}", err); + warn!("CtrlRogBios: set_gpu_mux_mode {}", err); err }) .ok(); @@ -156,7 +156,7 @@ impl CtrlPlatform { fn gpu_mux_mode(&self) -> GpuMode { match self.platform.get_gpu_mux_mode() { - Ok(m) => GpuMode::from_mux(m), + Ok(m) => GpuMode::from_mux(m as u8), Err(e) => { warn!("CtrlRogBios: get_gfx_mode {}", e); GpuMode::Error diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 0e62dde4..a5a5a91f 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -22,6 +22,7 @@ fn main() -> Result<(), Box> { print_versions(); let native_options = eframe::NativeOptions { + vsync: false, decorated: false, transparent: false, min_window_size: Some(egui::vec2(840.0, 600.0)), diff --git a/rog-control-center/src/widgets/rog_bios.rs b/rog-control-center/src/widgets/rog_bios.rs index fdc6dec1..7a6b1248 100644 --- a/rog-control-center/src/widgets/rog_bios.rs +++ b/rog-control-center/src/widgets/rog_bios.rs @@ -92,7 +92,8 @@ pub fn rog_bios_group( let mut changed = false; ui.group(|ui| { ui.vertical(|ui| { - ui.horizontal_wrapped(|ui| ui.label("GPU MUX mode (reboot required)")); + ui.horizontal_wrapped(|ui| ui.label("GPU MUX mode")); + ui.horizontal_wrapped(|ui| ui.label("NOTE: Value does not change until rebooted")); ui.horizontal_wrapped(|ui| { changed = ui .selectable_value( diff --git a/rog-platform/src/platform.rs b/rog-platform/src/platform.rs index 32eb1070..ef2fe085 100644 --- a/rog-platform/src/platform.rs +++ b/rog-platform/src/platform.rs @@ -58,7 +58,7 @@ impl AsusPlatform { attr_bool!("dgpu_disable", path); attr_bool!("egpu_enable", path); attr_bool!("panel_od", path); - attr_u8!("gpu_mux_mode", path); + attr_bool!("gpu_mux_mode", path); // This is technically the same as `platform_profile` since both are tied in-kernel attr_u8!("throttle_thermal_policy", path); // The acpi platform_profile support @@ -77,25 +77,25 @@ pub enum GpuMode { impl GpuMode { /// For writing to `gpu_mux_mode` attribute - pub fn to_mux_attr(&self) -> u8 { + pub fn to_mux_attr(&self) -> bool { if *self == Self::Discrete { - return b'0'; + return false; } - b'1' + true } pub fn to_dgpu_attr(&self) -> u8 { if *self == Self::Integrated { - return b'1'; + return 1; } - b'0' + 0 } pub fn to_egpu_attr(&self) -> u8 { if *self == Self::Egpu { - return b'1'; + return 1; } - b'0' + 0 } pub fn from_mux(num: u8) -> Self {