forge
Explore
Log in

Don't you dare go Hollow

tty: Move HDR property reset to session resume

Browse files at this commit

db32f52ce6627e246e49f58c3b5aea13e7ef1646Ivan MolodetskikhParent: 978aace
Not sure why it was in output config changed, but it shouldn't be there
as that's called quite frequently.
src/backend/tty.rsmodified+11 -12
@@ -466,6 +466,17 @@ impl Tty {
466466 // Apply pending gamma changes and restore our existing gamma.
467467 let device = self.devices.get_mut(&node).unwrap();
468468 for (crtc, surface) in device.surfaces.iter_mut() {
469+ if let Ok(props) =
470+ ConnectorProperties::try_new(&device.drm, surface.connector)
471+ {
472+ match reset_hdr(&props) {
473+ Ok(()) => (),
474+ Err(err) => debug!("couldn't reset HDR properties: {err:?}"),
475+ }
476+ } else {
477+ warn!("failed to get connector properties");
478+ };
479+
469480 if let Some(ramp) = surface.pending_gamma_change.take() {
470481 let ramp = ramp.as_deref();
471482 let res = if let Some(gamma_props) = &mut surface.gamma_props {
@@ -1977,18 +1988,6 @@ impl Tty {
19771988 continue;
19781989 }
19791990
1980- if let Ok(props) = ConnectorProperties::try_new(&device.drm, surface.connector) {
1981- match reset_hdr(&props) {
1982- Ok(()) => (),
1983- Err(err) => debug!(
1984- "output {:?}: couldn't reset HDR properties: {err:?}",
1985- surface.name.connector
1986- ),
1987- }
1988- } else {
1989- warn!("failed to get connector properties");
1990- };
1991-
19921991 // Check if we need to change the mode.
19931992 let Some(connector) = device.drm_scanner.connectors().get(&surface.connector)
19941993 else {