From db32f52ce6627e246e49f58c3b5aea13e7ef1646 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 29 Oct 2025 09:29:33 +0300 Subject: tty: Move HDR property reset to session resume Not sure why it was in output config changed, but it shouldn't be there as that's called quite frequently. --- src/backend/tty.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 3d8bdcd0..79f39a4c 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -466,6 +466,17 @@ impl Tty { // Apply pending gamma changes and restore our existing gamma. let device = self.devices.get_mut(&node).unwrap(); for (crtc, surface) in device.surfaces.iter_mut() { + if let Ok(props) = + ConnectorProperties::try_new(&device.drm, surface.connector) + { + match reset_hdr(&props) { + Ok(()) => (), + Err(err) => debug!("couldn't reset HDR properties: {err:?}"), + } + } else { + warn!("failed to get connector properties"); + }; + if let Some(ramp) = surface.pending_gamma_change.take() { let ramp = ramp.as_deref(); let res = if let Some(gamma_props) = &mut surface.gamma_props { @@ -1977,18 +1988,6 @@ impl Tty { continue; } - if let Ok(props) = ConnectorProperties::try_new(&device.drm, surface.connector) { - match reset_hdr(&props) { - Ok(()) => (), - Err(err) => debug!( - "output {:?}: couldn't reset HDR properties: {err:?}", - surface.name.connector - ), - } - } else { - warn!("failed to get connector properties"); - }; - // Check if we need to change the mode. let Some(connector) = device.drm_scanner.connectors().get(&surface.connector) else { -- cgit