Update Smithay (presentation-time v2)
Browse files at this commit70f96cca0a2b985dcc7298b4a87a2f0819991878Parent: 4e357e95 changed files +25 -18
- Cargo.lock +8 -8
- src/backend/headless.rs +2 -1
- src/backend/tty.rs +12 -4
- src/backend/winit.rs +2 -4
- src/pw_utils.rs +1 -1
Cargo.lockmodified+8 -8
| @@ -1337,9 +1337,9 @@ dependencies = [ | |||
| 1337 | 1337 | ||
| 1338 | [[package]] | 1338 | [[package]] |
| 1339 | name = "gbm" | 1339 | name = "gbm" |
| 1340 | -version = "0.16.0" | 1340 | +version = "0.18.0" |
| 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1342 | -checksum = "c724107aa10444b1d2709aae4727c18a33c16b3e15ea8a46cc4ae226c084c88a" | 1342 | +checksum = "ce852e998d3ca5e4a97014fb31c940dc5ef344ec7d364984525fd11e8a547e6a" |
| 1343 | dependencies = [ | 1343 | dependencies = [ |
| 1344 | "bitflags 2.6.0", | 1344 | "bitflags 2.6.0", |
| 1345 | "drm", | 1345 | "drm", |
| @@ -1352,9 +1352,9 @@ dependencies = [ | |||
| 1352 | 1352 | ||
| 1353 | [[package]] | 1353 | [[package]] |
| 1354 | name = "gbm-sys" | 1354 | name = "gbm-sys" |
| 1355 | -version = "0.3.1" | 1355 | +version = "0.4.0" |
| 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1357 | -checksum = "a9cc2f64de9fa707b5c6b2d2f10d7a7e49e845018a9f5685891eb40d3bab2538" | 1357 | +checksum = "c13a5f2acc785d8fb6bf6b7ab6bfb0ef5dad4f4d97e8e70bb8e470722312f76f" |
| 1358 | dependencies = [ | 1358 | dependencies = [ |
| 1359 | "libc", | 1359 | "libc", |
| 1360 | ] | 1360 | ] |
| @@ -3093,9 +3093,9 @@ dependencies = [ | |||
| 3093 | 3093 | ||
| 3094 | [[package]] | 3094 | [[package]] |
| 3095 | name = "pixman" | 3095 | name = "pixman" |
| 3096 | -version = "0.1.0" | 3096 | +version = "0.2.0" |
| 3097 | source = "registry+https://github.com/rust-lang/crates.io-index" | 3097 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3098 | -checksum = "d24a24da0bec14f4e43a495c1837a3c358b87532e7fe66bd75c348b89f0451b6" | 3098 | +checksum = "459d9be014c5e9725153de54b1cacd6f5bbe258aba7daae10e76ca2cda0ad8c2" |
| 3099 | dependencies = [ | 3099 | dependencies = [ |
| 3100 | "drm-fourcc", | 3100 | "drm-fourcc", |
| 3101 | "paste", | 3101 | "paste", |
| @@ -3727,7 +3727,7 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" | |||
| 3727 | [[package]] | 3727 | [[package]] |
| 3728 | name = "smithay" | 3728 | name = "smithay" |
| 3729 | version = "0.3.0" | 3729 | version = "0.3.0" |
| 3730 | -source = "git+https://github.com/Smithay/smithay.git#b8292400ea7d137946099e941bf3985ade3ecf91" | 3730 | +source = "git+https://github.com/Smithay/smithay.git#c3f3ac8dc0776d47bc50f9a1911b613a56e6e04b" |
| 3731 | dependencies = [ | 3731 | dependencies = [ |
| 3732 | "appendlist", | 3732 | "appendlist", |
| 3733 | "bitflags 2.6.0", | 3733 | "bitflags 2.6.0", |
| @@ -3799,7 +3799,7 @@ dependencies = [ | |||
| 3799 | [[package]] | 3799 | [[package]] |
| 3800 | name = "smithay-drm-extras" | 3800 | name = "smithay-drm-extras" |
| 3801 | version = "0.1.0" | 3801 | version = "0.1.0" |
| 3802 | -source = "git+https://github.com/Smithay/smithay.git#b8292400ea7d137946099e941bf3985ade3ecf91" | 3802 | +source = "git+https://github.com/Smithay/smithay.git#c3f3ac8dc0776d47bc50f9a1911b613a56e6e04b" |
| 3803 | dependencies = [ | 3803 | dependencies = [ |
| 3804 | "drm", | 3804 | "drm", |
| 3805 | "libdisplay-info", | 3805 | "libdisplay-info", |
src/backend/headless.rsmodified+2 -1
| @@ -13,6 +13,7 @@ use smithay::backend::renderer::gles::GlesRenderer; | |||
| 13 | use smithay::output::{Mode, Output, PhysicalProperties, Subpixel}; | 13 | use smithay::output::{Mode, Output, PhysicalProperties, Subpixel}; |
| 14 | use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; | 14 | use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; |
| 15 | use smithay::utils::Size; | 15 | use smithay::utils::Size; |
| 16 | +use smithay::wayland::presentation::Refresh; | ||
| 16 | 17 | ||
| 17 | use super::{IpcOutputMap, OutputId, RenderResult}; | 18 | use super::{IpcOutputMap, OutputId, RenderResult}; |
| 18 | use crate::niri::{Niri, RedrawState}; | 19 | use crate::niri::{Niri, RedrawState}; |
| @@ -102,7 +103,7 @@ impl Headless { | |||
| 102 | let mut presentation_feedbacks = niri.take_presentation_feedbacks(output, &states); | 103 | let mut presentation_feedbacks = niri.take_presentation_feedbacks(output, &states); |
| 103 | presentation_feedbacks.presented::<_, smithay::utils::Monotonic>( | 104 | presentation_feedbacks.presented::<_, smithay::utils::Monotonic>( |
| 104 | get_monotonic_time(), | 105 | get_monotonic_time(), |
| 105 | - std::time::Duration::ZERO, | 106 | + Refresh::Unknown, |
| 106 | 0, | 107 | 0, |
| 107 | wp_presentation_feedback::Kind::empty(), | 108 | wp_presentation_feedback::Kind::empty(), |
| 108 | ); | 109 | ); |
src/backend/tty.rsmodified+12 -4
| @@ -50,6 +50,7 @@ use smithay::wayland::dmabuf::{DmabufFeedback, DmabufFeedbackBuilder, DmabufGlob | |||
| 50 | use smithay::wayland::drm_lease::{ | 50 | use smithay::wayland::drm_lease::{ |
| 51 | DrmLease, DrmLeaseBuilder, DrmLeaseRequest, DrmLeaseState, LeaseRejected, | 51 | DrmLease, DrmLeaseBuilder, DrmLeaseRequest, DrmLeaseState, LeaseRejected, |
| 52 | }; | 52 | }; |
| 53 | +use smithay::wayland::presentation::Refresh; | ||
| 53 | use smithay_drm_extras::drm_scanner::{DrmScanEvent, DrmScanner}; | 54 | use smithay_drm_extras::drm_scanner::{DrmScanEvent, DrmScanner}; |
| 54 | use wayland_protocols::wp::linux_dmabuf::zv1::server::zwp_linux_dmabuf_feedback_v1::TrancheFlags; | 55 | use wayland_protocols::wp::linux_dmabuf::zv1::server::zwp_linux_dmabuf_feedback_v1::TrancheFlags; |
| 55 | use wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; | 56 | use wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; |
| @@ -1233,10 +1234,17 @@ impl Tty { | |||
| 1233 | // Mark the last frame as submitted. | 1234 | // Mark the last frame as submitted. |
| 1234 | match surface.compositor.frame_submitted() { | 1235 | match surface.compositor.frame_submitted() { |
| 1235 | Ok(Some((mut feedback, target_presentation_time))) => { | 1236 | Ok(Some((mut feedback, target_presentation_time))) => { |
| 1236 | - let refresh = output_state | 1237 | + let refresh = match output_state.frame_clock.refresh_interval() { |
| 1237 | - .frame_clock | 1238 | + Some(refresh) => { |
| 1238 | - .refresh_interval() | 1239 | + if output_state.frame_clock.vrr() { |
| 1239 | - .unwrap_or(Duration::ZERO); | 1240 | + Refresh::Variable(refresh) |
| 1241 | + } else { | ||
| 1242 | + Refresh::Fixed(refresh) | ||
| 1243 | + } | ||
| 1244 | + } | ||
| 1245 | + None => Refresh::Unknown, | ||
| 1246 | + }; | ||
| 1247 | + | ||
| 1240 | // FIXME: ideally should be monotonically increasing for a surface. | 1248 | // FIXME: ideally should be monotonically increasing for a surface. |
| 1241 | let seq = meta.sequence as u64; | 1249 | let seq = meta.sequence as u64; |
| 1242 | let mut flags = wp_presentation_feedback::Kind::Vsync | 1250 | let mut flags = wp_presentation_feedback::Kind::Vsync |
src/backend/winit.rsmodified+2 -4
| @@ -3,7 +3,6 @@ use std::collections::HashMap; | |||
| 3 | use std::mem; | 3 | use std::mem; |
| 4 | use std::rc::Rc; | 4 | use std::rc::Rc; |
| 5 | use std::sync::{Arc, Mutex}; | 5 | use std::sync::{Arc, Mutex}; |
| 6 | -use std::time::Duration; | ||
| 7 | 6 | ||
| 8 | use niri_config::{Config, OutputName}; | 7 | use niri_config::{Config, OutputName}; |
| 9 | use smithay::backend::allocator::dmabuf::Dmabuf; | 8 | use smithay::backend::allocator::dmabuf::Dmabuf; |
| @@ -16,6 +15,7 @@ use smithay::reexports::calloop::LoopHandle; | |||
| 16 | use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; | 15 | use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; |
| 17 | use smithay::reexports::winit::dpi::LogicalSize; | 16 | use smithay::reexports::winit::dpi::LogicalSize; |
| 18 | use smithay::reexports::winit::window::Window; | 17 | use smithay::reexports::winit::window::Window; |
| 18 | +use smithay::wayland::presentation::Refresh; | ||
| 19 | 19 | ||
| 20 | use super::{IpcOutputMap, OutputId, RenderResult}; | 20 | use super::{IpcOutputMap, OutputId, RenderResult}; |
| 21 | use crate::niri::{Niri, RedrawState, State}; | 21 | use crate::niri::{Niri, RedrawState, State}; |
| @@ -216,11 +216,9 @@ impl Winit { | |||
| 216 | self.backend.submit(Some(damage)).unwrap(); | 216 | self.backend.submit(Some(damage)).unwrap(); |
| 217 | 217 | ||
| 218 | let mut presentation_feedbacks = niri.take_presentation_feedbacks(output, &res.states); | 218 | let mut presentation_feedbacks = niri.take_presentation_feedbacks(output, &res.states); |
| 219 | - let mode = output.current_mode().unwrap(); | ||
| 220 | - let refresh = Duration::from_secs_f64(1_000f64 / mode.refresh as f64); | ||
| 221 | presentation_feedbacks.presented::<_, smithay::utils::Monotonic>( | 219 | presentation_feedbacks.presented::<_, smithay::utils::Monotonic>( |
| 222 | get_monotonic_time(), | 220 | get_monotonic_time(), |
| 223 | - refresh, | 221 | + Refresh::Unknown, |
| 224 | 0, | 222 | 0, |
| 225 | wp_presentation_feedback::Kind::empty(), | 223 | wp_presentation_feedback::Kind::empty(), |
| 226 | ); | 224 | ); |
src/pw_utils.rsmodified+1 -1
| @@ -1027,7 +1027,7 @@ fn allocate_buffer( | |||
| 1027 | .create_buffer_object_with_modifiers2::<()>(w, h, fourcc, modifiers, flags) | 1027 | .create_buffer_object_with_modifiers2::<()>(w, h, fourcc, modifiers, flags) |
| 1028 | .context("error creating GBM buffer object")?; | 1028 | .context("error creating GBM buffer object")?; |
| 1029 | 1029 | ||
| 1030 | - let modifier = bo.modifier().unwrap(); | 1030 | + let modifier = bo.modifier(); |
| 1031 | let buffer = GbmBuffer::from_bo(bo, false); | 1031 | let buffer = GbmBuffer::from_bo(bo, false); |
| 1032 | Ok((buffer, modifier)) | 1032 | Ok((buffer, modifier)) |
| 1033 | } | 1033 | } |