From f0e00846086b8f56b1103a80a13db38749816bc0 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 20 Aug 2025 10:03:51 -0700 Subject: [PATCH] Update `smithay`, and adjust to use sync points from blit calls --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/backend/kms/surface/mod.rs | 3 ++- src/backend/render/mod.rs | 9 ++++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac2f2a27..8f18e0aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4792,7 +4792,7 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smithay" version = "0.7.0" -source = "git+https://github.com/smithay/smithay.git?rev=ae1faae#ae1faaeb71e2664f4ddb3db7423a5ec746a6a51d" +source = "git+https://github.com/smithay/smithay.git?rev=20d2dac#20d2dacd71394b5f96f6ace0a70a6f20dc62c0c6" dependencies = [ "aliasable", "appendlist", diff --git a/Cargo.toml b/Cargo.toml index a74d22c6..cb9c9f25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -146,4 +146,4 @@ cosmic-protocols = { git = "https://github.com/pop-os//cosmic-protocols", branch cosmic-client-toolkit = { git = "https://github.com/pop-os//cosmic-protocols", branch = "main" } [patch.crates-io] -smithay = { git = "https://github.com/smithay/smithay.git", rev = "ae1faae" } +smithay = { git = "https://github.com/smithay/smithay.git", rev = "20d2dac" } diff --git a/src/backend/kms/surface/mod.rs b/src/backend/kms/surface/mod.rs index 7a752723..5cd08519 100644 --- a/src/backend/kms/surface/mod.rs +++ b/src/backend/kms/surface/mod.rs @@ -1729,7 +1729,8 @@ fn send_screencopy_result<'a>( if let Some(fb) = fb.as_mut() { for rect in adjusted.iter().copied() { - renderer + // TODO: On Vulkan, may need to combine sync points instead of just using latest? + sync = renderer .blit(&mut tex_fb, fb, rect, rect, TextureFilter::Linear) .map_err( RenderError::<::Error>::Rendering, diff --git a/src/backend/render/mod.rs b/src/backend/render/mod.rs index 94c3e4e9..3883fce4 100644 --- a/src/backend/render/mod.rs +++ b/src/backend/render/mod.rs @@ -1379,14 +1379,17 @@ where elements.truncate(old_len); } + let mut sync = SyncPoint::default(); + if let (Some(damage), _) = &res { + // TODO: On Vulkan, may need to combine sync points instead of just using latest? let blit_to_buffer = |renderer: &mut R, blit_from: &mut R::Framebuffer<'_>| { if let Ok(dmabuf) = get_dmabuf(buffer) { let mut dmabuf_clone = dmabuf.clone(); let mut fb = renderer.bind(&mut dmabuf_clone)?; for rect in damage.iter() { - renderer.blit( + sync = renderer.blit( blit_from, &mut fb, *rect, @@ -1398,7 +1401,7 @@ where let fb = offscreen .expect("shm buffers should have offscreen target"); for rect in damage.iter() { - renderer.blit( + sync = renderer.blit( blit_from, fb, *rect, @@ -1425,7 +1428,7 @@ where Ok(RenderOutputResult { damage: res.0, - sync: SyncPoint::default(), + sync, states: res.1, }) },