From cad5ed89450a27ac8ec872da834c70416100de29 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Wed, 3 Sep 2025 17:08:05 +0200 Subject: [PATCH] kms: Don't attempt dmabuf import on software devices --- src/backend/kms/mod.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/backend/kms/mod.rs b/src/backend/kms/mod.rs index e2b8dcd0..1ae81293 100644 --- a/src/backend/kms/mod.rs +++ b/src/backend/kms/mod.rs @@ -437,16 +437,17 @@ impl KmsState { global: &DmabufGlobal, dmabuf: Dmabuf, ) -> Result { - let (expected_node, other_nodes) = - self.drm_devices - .values_mut() - .partition::, _>(|device| { - device - .socket - .as_ref() - .map(|s| &s.dmabuf_global == global) - .unwrap_or(false) - }); + let (expected_node, mut other_nodes) = self + .drm_devices + .values_mut() + .partition::, _>(|device| { + device + .socket + .as_ref() + .map(|s| &s.dmabuf_global == global) + .unwrap_or(false) + }); + other_nodes.retain(|device| device.socket.is_some()); let mut last_err = anyhow::anyhow!("Dmabuf cannot be imported on any gpu"); for device in expected_node.into_iter().chain(other_nodes.into_iter()) {