Skip to content

Commit

Permalink
Update drm and gbm dependencies
Browse files Browse the repository at this point in the history
Fixes #3669
  • Loading branch information
tronical committed Mar 20, 2024
1 parent db08970 commit 5aa2d7c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/backends/linuxkms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ calloop = { version = "0.12.3" }
libseat = { version = "0.2.1", optional = true, default-features = false }
nix = { version = "0.27.0", features=["fs"] }
vulkano = { version = "0.34.0", optional = true, default-features = false }
drm = { version = "0.9.0", optional = true }
gbm = { version = "0.12.0", optional = true, default-features = false, features = ["drm-support"] }
drm = { version = "0.11.1", optional = true }
gbm = { version = "0.14.2", optional = true, default-features = false, features = ["drm-support"] }
gbm-sys = { version = "0.2.2", optional = true }
glutin = { workspace = true, optional = true, default-features = false, features = ["libloading", "egl"] }
raw-window-handle = { version = "0.5.2", optional = true }
15 changes: 13 additions & 2 deletions internal/backends/linuxkms/display/gbmdisplay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,19 @@ impl super::Presenter for GbmDisplay {
gbm_rs_workaround::GbmBo { bo, surface }
};

// TODO: support modifiers
let flags = if drm::buffer::PlanarBuffer::modifier(&front_buffer)
.map_or(false, |modifier| !matches!(modifier, drm::buffer::DrmModifier::Invalid))
{
drm::control::FbCmd2Flags::MODIFIERS
} else {
drm::control::FbCmd2Flags::empty()
};

// TODO: consider falling back to the old non-planar API
let fb = self
.drm_output
.drm_device
.add_planar_framebuffer(&front_buffer, &[None, None, None, None], 0)
.add_planar_framebuffer(&front_buffer, flags)
.map_err(|e| format!("Error adding gbm buffer as framebuffer: {e}"))?;

front_buffer
Expand Down Expand Up @@ -251,5 +258,9 @@ mod gbm_rs_workaround {

offsets
}

fn modifier(&self) -> Option<drm::buffer::DrmModifier> {
Some(unsafe { gbm_sys::gbm_bo_get_modifier(self.bo) }.into())
}
}
}
2 changes: 1 addition & 1 deletion internal/backends/linuxkms/drmoutput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl DrmOutput {
return Ok(());
}

let source = calloop::generic::Generic::new_with_error::<drm::SystemError>(
let source = calloop::generic::Generic::new_with_error::<std::io::Error>(
self.drm_device.0.clone(),
calloop::Interest::READ,
calloop::Mode::Level,
Expand Down

0 comments on commit 5aa2d7c

Please sign in to comment.