From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Val Packett <val@invisiblethingslab.com>,
David Airlie <airlied@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Gurchetan Singh <gurchetansingh@chromium.org>,
Chia-I Wu <olvaffe@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Simona Vetter <simona@ffwll.ch>,
Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>,
Christian Koenig <christian.koenig@amd.com>,
dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/virtio: Allow importing prime buffers when 3D is enabled
Date: Thu, 11 Dec 2025 06:51:46 +0300 [thread overview]
Message-ID: <5b0a15d1-6912-4a0b-acdc-ace4f7aa33e6@collabora.com> (raw)
In-Reply-To: <1005ebfc-6f0e-477f-afae-2d42b44a5fa3@invisiblethingslab.com>
On 12/11/25 01:11, Val Packett wrote:
>
> On 12/10/25 1:51 PM, Dmitry Osipenko wrote:
>> 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@invisiblethingslab.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.
>
> Hm, I don't think so because the self-import case (for when `buf->ops ==
> &virtgpu_dmabuf_ops`) is handled right here, right above this check.
>
> drm_gem_prime_import would handle the self-import for `buf->ops ==
> &drm_gem_prime_dmabuf_ops` which shouldn't be the case since we have
> `virtgpu_dmabuf_ops`..
Indeed, then it should be redundant. Practically, there should be no
difference with removal of drm_gem_prime_import() and
virtgpu_gem_prime_import_sg_table() from the code. Not sure if changing
it will be worthwhile.
--
Best regards,
Dmitry
next prev parent reply other threads:[~2025-12-11 3:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 15:39 Val Packett
2025-12-10 16:51 ` Dmitry Osipenko
2025-12-10 22:11 ` Val Packett
2025-12-11 3:51 ` Dmitry Osipenko [this message]
2026-02-11 22:58 ` Dmitry Osipenko
2026-02-11 23:35 ` Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5b0a15d1-6912-4a0b-acdc-ace4f7aa33e6@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=airlied@redhat.com \
--cc=christian.koenig@amd.com \
--cc=dongwon.kim@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=olvaffe@gmail.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=val@invisiblethingslab.com \
--cc=virtualization@lists.linux.dev \
--cc=vivek.kasireddy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®