diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-29 09:29:33 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-29 09:29:39 +0300 |
| commit | db32f52ce6627e246e49f58c3b5aea13e7ef1646 (patch) | |
| tree | e1207a05f67a780050e0941cbe766c271d8b1b16 /src | |
| parent | 978aace94d6a6907d13b69e8421c82f0e485278b (diff) | |
| download | niri-db32f52ce6627e246e49f58c3b5aea13e7ef1646.tar.gz niri-db32f52ce6627e246e49f58c3b5aea13e7ef1646.tar.bz2 niri-db32f52ce6627e246e49f58c3b5aea13e7ef1646.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/tty.rs | 23 |
1 files changed, 11 insertions, 12 deletions
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 { |
