forge
Explore
Log in

Don't you dare go Hollow

Update Smithay and fix winit presentation time

Browse files at this commit

682182f3633276cdb27aa7fdc028443ff0aa9e13Ivan MolodetskikhParent: 9b4a8fe
Cargo.lockmodified+2 -2
@@ -1858,7 +1858,7 @@ checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
18581858 [[package]]
18591859 name = "smithay"
18601860 version = "0.3.0"
1861-source = "git+https://github.com/YaLTeR/smithay.git?branch=pointer-gestures#07b89166679ae280acff8aff93d0ecbbbbbcef5c"
1861+source = "git+https://github.com/YaLTeR/smithay.git?branch=pointer-gestures#6d2e4f9cb25f1846fad5820528f1caa68eff6985"
18621862 dependencies = [
18631863 "appendlist",
18641864 "bitflags 2.4.0",
@@ -1920,7 +1920,7 @@ dependencies = [
19201920 [[package]]
19211921 name = "smithay-drm-extras"
19221922 version = "0.1.0"
1923-source = "git+https://github.com/YaLTeR/smithay.git?branch=pointer-gestures#07b89166679ae280acff8aff93d0ecbbbbbcef5c"
1923+source = "git+https://github.com/YaLTeR/smithay.git?branch=pointer-gestures#6d2e4f9cb25f1846fad5820528f1caa68eff6985"
19241924 dependencies = [
19251925 "drm",
19261926 "edid-rs",
src/backend/tty.rsmodified+9 -14
@@ -338,9 +338,8 @@ impl Tty {
338338 Ok(Some(mut feedback)) => {
339339 let refresh = output_state
340340 .frame_clock
341- .refresh_interval_ns()
342- .and_then(|r| u32::try_from(r.get()).ok())
343- .unwrap_or(0);
341+ .refresh_interval()
342+ .unwrap_or(Duration::ZERO);
344343 // FIXME: ideally should be monotonically increasing for a surface.
345344 let seq = metadata.as_ref().unwrap().sequence as u64;
346345 let flags = wp_presentation_feedback::Kind::Vsync
@@ -516,19 +515,15 @@ impl Tty {
516515 crtc,
517516 });
518517
519- let mut planes = surface.planes().unwrap();
518+ let mut planes = surface.planes().clone();
520519 // Disable overlay planes as they cause weird performance issues on my system.
521520 planes.overlay.clear();
522- let scanout_formats = surface
523- .supported_formats(planes.primary.handle)
524- .unwrap()
525- .into_iter()
526- .chain(
527- planes
528- .overlay
529- .iter()
530- .flat_map(|p| surface.supported_formats(p.handle).unwrap()),
531- )
521+ let scanout_formats = planes
522+ .primary
523+ .formats
524+ .iter()
525+ .chain(planes.overlay.iter().flat_map(|p| &p.formats))
526+ .copied()
532527 .collect::<HashSet<_>>();
533528 let scanout_formats = scanout_formats.intersection(&device.formats).copied();
534529
src/backend/winit.rsmodified+2 -1
@@ -143,7 +143,8 @@ impl Winit {
143143 self.backend.submit(Some(&damage)).unwrap();
144144
145145 let mut presentation_feedbacks = niri.take_presentation_feedbacks(output, &res.states);
146- let refresh = output.current_mode().unwrap().refresh as u32;
146+ let mode = output.current_mode().unwrap();
147+ let refresh = Duration::from_secs_f64(1_000f64 / mode.refresh as f64);
147148 presentation_feedbacks.presented::<_, smithay::utils::Monotonic>(
148149 get_monotonic_time(),
149150 refresh,
src/frame_clock.rsmodified+2 -1
@@ -24,8 +24,9 @@ impl FrameClock {
2424 }
2525 }
2626
27- pub fn refresh_interval_ns(&self) -> Option<NonZeroU64> {
27+ pub fn refresh_interval(&self) -> Option<Duration> {
2828 self.refresh_interval_ns
29+ .map(|r| Duration::from_nanos(r.get()))
2930 }
3031
3132 pub fn presented(&mut self, presentation_time: Duration) {