]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/virtio: Allow importing prime buffers when 3D is enabled
authorVal Packett <val@invisiblethingslab.com>
Wed, 10 Dec 2025 15:39:23 +0000 (12:39 -0300)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Wed, 11 Feb 2026 23:30:03 +0000 (02:30 +0300)
This functionality was added for using a KMS-only virtgpu with a physical
(or SR-IOV) headless GPU in passthrough, but it should not be restricted
to KMS-only mode. It can be used with cross-domain to pass guest memfds
to the host compositor with zero copies (using udmabuf on both sides).

Drop the check for the absence of virgl_3d to allow for more use cases.

Fixes: ca77f27a2665 ("drm/virtio: Import prime buffers from other devices as guest blobs")
Signed-off-by: Val Packett <val@invisiblethingslab.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patch.msgid.link/20251210154755.1119861-2-val@invisiblethingslab.com
drivers/gpu/drm/virtio/virtgpu_prime.c

index 19c78dd2ca7795533af6b58d9bbf9440f58f58b8..693575e24db096d6a54eb62916d19754e2bae747 100644 (file)
@@ -312,7 +312,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,
                }
        }
 
-       if (!vgdev->has_resource_blob || vgdev->has_virgl_3d)
+       if (!vgdev->has_resource_blob)
                return drm_gem_prime_import(dev, buf);
 
        bo = kzalloc(sizeof(*bo), GFP_KERNEL);