kms: Don't attempt dmabuf import on software devices

This commit is contained in:
Victoria Brekenfeld 2025-09-03 17:08:05 +02:00 • committed by Victoria Brekenfeld
parent 70cd1842c1
commit cad5ed8945

View file

@ -437,16 +437,17 @@ impl KmsState {
global: &DmabufGlobal, global: &DmabufGlobal,
dmabuf: Dmabuf, dmabuf: Dmabuf,
) -> Result<DrmNode> { ) -> Result<DrmNode> {
let (expected_node, other_nodes) = let (expected_node, mut other_nodes) = self
self.drm_devices .drm_devices
.values_mut() .values_mut()
.partition::<Vec<_>, _>(|device| { .partition::<Vec<_>, _>(|device| {
device device
.socket .socket
.as_ref() .as_ref()
.map(|s| &s.dmabuf_global == global) .map(|s| &s.dmabuf_global == global)
.unwrap_or(false) .unwrap_or(false)
}); });
other_nodes.retain(|device| device.socket.is_some());
let mut last_err = anyhow::anyhow!("Dmabuf cannot be imported on any gpu"); 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()) { for device in expected_node.into_iter().chain(other_nodes.into_iter()) {