Repository navigation
vhost-device-gpu: Add blob resource support and Venus capset for virglrenderer backend - #988
Merged
Merged
Conversation
dorindabassey
requested review from
epilys,
stefano-garzarella,
stsquad and
vireshk
as code owners
August 3, 2026 16:11
dorindabassey
force-pushed
the
blob-resources-v3
branch
2 times, most recently
from
August 4, 2026 09:35
c5cc017 to
015a08c
Compare
Collaborator
Author
|
CI failing, passing depends on - rust-vmm/rust-vmm-container#149 |
4 tasks
dorindabassey
force-pushed
the
blob-resources-v3
branch
3 times, most recently
from
August 10, 2026 10:22
7e7cd16 to
da3259f
Compare
dorindabassey
force-pushed
the
blob-resources-v3
branch
4 times, most recently
from
August 19, 2026 09:32
15db044 to
9d25314
Compare
dorindabassey
force-pushed
the
blob-resources-v3
branch
6 times, most recently
from
September 2, 2026 14:52
5592003 to
2fe0a59
Compare
Collaborator
Author
|
Hi @stefano-garzarella and @epilys, this PR is ready for review now Thanks. |
dorindabassey
force-pushed
the
blob-resources-v3
branch
from
September 3, 2026 08:31
2fe0a59 to
5c33c3a
Compare
aesteve-rh
requested changes
Sep 18, 2026
Update virglrenderer-rs to pull in new API wrappers needed for Venus support: context_create_fence, context_poll, and export_resource_dmabuf. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Instead of hardcoding the capset indices, lookup the capset index dynamically based on the configured capsets in the config. Convert the capset bitmask to a capset ID using trailing_zeros() since bits() returns a power-of-2 bitmask, not the capset index. Signed-off-by: Matej Hrica <mhrica@redhat.com> Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Dispatch to context_create_fence() when the guest sets VIRTIO_GPU_FLAG_INFO_RING_IDX, and poll per-context fences in event_poll(). This is required for Venus multi-timeline fence signaling. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey
force-pushed
the
blob-resources-v3
branch
from
September 21, 2026 09:56
5c33c3a to
90cdaeb
Compare
dorindabassey
force-pushed
the
blob-resources-v3
branch
3 times, most recently
from
September 21, 2026 13:34
c11b250 to
7303896
Compare
aesteve-rh
reviewed
Sep 21, 2026
aesteve-rh
reviewed
Sep 21, 2026
aesteve-rh
reviewed
Sep 21, 2026
Implement blob resource creation, mapping, and unmapping for the virglrenderer backend. Blob resources enable zero-copy memory sharing between guest and host, required for Venus (Vulkan) and hardware- accelerated gfxstream rendering. This is an atomic feature requiring both vhost-user protocol infrastructure and virtio-gpu command handlers: SHMEM/Protocol Infrastructure: - Advertise SHMEM, BACKEND_REQ, and BACKEND_SEND_FD protocol features - Implement get_shmem_config() returning 8GB HOST_VISIBLE region size - Store backend_req_fd for SHMEM_MAP/UNMAP communication with frontend - Add VIRTIO_GPU_SHM_ID_HOST_VISIBLE field - Change attach_backing to take Arc<GuestMemoryMmap> to keep guest memory alive while blob resource iovecs reference it Blob Command Implementation: - resource_create_blob: convert HOST3D to HOST3D_GUEST memory type, create virglrenderer resource with guest-visible iovecs - resource_map_blob: map blob into SHMEM region, send offset to frontend via VHOST_USER_BACKEND_SHMEM_MAP - resource_unmap_blob: unmap from SHMEM, notify frontend via VHOST_USER_BACKEND_SHMEM_UNMAP - set_scanout: re-export dmabuf on every scanout (fixes Venus flickering with cached handles) - Added UUID field initialization in virglrenderer for blob resources - Added tests Code coverage drops by ~0.5% because blob resource integration paths (resource_create_blob with backing vecs, map/unmap SHMEM communication) require virglrenderer GPU context not available in CI. However manual testing in the guest with vkcube confirms functionality. Signed-off-by: Matej Hrica <mhrica@redhat.com> Co-authored-by: Dorinda Bassey <dbassey@redhat.com>
Expose Venus capability set support using the virglrenderer backend, enabled by the new blob resource support. Configure virglrenderer based on the user's capset selection. Enable virgl renderer if VIRGL or VIRGL2 capsets are requested, and Enable Venus/render-server if VENUS capset is requested. Signed-off-by: Matej Hrica <mhrica@redhat.com> Co-authored-by: Dorinda Bassey <dbassey@redhat.com>
Use String::from_utf8_lossy() instead of CStr::from_bytes_with_nul() since the virtio-gpu driver sends debug_name without null terminator. Signed-off-by: Matej Hrica <mhrica@redhat.com> Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Add the blob_alignment field to VirtioGpuConfig to match the virtio-gpu spec, and set it to the system page size. This is a new config introduced in the spec and QEMU. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Add test case for VIRTIO_GPU_CMD_SUBMIT_3D in test display_output. This exercises the submit_cmd and context_create_fence code paths that were previously untested. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey
force-pushed
the
blob-resources-v3
branch
from
September 21, 2026 14:40
7303896 to
33a19ae
Compare
aesteve-rh
approved these changes
Sep 21, 2026
aesteve-rh
left a comment
Collaborator
There was a problem hiding this comment.
Commit 4 is still a bit long, which makes it harder to review (not saying it needs another split, as we discussed that already!).
Either way, nothing major stood out on this pass. If we catch anything later it can be a follow-up.
Looks good to me, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
Implement blob resource creation, mapping, and unmapping for the
virglrenderer backend, using SHMEM_MAP/UNMAP via vhost-user-backend.
This also adds per-context fence support needed for Venus multi-timeline
signaling, dynamic capset index lookup, and Venus capset exposure.
Tested with vkcube in a QEMU guest. Testing with QEMU requires the
vhost-user-gpu SHMEM support patch:
https://lore.kernel.org/all/20260717134920.265128-4-dbassey@redhat.com/
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.