deps: Update drm-rs and gbm-rs

This commit is contained in:
Victoria Brekenfeld 2022-01-26 20:29:34 +01:00
parent 8558253b13
commit ac265a3d68
4 changed files with 37 additions and 45 deletions

View File

@ -25,9 +25,9 @@ cgmath = "0.18.0"
dbus = { version = "0.9.0", optional = true } dbus = { version = "0.9.0", optional = true }
downcast-rs = "1.2.0" downcast-rs = "1.2.0"
drm-fourcc = "^2.1.1" drm-fourcc = "^2.1.1"
drm = { version = "0.5.0", optional = true } drm = { version = "0.6.1", optional = true }
drm-ffi = { version = "0.2.0", optional = true } drm-ffi = { version = "0.2.1", optional = true }
gbm = { version = "0.7.0", optional = true, default-features = false, features = ["drm-support"] } gbm = { version = "0.8.0", optional = true, default-features = false, features = ["drm-support"] }
input = { version = "0.7", default-features = false, features=["libinput_1_14"], optional = true } input = { version = "0.7", default-features = false, features=["libinput_1_14"], optional = true }
indexmap = { version = "1.7", optional = true } indexmap = { version = "1.7", optional = true }
lazy_static = "1" lazy_static = "1"

View File

@ -242,7 +242,7 @@ impl<A: AsRawFd + 'static> AtomicDrmDevice<A> {
req.add_property(*crtc, *mode_prop, property::Value::Unknown(0)); req.add_property(*crtc, *mode_prop, property::Value::Unknown(0));
} }
self.fd self.fd
.atomic_commit(&[AtomicCommitFlags::AllowModeset], req) .atomic_commit(AtomicCommitFlags::ALLOW_MODESET, req)
.map_err(|source| Error::Access { .map_err(|source| Error::Access {
errmsg: "Failed to disable connectors", errmsg: "Failed to disable connectors",
dev: self.fd.dev_path(), dev: self.fd.dev_path(),
@ -282,7 +282,7 @@ impl<A: AsRawFd + 'static> Drop for AtomicDrmDevice<A> {
add_multiple_props(&mut req, &self.old_state.2); add_multiple_props(&mut req, &self.old_state.2);
add_multiple_props(&mut req, &self.old_state.3); add_multiple_props(&mut req, &self.old_state.3);
if let Err(err) = self.fd.atomic_commit(&[AtomicCommitFlags::AllowModeset], req) { if let Err(err) = self.fd.atomic_commit(AtomicCommitFlags::ALLOW_MODESET, req) {
error!(self.logger, "Failed to restore previous state. Error: {}", err); error!(self.logger, "Failed to restore previous state. Error: {}", err);
} }
} }

View File

@ -249,7 +249,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
)?; )?;
self.fd self.fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.map_err(|_| Error::TestFailed(self.crtc))?; .map_err(|_| Error::TestFailed(self.crtc))?;
@ -287,7 +287,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
)?; )?;
self.fd self.fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.map_err(|_| Error::TestFailed(self.crtc))?; .map_err(|_| Error::TestFailed(self.crtc))?;
@ -327,7 +327,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
self.fd self.fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.map_err(|_| Error::TestFailed(self.crtc))?; .map_err(|_| Error::TestFailed(self.crtc))?;
@ -367,7 +367,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
if let Err(err) = self if let Err(err) = self
.fd .fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.map_err(|_| Error::TestFailed(self.crtc)) .map_err(|_| Error::TestFailed(self.crtc))
@ -428,7 +428,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
)?; )?;
self.fd self.fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.map_err(|_| Error::TestFailed(self.crtc))?; .map_err(|_| Error::TestFailed(self.crtc))?;
@ -502,7 +502,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
if let Err(err) = self if let Err(err) = self
.fd .fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req.clone(), req.clone(),
) )
.map_err(|_| Error::TestFailed(self.crtc)) .map_err(|_| Error::TestFailed(self.crtc))
@ -530,10 +530,8 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
.fd .fd
.atomic_commit( .atomic_commit(
if event { if event {
&[
// on the atomic api we can modeset and trigger a page_flip event on the same call! // on the atomic api we can modeset and trigger a page_flip event on the same call!
AtomicCommitFlags::PageFlipEvent, AtomicCommitFlags::PAGE_FLIP_EVENT | AtomicCommitFlags::ALLOW_MODESET
AtomicCommitFlags::AllowModeset,
// we also *should* not need to wait for completion, like with `set_crtc`, // we also *should* not need to wait for completion, like with `set_crtc`,
// because we have tested this exact commit already, so we do not expect any errors later down the line. // because we have tested this exact commit already, so we do not expect any errors later down the line.
// //
@ -542,9 +540,8 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
// //
// so we skip this flag: // so we skip this flag:
// AtomicCommitFlags::Nonblock, // AtomicCommitFlags::Nonblock,
]
} else { } else {
&[AtomicCommitFlags::AllowModeset] AtomicCommitFlags::ALLOW_MODESET
}, },
req, req,
) )
@ -588,9 +585,9 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
self.fd self.fd
.atomic_commit( .atomic_commit(
if event { if event {
&[AtomicCommitFlags::PageFlipEvent, AtomicCommitFlags::Nonblock] AtomicCommitFlags::PAGE_FLIP_EVENT | AtomicCommitFlags::NONBLOCK
} else { } else {
&[AtomicCommitFlags::Nonblock] AtomicCommitFlags::NONBLOCK
}, },
req, req,
) )
@ -638,7 +635,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
let result = self let result = self
.fd .fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.is_ok(); .is_ok();
@ -676,7 +673,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
let result = self let result = self
.fd .fd
.atomic_commit( .atomic_commit(
&[AtomicCommitFlags::AllowModeset, AtomicCommitFlags::TestOnly], AtomicCommitFlags::ALLOW_MODESET | AtomicCommitFlags::TEST_ONLY,
req, req,
) )
.is_ok(); .is_ok();
@ -937,7 +934,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
let result = self let result = self
.fd .fd
.atomic_commit(&[AtomicCommitFlags::Nonblock], req) .atomic_commit(AtomicCommitFlags::NONBLOCK, req)
.map_err(|source| Error::Access { .map_err(|source| Error::Access {
errmsg: "Failed to commit on clear_plane", errmsg: "Failed to commit on clear_plane",
dev: self.fd.dev_path(), dev: self.fd.dev_path(),
@ -1029,7 +1026,7 @@ impl<A: AsRawFd + 'static> Drop for AtomicDrmSurface<A> {
req.add_property(self.crtc, *active_prop, property::Value::Boolean(false)); req.add_property(self.crtc, *active_prop, property::Value::Boolean(false));
req.add_property(self.crtc, *mode_prop, property::Value::Unknown(0)); req.add_property(self.crtc, *mode_prop, property::Value::Unknown(0));
if let Err(err) = self.fd.atomic_commit(&[AtomicCommitFlags::AllowModeset], req) { if let Err(err) = self.fd.atomic_commit(AtomicCommitFlags::ALLOW_MODESET, req) {
warn!(self.logger, "Unable to disable connectors: {}", err); warn!(self.logger, "Unable to disable connectors: {}", err);
} }
} }

View File

@ -289,18 +289,13 @@ impl<A: AsRawFd + 'static> LegacyDrmSurface<A> {
// this will result in wasting a frame, because this flip will need to wait // this will result in wasting a frame, because this flip will need to wait
// for `set_crtc`, but is necessary to drive the event loop and thus provide // for `set_crtc`, but is necessary to drive the event loop and thus provide
// a more consistent api. // a more consistent api.
ControlDevice::page_flip( ControlDevice::page_flip(&*self.fd, self.crtc, framebuffer, PageFlipFlags::EVENT, None).map_err(
&*self.fd, |source| Error::Access {
self.crtc,
framebuffer,
&[PageFlipFlags::PageFlipEvent],
None,
)
.map_err(|source| Error::Access {
errmsg: "Failed to queue page flip", errmsg: "Failed to queue page flip",
dev: self.fd.dev_path(), dev: self.fd.dev_path(),
source, source,
})?; },
)?;
} }
Ok(()) Ok(())
@ -318,9 +313,9 @@ impl<A: AsRawFd + 'static> LegacyDrmSurface<A> {
self.crtc, self.crtc,
framebuffer, framebuffer,
if event { if event {
&[PageFlipFlags::PageFlipEvent] PageFlipFlags::EVENT
} else { } else {
&[] PageFlipFlags::empty()
}, },
None, None,
) )