aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-10-13 10:33:51 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-10-13 13:30:36 +0400
commit0a3274749563067b06af83f870ff39dc503a5355 (patch)
tree5758345ca1ad71fcc1564a5675b039a801aa138a /src/backend
parentf625dede1a2a002527f8297cfecef8b0bd4b10a2 (diff)
downloadniri-0a3274749563067b06af83f870ff39dc503a5355.tar.gz
niri-0a3274749563067b06af83f870ff39dc503a5355.tar.bz2
niri-0a3274749563067b06af83f870ff39dc503a5355.zip
Send dmabuf feedbacks from the backend
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/mod.rs3
-rw-r--r--src/backend/tty.rs11
-rw-r--r--src/backend/winit.rs5
3 files changed, 7 insertions, 12 deletions
diff --git a/src/backend/mod.rs b/src/backend/mod.rs
index 532b8a9c..0fa7bf59 100644
--- a/src/backend/mod.rs
+++ b/src/backend/mod.rs
@@ -4,7 +4,6 @@ use std::time::Duration;
use smithay::backend::renderer::gles::GlesRenderer;
use smithay::output::Output;
-use smithay::wayland::dmabuf::DmabufFeedback;
use crate::input::CompositorMod;
use crate::niri::OutputRenderElements;
@@ -49,7 +48,7 @@ impl Backend {
output: &Output,
elements: &[OutputRenderElements<GlesRenderer>],
target_presentation_time: Duration,
- ) -> Option<&DmabufFeedback> {
+ ) {
match self {
Backend::Tty(tty) => tty.render(niri, output, elements, target_presentation_time),
Backend::Winit(winit) => winit.render(niri, output, elements),
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index a1c75c8d..74f3e9ed 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -837,18 +837,18 @@ impl Tty {
output: &Output,
elements: &[OutputRenderElements<GlesRenderer>],
target_presentation_time: Duration,
- ) -> Option<&DmabufFeedback> {
+ ) {
let span = tracy_client::span!("Tty::render");
let Some(device) = self.output_device.as_mut() else {
error!("missing output device");
- return None;
+ return;
};
let tty_state: &TtyOutputState = output.user_data().get().unwrap();
let Some(surface) = device.surfaces.get_mut(&tty_state.crtc) else {
error!("missing surface");
- return None;
+ return;
};
span.emit_text(&surface.name);
@@ -873,6 +873,7 @@ impl Tty {
}
niri.update_primary_scanout_output(output, &res.states);
+ niri.send_dmabuf_feedbacks(output, &surface.dmabuf_feedback);
if res.damage.is_some() {
let presentation_feedbacks =
@@ -895,7 +896,7 @@ impl Tty {
}
};
- return Some(&surface.dmabuf_feedback);
+ return;
}
Err(err) => {
error!("error queueing frame: {err}");
@@ -914,8 +915,6 @@ impl Tty {
// Queue a timer to fire at the predicted vblank time.
queue_estimated_vblank_timer(niri, output.clone(), target_presentation_time);
-
- None
}
pub fn change_vt(&mut self, vt: i32) {
diff --git a/src/backend/winit.rs b/src/backend/winit.rs
index 41da8ab6..508f4cf0 100644
--- a/src/backend/winit.rs
+++ b/src/backend/winit.rs
@@ -16,7 +16,6 @@ use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_pre
use smithay::reexports::winit::dpi::LogicalSize;
use smithay::reexports::winit::window::WindowBuilder;
use smithay::utils::Transform;
-use smithay::wayland::dmabuf::DmabufFeedback;
use crate::config::Config;
use crate::niri::{OutputRenderElements, RedrawState, State};
@@ -152,7 +151,7 @@ impl Winit {
niri: &mut Niri,
output: &Output,
elements: &[OutputRenderElements<GlesRenderer>],
- ) -> Option<&DmabufFeedback> {
+ ) {
let _span = tracy_client::span!("Winit::render");
self.backend.bind().unwrap();
@@ -201,8 +200,6 @@ impl Winit {
if output_state.unfinished_animations_remain {
self.backend.window().request_redraw();
}
-
- None
}
pub fn toggle_debug_tint(&mut self) {