From 58da1967401a08fce05f68e31c98baab474c3035 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 14 Nov 2023 08:33:56 -0800 Subject: [PATCH] Update `drm` to 0.11 Drm-rs now no longer requires separate generated bindings for each platform, so this fixes the build on architectures/OSes where drm didn't have bindings. It also now uses Rustix instead of Nix, but Nix is still used by the Wayland and X11 backends, until the next wayland-rs and x11rb release. This is not a breaking change since `drm` isn't exposed in the API. --- Cargo.toml | 2 +- src/kms.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index de77299..597f3d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ raw_window_handle = { package = "raw-window-handle", version = "0.6", features = [target.'cfg(all(unix, not(any(target_vendor = "apple", target_os = "android", target_os = "redox"))))'.dependencies] as-raw-xcb-connection = { version = "1.0.0", optional = true } bytemuck = { version = "1.12.3", optional = true } -drm = { version = "0.10.0", default-features = false, optional = true } +drm = { version = "0.11.0", default-features = false, optional = true } fastrand = { version = "2.0.0", optional = true } memmap2 = { version = "0.9.0", optional = true } rustix = { version = "0.38.19", features = ["fs", "mm", "shm", "std"], default-features = false, optional = true } diff --git a/src/kms.rs b/src/kms.rs index bcbdfff..6e041e6 100644 --- a/src/kms.rs +++ b/src/kms.rs @@ -340,8 +340,7 @@ impl BufferImpl<'_, D, W> { // returns `ENOSYS` and check that before allocating the above and running this. match self.display.dirty_framebuffer(self.front_fb, &rectangles) { Ok(()) => {} - Err(drm::SystemError::Unknown { errno }) - if errno as i32 == rustix::io::Errno::NOSYS.raw_os_error() => {} + Err(e) if e.raw_os_error() == Some(rustix::io::Errno::NOSYS.raw_os_error()) => {} Err(e) => { return Err(SoftBufferError::PlatformError( Some("failed to dirty framebuffer".into()),