From 2d0f1cbf2be311b91096b2f2332cd7bafabbfde3 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Tue, 2 Jul 2024 13:15:19 +0200 Subject: [PATCH] chore: smithay update --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/backend/kms/surface/mod.rs | 3 +-- src/wayland/handlers/drm_lease.rs | 21 ++++++++++++++++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64f6f73c..cfa3b0c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4856,7 +4856,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/smithay//smithay?rev=a1650f8#a1650f8568ad8bf0fd7844e98f4724d769cd3c75" +source = "git+https://github.com/smithay//smithay?rev=3731734#3731734d5a0409186a0475238ffe46e2835cee6d" dependencies = [ "appendlist", "ash 0.38.0+1.3.281", diff --git a/Cargo.toml b/Cargo.toml index b45bec33..a427a23e 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 = "a1650f8"} +smithay = {git = "https://github.com/smithay//smithay", rev = "3731734"} diff --git a/src/backend/kms/surface/mod.rs b/src/backend/kms/surface/mod.rs index 5c085465..1a51816e 100644 --- a/src/backend/kms/surface/mod.rs +++ b/src/backend/kms/surface/mod.rs @@ -402,8 +402,7 @@ impl Surface { ) -> Result<()> { let (tx, rx) = std::sync::mpsc::sync_channel(1); self.plane_formats = surface - .planes() - .primary + .plane_info() .formats .iter() .copied() diff --git a/src/wayland/handlers/drm_lease.rs b/src/wayland/handlers/drm_lease.rs index 026b6db3..16196a97 100644 --- a/src/wayland/handlers/drm_lease.rs +++ b/src/wayland/handlers/drm_lease.rs @@ -46,9 +46,24 @@ impl DrmLeaseHandler for State { .drm .planes(crtc) .map_err(LeaseRejected::with_cause)?; - builder.add_plane(planes.primary.handle); - if let Some(cursor) = planes.cursor { - builder.add_plane(cursor.handle); + let (primary_plane, primary_plane_claim) = planes + .primary + .iter() + .find_map(|plane| { + backend + .drm + .claim_plane(plane.handle, *crtc) + .map(|claim| (plane, claim)) + }) + .ok_or_else(LeaseRejected::default)?; + builder.add_plane(primary_plane.handle, primary_plane_claim); + if let Some((cursor, claim)) = planes.cursor.and_then(|plane| { + backend + .drm + .claim_plane(plane.handle, *crtc) + .map(|claim| (plane, claim)) + }) { + builder.add_plane(cursor.handle, claim); } } else { tracing::warn!(