fix(wayland): no more external dmabufs

This commit is contained in:
Nova
2023-09-03 17:55:22 -04:00
parent 5360230ca7
commit 9042a004d3
2 changed files with 15 additions and 15 deletions

View File

@@ -51,7 +51,6 @@ rustc-hash = "1.1.0"
tokio = { version = "1.27.0", features = ["rt-multi-thread", "signal"] } tokio = { version = "1.27.0", features = ["rt-multi-thread", "signal"] }
send_wrapper = "0.6.0" send_wrapper = "0.6.0"
prisma = "0.1.1" prisma = "0.1.1"
xkbcommon = { version = "0.5.0", default-features = false, optional = true }
stardust-xr = "0.14.0" stardust-xr = "0.14.0"
directories = "5.0.0" directories = "5.0.0"
serde = { version = "1.0.160", features = ["derive"] } serde = { version = "1.0.160", features = ["derive"] }
@@ -62,11 +61,7 @@ global_counter = "0.2.2"
rand = "0.8.5" rand = "0.8.5"
atty = "0.2.14" atty = "0.2.14"
[dependencies.stereokit] xkbcommon = { version = "0.5.0", default-features = false, optional = true }
default-features = false
features = ["linux-egl"]
version = "0.16.9"
[dependencies.smithay] [dependencies.smithay]
# git = "https://github.com/technobaboo/smithay.git" # Until we get stereokit to understand OES samplers and external textures # git = "https://github.com/technobaboo/smithay.git" # Until we get stereokit to understand OES samplers and external textures
git = "https://github.com/smithay/smithay.git" # Until we get stereokit to understand OES samplers and external textures git = "https://github.com/smithay/smithay.git" # Until we get stereokit to understand OES samplers and external textures
@@ -76,6 +71,11 @@ features = ["desktop", "backend_drm", "renderer_gl", "wayland_frontend"]
version = "*" version = "*"
optional = true optional = true
[dependencies.stereokit]
default-features = false
features = ["linux-egl"]
version = "0.16.9"
[dependencies.console-subscriber] [dependencies.console-subscriber]
version = "0.1.8" version = "0.1.8"
optional = true optional = true

View File

@@ -2,11 +2,7 @@ use crate::wayland::seat::SeatData;
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
use parking_lot::Mutex; use parking_lot::Mutex;
use smithay::{ use smithay::{
backend::{ backend::{allocator::dmabuf::Dmabuf, egl::EGLDevice, renderer::gles::GlesRenderer},
allocator::dmabuf::Dmabuf,
egl::EGLDevice,
renderer::{gles::GlesRenderer, ImportDma},
},
delegate_dmabuf, delegate_output, delegate_shm, delegate_dmabuf, delegate_output, delegate_shm,
output::{Mode, Output, Scale, Subpixel}, output::{Mode, Output, Scale, Subpixel},
reexports::{ reexports::{
@@ -92,11 +88,16 @@ impl WaylandState {
let render_node = EGLDevice::device_for_display(renderer.egl_context().display()) let render_node = EGLDevice::device_for_display(renderer.egl_context().display())
.and_then(|device| device.try_get_render_node()); .and_then(|device| device.try_get_render_node());
let dmabuf_formats = renderer
.egl_context()
.dmabuf_render_formats()
.iter()
.cloned()
.collect::<Vec<_>>();
let dmabuf_default_feedback = match render_node { let dmabuf_default_feedback = match render_node {
Ok(Some(node)) => { Ok(Some(node)) => {
let dmabuf_formats = renderer.dmabuf_formats().collect::<Vec<_>>();
let dmabuf_default_feedback = let dmabuf_default_feedback =
DmabufFeedbackBuilder::new(node.dev_id(), dmabuf_formats) DmabufFeedbackBuilder::new(node.dev_id(), dmabuf_formats.clone())
.build() .build()
.unwrap(); .unwrap();
Some(dmabuf_default_feedback) Some(dmabuf_default_feedback)
@@ -120,10 +121,9 @@ impl WaylandState {
); );
(dmabuf_state, dmabuf_global, Some(default_feedback)) (dmabuf_state, dmabuf_global, Some(default_feedback))
} else { } else {
let dmabuf_formats = renderer.dmabuf_formats().collect::<Vec<_>>();
let mut dmabuf_state = DmabufState::new(); let mut dmabuf_state = DmabufState::new();
let dmabuf_global = let dmabuf_global =
dmabuf_state.create_global::<WaylandState>(&display_handle, dmabuf_formats); dmabuf_state.create_global::<WaylandState>(&display_handle, dmabuf_formats.clone());
(dmabuf_state, dmabuf_global, None) (dmabuf_state, dmabuf_global, None)
}; };