[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a8405071-8489-4965-9a59-fc58f78cb250@collabora.com>
Date: Wed, 10 Dec 2025 19:51:23 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: Val Packett <val@...isiblethingslab.com>,
David Airlie <airlied@...hat.com>, Gerd Hoffmann <kraxel@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu
<olvaffe@...il.com>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
Simona Vetter <simona@...ll.ch>, Vivek Kasireddy <vivek.kasireddy@...el.com>
Cc: Dongwon Kim <dongwon.kim@...el.com>,
Christian Koenig <christian.koenig@....com>,
dri-devel@...ts.freedesktop.org, virtualization@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/virtio: Allow importing prime buffers when 3D is
enabled
Hi,
On 12/10/25 18:39, Val Packett wrote:
> 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@...isiblethingslab.com>
> ---
>
> Hi. I couldn't find any comments on that line in the reviews (on patchwork), so I assume
> there was never a specific technical reason for that check, just an abundance of caution?
>
> BTW, while here.. The drm_gem_prime_import "fallback" seems pretty much equivalent to
> `return (-ENODEV)`, as drm_gem_prime_import(_dev) just translates the call to
> gem_prime_import_sg_table which we don't use. Should it be replaced with `return (-ENODEV)`?
Returning -ENODEV should break dmabuf self-importing where virtio-gpu
driver export dmabuf and then imports to itself.
> ---
> drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c
> index ce49282198cb..2fedd5d3bd62 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_prime.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c
> @@ -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);
At a quick glance the change looks fine. Will take another stab after
Holidays and merge if no problems will be spotted. Thanks.
--
Best regards,
Dmitry
Powered by blists - more mailing lists