kms: Don't join on DrmSurface drop
This commit is contained in:
parent
458f5f4dcf
commit
cd1117080c
3 changed files with 22 additions and 9 deletions
|
|
@ -494,8 +494,9 @@ impl State {
|
||||||
if let Some(mut leasing_global) = device.inner.leasing_global.take() {
|
if let Some(mut leasing_global) = device.inner.leasing_global.take() {
|
||||||
leasing_global.disable_global::<State>();
|
leasing_global.disable_global::<State>();
|
||||||
}
|
}
|
||||||
for surface in device.inner.surfaces.values_mut() {
|
for (_, surface) in device.inner.surfaces.drain() {
|
||||||
outputs_removed.push(surface.output.clone());
|
outputs_removed.push(surface.output.clone());
|
||||||
|
surface.drop_and_join();
|
||||||
}
|
}
|
||||||
if let Some(token) = device.event_token.take() {
|
if let Some(token) = device.event_token.take() {
|
||||||
self.common.event_loop_handle.remove(token);
|
self.common.event_loop_handle.remove(token);
|
||||||
|
|
|
||||||
|
|
@ -705,11 +705,9 @@ impl<'a> KmsGuard<'a> {
|
||||||
.crtcs()
|
.crtcs()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|crtc| {
|
.filter(|crtc| {
|
||||||
!device
|
!device.inner.surfaces.get(crtc).is_some()
|
||||||
.inner
|
// TODO: We can't do this. See https://github.com/Smithay/smithay/pull/1820
|
||||||
.surfaces
|
//.is_some_and(|surface| surface.output.is_enabled())
|
||||||
.get(crtc)
|
|
||||||
.is_some_and(|surface| surface.output.is_enabled())
|
|
||||||
})
|
})
|
||||||
.copied()
|
.copied()
|
||||||
.collect::<HashSet<crtc::Handle>>();
|
.collect::<HashSet<crtc::Handle>>();
|
||||||
|
|
|
||||||
|
|
@ -468,6 +468,16 @@ impl Surface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn drop_and_join(mut self) {
|
||||||
|
let thread = self.thread.take();
|
||||||
|
let _ = self;
|
||||||
|
if let Some(thread) = thread {
|
||||||
|
let name = thread.thread().name().unwrap().to_string();
|
||||||
|
let _ = thread.join();
|
||||||
|
info!("Thread {} terminated.", name)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Surface {
|
impl Drop for Surface {
|
||||||
|
|
@ -475,9 +485,13 @@ impl Drop for Surface {
|
||||||
let _ = self.thread_command.send(ThreadCommand::End);
|
let _ = self.thread_command.send(ThreadCommand::End);
|
||||||
self.loop_handle.remove(self.thread_token);
|
self.loop_handle.remove(self.thread_token);
|
||||||
if let Some(thread) = self.thread.take() {
|
if let Some(thread) = self.thread.take() {
|
||||||
let name = thread.thread().name().unwrap().to_string();
|
let _ = thread;
|
||||||
let _ = thread.join();
|
// We want to do this, but this currently deadlocks on `apply_config_for_outputs`.
|
||||||
info!("Thread {} terminated.", name)
|
/*
|
||||||
|
let name = thread.thread().name().unwrap().to_string();
|
||||||
|
let _ = thread.join();
|
||||||
|
info!("Thread {} terminated.", name)
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue