1
0
Fork 0
forked from wry/wry

metal: unset O_NONBLOCK for DRM file descriptors

This commit is contained in:
Julian Orth 2024-10-19 08:58:29 +02:00
parent 2a3a924f7e
commit 3f001588b8
2 changed files with 17 additions and 2 deletions

View file

@ -8,7 +8,10 @@ use {
dbus::{DbusError, TRUE},
udev::UdevDevice,
utils::{
bitflags::BitflagsExt, cell_ext::CellExt, errorfmt::ErrorFmt, nonblock::set_nonblock,
bitflags::BitflagsExt,
cell_ext::CellExt,
errorfmt::ErrorFmt,
nonblock::{set_block, set_nonblock},
},
video::drm::DrmMaster,
wire_dbus::org::freedesktop::login1::session::{
@ -236,6 +239,12 @@ impl MetalBackend {
return;
}
};
if let Err(e) = set_block(res.fd.raw()) {
log::error!(
"Could not set drm file descriptor to blocking: {}",
ErrorFmt(e),
);
}
let master = match DrmMaster::new(&slf.state.ring, res.fd.clone()) {
Ok(m) => Rc::new(m),
Err(e) => {