Update Smithay
For the `drm` protocol, we can't construct an `ImportNotifier`, since that is specifically based around `ZwpLinuxBufferParamsv1`. So we need a new method for importing with that protocol. This could be improved, but should match current behavior.
This commit is contained in:
parent
2ffb8068b8
commit
41a69cfc9f
7 changed files with 282 additions and 306 deletions
|
|
@ -1,10 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::state::{BackendData, State};
|
||||
use crate::state::State;
|
||||
use smithay::{
|
||||
backend::{allocator::dmabuf::Dmabuf, renderer::ImportDma},
|
||||
backend::allocator::dmabuf::Dmabuf,
|
||||
delegate_dmabuf,
|
||||
wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportError},
|
||||
wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportNotifier},
|
||||
};
|
||||
|
||||
impl DmabufHandler for State {
|
||||
|
|
@ -16,23 +16,10 @@ impl DmabufHandler for State {
|
|||
&mut self,
|
||||
global: &DmabufGlobal,
|
||||
dmabuf: Dmabuf,
|
||||
) -> Result<(), ImportError> {
|
||||
match &mut self.backend {
|
||||
BackendData::Kms(ref mut state) => state
|
||||
.dmabuf_imported(global, dmabuf)
|
||||
.map_err(|_| ImportError::Failed),
|
||||
BackendData::Winit(ref mut state) => state
|
||||
.backend
|
||||
.renderer()
|
||||
.import_dmabuf(&dmabuf, None)
|
||||
.map(|_| ())
|
||||
.map_err(|_| ImportError::Failed),
|
||||
BackendData::X11(ref mut state) => state
|
||||
.renderer
|
||||
.import_dmabuf(&dmabuf, None)
|
||||
.map(|_| ())
|
||||
.map_err(|_| ImportError::Failed),
|
||||
_ => unreachable!("No backend set when importing dmabuf"),
|
||||
import_notifier: ImportNotifier,
|
||||
) {
|
||||
if self.backend.dmabuf_imported(global, dmabuf).is_err() {
|
||||
import_notifier.failed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
19
src/wayland/handlers/drm.rs
Normal file
19
src/wayland/handlers/drm.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::{
|
||||
state::State,
|
||||
wayland::protocols::drm::{DrmHandler, ImportError},
|
||||
};
|
||||
use smithay::{backend::allocator::dmabuf::Dmabuf, wayland::dmabuf::DmabufGlobal};
|
||||
|
||||
impl DrmHandler for State {
|
||||
fn dmabuf_imported(
|
||||
&mut self,
|
||||
global: &DmabufGlobal,
|
||||
dmabuf: Dmabuf,
|
||||
) -> Result<(), ImportError> {
|
||||
self.backend
|
||||
.dmabuf_imported(global, dmabuf)
|
||||
.map_err(|_| ImportError::Failed)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ pub mod data_control;
|
|||
pub mod data_device;
|
||||
pub mod decoration;
|
||||
pub mod dmabuf;
|
||||
pub mod drm;
|
||||
pub mod drm_lease;
|
||||
pub mod fractional_scale;
|
||||
pub mod input_method;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue