From d72bf5462836b497c47aa9e607d99d4ffaaffb67 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 18 Nov 2024 19:48:17 +0100 Subject: [PATCH] deps: Update smithay --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/backend/kms/surface/mod.rs | 28 +++++++++++++++++++--------- src/backend/winit.rs | 10 +++++++--- src/backend/x11.rs | 10 +++++++--- src/wayland/handlers/data_device.rs | 3 ++- 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14d41d8d..d759d8ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4667,7 +4667,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/smithay//smithay?rev=ace2e6a#ace2e6a9197f4b4173dea13d53d280d82f3a99c6" +source = "git+https://github.com/smithay//smithay?rev=bc1d732#bc1d7320f95cdf17f9e7aa6867cccc5903548032" dependencies = [ "appendlist", "ash 0.38.0+1.3.281", diff --git a/Cargo.toml b/Cargo.toml index b0c1a4a6..6b8e669d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,4 +119,4 @@ inherits = "release" lto = "fat" [patch."https://github.com/Smithay/smithay.git"] -smithay = { git = "https://github.com/smithay//smithay", rev = "ace2e6a" } +smithay = { git = "https://github.com/smithay//smithay", rev = "bc1d732" } diff --git a/src/backend/kms/surface/mod.rs b/src/backend/kms/surface/mod.rs index 0353c7db..8ec9dad0 100644 --- a/src/backend/kms/surface/mod.rs +++ b/src/backend/kms/surface/mod.rs @@ -67,6 +67,7 @@ use smithay::{ utils::{Buffer as BufferCoords, Clock, Monotonic, Physical, Rectangle, Size, Transform}, wayland::{ dmabuf::{get_dmabuf, DmabufFeedbackBuilder}, + presentation::Refresh, seat::WaylandFocus, shm::{shm_format_to_fourcc, with_buffer_contents}, }, @@ -757,15 +758,24 @@ impl SurfaceThreadState { ) }; - feedback.presented( - clock, - self.output - .current_mode() - .map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64)) - .unwrap_or_default(), - sequence as u64, - flags, - ); + let rate = self + .output + .current_mode() + .map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64)); + let refresh = match rate { + Some(rate) + if self + .compositor + .as_ref() + .is_some_and(|comp| comp.vrr_enabled()) => + { + Refresh::Variable(rate) + } + Some(rate) => Refresh::Fixed(rate), + None => Refresh::Unknown, + }; + + feedback.presented(clock, refresh, sequence as u64, flags); self.timings.presented(clock); diff --git a/src/backend/winit.rs b/src/backend/winit.rs index 1bf3f527..a1a2bdce 100644 --- a/src/backend/winit.rs +++ b/src/backend/winit.rs @@ -29,7 +29,7 @@ use smithay::{ winit::platform::pump_events::PumpStatus, }, utils::Transform, - wayland::dmabuf::DmabufFeedbackBuilder, + wayland::{dmabuf::DmabufFeedbackBuilder, presentation::Refresh}, }; use std::{borrow::BorrowMut, cell::RefCell, time::Duration}; use tracing::{error, info, warn}; @@ -84,8 +84,12 @@ impl WinitState { state.clock.now(), self.output .current_mode() - .map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64)) - .unwrap_or_default(), + .map(|mode| { + Refresh::Fixed(Duration::from_secs_f64( + 1_000.0 / mode.refresh as f64, + )) + }) + .unwrap_or(Refresh::Unknown), 0, wp_presentation_feedback::Kind::Vsync, ); diff --git a/src/backend/x11.rs b/src/backend/x11.rs index 75096edd..ba33c14b 100644 --- a/src/backend/x11.rs +++ b/src/backend/x11.rs @@ -36,7 +36,7 @@ use smithay::{ wayland_server::DisplayHandle, }, utils::{DeviceFd, Transform}, - wayland::dmabuf::DmabufFeedbackBuilder, + wayland::{dmabuf::DmabufFeedbackBuilder, presentation::Refresh}, }; use std::{borrow::BorrowMut, cell::RefCell, os::unix::io::OwnedFd, time::Duration}; use tracing::{debug, error, info, warn}; @@ -234,8 +234,12 @@ impl Surface { state.clock.now(), self.output .current_mode() - .map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64)) - .unwrap_or_default(), + .map(|mode| { + Refresh::Fixed(Duration::from_secs_f64( + 1_000.0 / mode.refresh as f64, + )) + }) + .unwrap_or(Refresh::Unknown), 0, wp_presentation_feedback::Kind::Vsync, ) diff --git a/src/wayland/handlers/data_device.rs b/src/wayland/handlers/data_device.rs index 913aef92..672a7cb7 100644 --- a/src/wayland/handlers/data_device.rs +++ b/src/wayland/handlers/data_device.rs @@ -97,7 +97,8 @@ impl ClientDndGrabHandler for State { .lock() .unwrap() = icon.map(|surface| DnDIcon { surface, offset }) } - fn dropped(&mut self, seat: Seat) { + + fn dropped(&mut self, _target: Option, _validated: bool, seat: Seat) { seat.user_data() .get::>>() .unwrap()