All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] virtio-gpu: add F_BLOB_GUEST_SHAREABLE (ex CREATE_GUEST_HANDLE) and F_BLOB_CTX_ID_FIX
@ 2026-11-24 21:19 Val Packett
  2026-11-24 21:19 ` [PATCH v3 1/3] virtio-gpu: document individual blob_flags Val Packett
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Val Packett @ 2026-11-24 21:19 UTC (permalink / raw)
  To: virtio-comment
  Cc: Val Packett, Gurchetan Singh, Sergio Lopez, Parav Pandit,
	dmitry.osipenko, mst, Marek Marczykowski-Górecki,
	Alyssa Ross, Demi Marie Obenour

Hi,

I've been working on actually implementing the "lost" CREATE_GUEST_HANDLE
feature which allows guest-only blobs to be shareable, particularly enabling
PRIME-imported (from udmabuf or passthru dGPUs) buffers to be shared with
the host Wayland compositor when using the cross-domain context type.

This version renames the feature from F_CREATE_GUEST_HANDLE (which was too
host/implementation-centric really) to F_BLOB_GUEST_SHAREABLE, and removes
the new blob creation flag in favor of reusing the existing one,
VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE. While here, I documented all three
existing flags properly, including which kinds of resources they work with.

It seems correct to me to reuse the SHAREABLE flag because the semantics are
the same. Sharing between virtio-gpu contexts *is* what the guest relies on
to instruct the host to effectively share across host processes!

The flag has *not* been used with guest-only blobs when 3d contexts are
present before. The Linux driver did set the SHAREABLE flag in PRIME import
code, but PRIME import was restricted to devices that did *NOT* support
3d contexts at all. In Mesa, the use of SHAREABLE corresponds to "being able
to DMA-BUF export" (non-empty VkExternalMemoryHandleTypeFlags for Venus,
!RADEON_FLAG_NO_INTERPROCESS_SHARING for amdgpu). These are all exactly
the semantics that match the cross-process/dma-buf kind of shareability
on the host side.


Also addressed feedback: now BLOB_GUEST_SHAREABLE depends on BLOB_CTX_ID_FIX
(therefore BLOB_CTX_ID_FIX is introduced first); s/rendering context/context/.

Hopefully third time's the charm :)


v2: https://lore.kernel.org/all/20260903021442.423274-1-val@invisiblethingslab.com/
v1 has been lost to the moderation queue.


Thanks,
~val

---

Val Packett (3):
  virtio-gpu: document individual blob_flags
  virtio-gpu: introduce BLOB_CTX_ID_FIX feature
  virtio-gpu: introduce BLOB_GUEST_SHAREABLE feature

 device-types/gpu/description.tex | 34 +++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-24 22:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 21:19 [PATCH v3 0/3] virtio-gpu: add F_BLOB_GUEST_SHAREABLE (ex CREATE_GUEST_HANDLE) and F_BLOB_CTX_ID_FIX Val Packett
2026-11-24 21:19 ` [PATCH v3 1/3] virtio-gpu: document individual blob_flags Val Packett
2026-11-24 21:19 ` [PATCH v3 2/3] virtio-gpu: introduce BLOB_CTX_ID_FIX feature Val Packett
2026-11-24 21:19 ` [PATCH v3 3/3] virtio-gpu: introduce BLOB_GUEST_SHAREABLE feature Val Packett
2026-11-24 22:44 ` [PATCH v3 0/3] virtio-gpu: add F_BLOB_GUEST_SHAREABLE (ex CREATE_GUEST_HANDLE) and F_BLOB_CTX_ID_FIX Demi Marie Obenour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.