drm: Fix borked cleanup logic

This commit is contained in:
Victoria Brekenfeld 2022-07-15 19:35:36 +02:00
parent 0f57848fd2
commit 38ec635750

View file

@ -72,10 +72,17 @@ pub fn display_configuration(
for conn in connectors for conn in connectors
.iter() .iter()
.flat_map(|conn| device.get_connector(*conn).ok()) .flat_map(|conn| device.get_connector(*conn).ok())
.flat_map(|conn| conn.current_encoder()) .filter(|conn| {
.flat_map(|enc| device.get_encoder(enc).ok()) if let Some(enc) = conn.current_encoder() {
.flat_map(|enc| enc.crtc()) if let Some(enc) = device.get_encoder(enc).ok() {
.filter(|c| cleanup.contains(&c)) if let Some(crtc) = enc.crtc() {
return cleanup.contains(&crtc);
}
}
}
false
})
.map(|info| info.handle())
{ {
let crtc_id = get_prop(device, conn, "CRTC_ID")?; let crtc_id = get_prop(device, conn, "CRTC_ID")?;
req.add_property(conn, crtc_id, property::Value::CRTC(None)); req.add_property(conn, crtc_id, property::Value::CRTC(None));