forge
Explore
Log in

Don't you dare go Hollow

tty: Log on DrmScanEvent::Changed

Browse files at this commit

a217ad6424e58198519e2776bc3949bf92311960Ivan MolodetskikhParent: f4dc10e
src/backend/tty.rsmodified+26 -0
@@ -979,6 +979,32 @@ impl Tty {
979979 } => {
980980 removed.push(crtc);
981981 }
982+ // Emitted when the list of connector modes changes at runtime.
983+ //
984+ // Some devices, notably USB-C docks with DP-MST/alt-mode, report Connected before
985+ // the EDID has been read, with an empty mode list. Then, at a later point, the
986+ // modes will be populated, at which point we'll get this Changed event.
987+ DrmScanEvent::Changed {
988+ connector,
989+ crtc: Some(crtc),
990+ } => {
991+ let connector_name = format_connector_name(&connector);
992+ let name = make_output_name(&device.drm, connector.handle(), connector_name);
993+ debug!(
994+ "connector changed: {} \"{}\"",
995+ &name.connector,
996+ name.format_make_model_serial(),
997+ );
998+
999+ if !device.known_crtcs.contains_key(&crtc) {
1000+ // I guess this can happen if the connector initially wasn't mapped to a
1001+ // CRTC but then got mapped before being changed.
1002+ warn!("changed connector missing from known crtcs");
1003+ }
1004+
1005+ // We don't actually need to do anything here; on_output_config_changed() will
1006+ // take care of picking a new mode if needed.
1007+ }
9821008 _ => (),
9831009 }
9841010 }