Skip to content

vhost-device-gpu: Add blob resource support and Venus capset for virglrenderer backend - #988

Open
dorindabassey wants to merge 9 commits into
rust-vmm:mainfrom
dorindabassey:blob-resources-v3
Open

vhost-device-gpu: Add blob resource support and Venus capset for virglrenderer backend#988
dorindabassey wants to merge 9 commits into
rust-vmm:mainfrom
dorindabassey:blob-resources-v3

Conversation

@dorindabassey

@dorindabassey dorindabassey commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@dorindabassey dorindabassey changed the title gpu: Add blob resource support vhost-device-gpu: Add blob resource support Aug 4, 2026
@dorindabassey dorindabassey changed the title vhost-device-gpu: Add blob resource support vhost-device-gpu: Add blob resource support and Venus capset for virglrenderer backend Aug 4, 2026
@dorindabassey
dorindabassey force-pushed the blob-resources-v3 branch 2 times, most recently from c5cc017 to 015a08c Compare August 4, 2026 09:35
@dorindabassey

Copy link
Copy Markdown
Collaborator Author

CI failing, passing depends on - rust-vmm/rust-vmm-container#149

Dorinda Bassey and others added 8 commits August 5, 2026 12:13
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>
Implement blob resource support and shared memory mapping. This is
required for Venus support and gfxstream-{vulkan, gles} enablement.

Updated to use vhost 0.17 and vhost-user-backend 0.23 for shmem.
Added UUID field initialization for blob resources using Uuid::new_v4().

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.

Signed-off-by: Matej Hrica <mhrica@redhat.com>
The test was trying to obtain capset info for 3 capsets, but only 2 were
configured. The test previously passed because the virgl backend incorrectly
returned information for the additional capset. Now with 3 capsets (VIRGL,
VIRGL2, VENUS), update the test to properly iterate over all configured capsets.

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>
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>
@dorindabassey
dorindabassey force-pushed the blob-resources-v3 branch 2 times, most recently from 7e7cd16 to da3259f Compare August 10, 2026 10:22
Add the blob_alignment field to VirtioGpuConfig to match
the virtio-gpu spec. 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants