From 7548f1d032684340da90acba6db82c179bbfda40 Mon Sep 17 00:00:00 2001 From: Ilya Zlobintsev Date: Fri, 22 May 2026 19:20:28 +0300 Subject: [PATCH] fix: missing fan curve options on nvidia (#1034) --- lact-gui/src/app/pages/thermals_page.rs | 1 + .../app/pages/thermals_page/fan_curve_frame.rs | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lact-gui/src/app/pages/thermals_page.rs b/lact-gui/src/app/pages/thermals_page.rs index bd904a29..403b7e38 100644 --- a/lact-gui/src/app/pages/thermals_page.rs +++ b/lact-gui/src/app/pages/thermals_page.rs @@ -467,6 +467,7 @@ impl relm4::Component for ThermalsPage { let msg = CurveSetupMsg { curve: stats.fan.curve.clone().unwrap_or_else(default_fan_curve), + hw_based: self.has_pmfw, current_temperatures: stats.temps.clone(), temperature_key: stats.fan.temperature_key.clone(), spindown_delay: stats.fan.spindown_delay_ms, diff --git a/lact-gui/src/app/pages/thermals_page/fan_curve_frame.rs b/lact-gui/src/app/pages/thermals_page/fan_curve_frame.rs index 5114ee5f..d3923084 100644 --- a/lact-gui/src/app/pages/thermals_page/fan_curve_frame.rs +++ b/lact-gui/src/app/pages/thermals_page/fan_curve_frame.rs @@ -51,6 +51,8 @@ const PERCENTAGE_DRAG_MARGIN: f32 = 0.04; #[derive(Clone)] pub(super) struct FanCurveFrame { pmfw_options: PmfwOptions, + /// PMFW fan control on AMD RDNA3+ with fixed length + hw_based_fan_curve: Rc, data: Rc>>, speed_range: Rc>>, @@ -89,6 +91,7 @@ pub(super) enum FanCurveFrameMsg { #[derive(Debug)] pub(super) struct CurveSetupMsg { pub curve: FanCurveMap, + pub hw_based: bool, pub current_temperatures: HashMap, pub temperature_key: Option, pub speed_range: RangeInclusive, @@ -156,14 +159,14 @@ impl relm4::Component for FanCurveFrame { set_icon_name: "list-add-symbolic", connect_clicked => FanCurveFrameMsg::AddPoint, #[watch] - set_visible: model.pmfw_options.is_empty(), + set_visible: !model.hw_based_fan_curve.load(Ordering::SeqCst), }, gtk::Button { set_icon_name: "list-remove-symbolic", connect_clicked => FanCurveFrameMsg::RemovePoint, #[watch] - set_visible: model.pmfw_options.is_empty(), + set_visible: !model.hw_based_fan_curve.load(Ordering::SeqCst), }, gtk::Button { @@ -196,7 +199,7 @@ impl relm4::Component for FanCurveFrame { #[template] FanSettingRow { #[watch] - set_visible: model.pmfw_options.is_empty(), + set_visible: !model.hw_based_fan_curve.load(Ordering::SeqCst), #[template_child] label { @@ -220,7 +223,7 @@ impl relm4::Component for FanCurveFrame { #[template] FanSettingRow { #[watch] - set_visible: model.pmfw_options.is_empty(), + set_visible: !model.hw_based_fan_curve.load(Ordering::SeqCst), #[template_child] label { @@ -329,6 +332,7 @@ impl relm4::Component for FanCurveFrame { let mut model = Self { pmfw_options, + hw_based_fan_curve: Rc::new(AtomicBool::new(false)), is_dragging: Rc::new(AtomicBool::new(false)), speed_range: Rc::new(RefCell::new(DEFAULT_SPEED_RANGE)), temperature_range: Rc::new(RefCell::new(DEFAULT_TEMP_RANGE)), @@ -387,6 +391,8 @@ impl relm4::Component for FanCurveFrame { .collect(); *self.speed_range.borrow_mut() = msg.speed_range; *self.temperature_range.borrow_mut() = msg.temperature_range.clone(); + self.hw_based_fan_curve + .store(msg.hw_based, Ordering::SeqCst); for (adj, signal) in self.change_signals.iter() { adj.block_signal(signal); @@ -530,7 +536,7 @@ impl FanCurveFrame { } fn temp_keys_available(&self) -> bool { - self.pmfw_options.is_empty() + !self.hw_based_fan_curve.load(Ordering::SeqCst) && self.temp_keys.n_items() > 1 && (self.auto_threshold_adj.upper() == 0.0) // Disable key selection on nvidia }