Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3 backports #192

Merged
merged 4 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.3.4
* Fix buffer age on Wayland. (#191)
* Update `drm` to 0.11. (#178)
* Fixes build on architectures where drm-rs did not have generated bindings.

# 0.3.3
* Fix bad file descriptor crash on X11. (#168)

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "softbuffer"
version = "0.3.3"
version = "0.3.4"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Cross-platform software buffer"
Expand Down Expand Up @@ -31,7 +31,7 @@ raw-window-handle = "0.5.0"
[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 }
Expand Down
3 changes: 1 addition & 2 deletions src/kms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ impl BufferImpl<'_> {
// 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()),
Expand Down
6 changes: 3 additions & 3 deletions src/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ impl WaylandImpl {
.dispatch_pending(&mut State);

if let Some((front, back)) = &mut self.buffers {
// Swap front and back buffer
std::mem::swap(front, back);

front.age = 1;
if back.age != 0 {
back.age += 1;
}

// Swap front and back buffer
std::mem::swap(front, back);

front.attach(&self.surface);

// Like Mesa's EGL/WSI implementation, we damage the whole buffer with `i32::MAX` if
Expand Down
5 changes: 4 additions & 1 deletion src/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
use crate::error::SwResultExt;
use crate::{Rect, SoftBufferError};
use raw_window_handle::{XcbDisplayHandle, XcbWindowHandle, XlibDisplayHandle, XlibWindowHandle};
use rustix::{fd::{AsFd, BorrowedFd, OwnedFd}, mm, shm as posix_shm};
use rustix::{
fd::{AsFd, BorrowedFd, OwnedFd},
mm, shm as posix_shm,
};

use std::{
fmt,
Expand Down