kms: Cleanup now that output_elements won't panic for uninitialized outputs
This commit is contained in:
parent
db13eea91c
commit
bebd7c5c40
2 changed files with 12 additions and 25 deletions
|
|
@ -44,10 +44,7 @@ use std::{
|
|||
borrow::BorrowMut,
|
||||
collections::{HashMap, HashSet},
|
||||
path::Path,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc, RwLock,
|
||||
},
|
||||
sync::{atomic::AtomicBool, Arc, RwLock},
|
||||
};
|
||||
|
||||
mod device;
|
||||
|
|
@ -649,19 +646,14 @@ impl KmsState {
|
|||
.context("Failed to enable devices")?;
|
||||
}
|
||||
|
||||
let startup_done = startup_done.load(Ordering::SeqCst);
|
||||
let mut all_outputs = Vec::new();
|
||||
for device in self.drm_devices.values_mut() {
|
||||
let now = clock.now();
|
||||
let mut output_map = device
|
||||
let output_map = device
|
||||
.surfaces
|
||||
.iter()
|
||||
.filter(|(_, s)| s.is_active())
|
||||
.map(|(crtc, surface)| (*crtc, surface.output.clone()))
|
||||
.collect::<HashMap<_, _>>();
|
||||
if !startup_done {
|
||||
output_map.clear();
|
||||
}
|
||||
|
||||
// configure primary scanout allowance
|
||||
if !device.surfaces.is_empty() {
|
||||
|
|
@ -675,13 +667,12 @@ impl KmsState {
|
|||
device
|
||||
.surfaces
|
||||
.values()
|
||||
.filter(|s| s.output.is_enabled())
|
||||
.filter(|s| s.output.is_enabled() && s.output.mirroring().is_none())
|
||||
.count()
|
||||
<= 1,
|
||||
&mut renderer,
|
||||
clock,
|
||||
&shell,
|
||||
startup_done,
|
||||
)
|
||||
.context("Failed to switch primary-plane scanout flags")?;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue