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 {
466 // Apply pending gamma changes and restore our existing gamma.466 // Apply pending gamma changes and restore our existing gamma.
467 let device = self.devices.get_mut(&node).unwrap();467 let device = self.devices.get_mut(&node).unwrap();
468 for (crtc, surface) in device.surfaces.iter_mut() {468 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+
469 if let Some(ramp) = surface.pending_gamma_change.take() {480 if let Some(ramp) = surface.pending_gamma_change.take() {
470 let ramp = ramp.as_deref();481 let ramp = ramp.as_deref();
471 let res = if let Some(gamma_props) = &mut surface.gamma_props {482 let res = if let Some(gamma_props) = &mut surface.gamma_props {
@@ -1977,18 +1988,6 @@ impl Tty {
1977 continue;1988 continue;
1978 }1989 }
1979 1990
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-
1992 // Check if we need to change the mode.1991 // Check if we need to change the mode.
1993 let Some(connector) = device.drm_scanner.connectors().get(&surface.connector)1992 let Some(connector) = device.drm_scanner.connectors().get(&surface.connector)
1994 else {1993 else {