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.
This commit is contained in:
Ivan Molodetskikh
2025-10-29 09:29:33 +03:00
parent 978aace94d
commit db32f52ce6
+11 -12
View File
@@ -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 {