Skip to content

RFC Support mapping virtio-gpu virgl hostmem blobs using MAP_FIXED API

Dmitry Osipenko qemu-devel 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 RFC Latest5 patches 2 repliesIn review
  2. v9 RFC5 patches 7 repliesSuperseded
  3. v8 RFC4 patches 3 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v7 RFC4 patches1 replySuperseded
v6 RFC4 patches2 repliesSuperseded
v5 RFC4 patches2 repliesSuperseded
v4 RFC7 patches11 repliesSuperseded
v3 RFC7 patches9 repliesSuperseded
v2 RFC2 patches7 repliesSuperseded
v1 RFC1 patch4 repliesSuperseded

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5virtio-gpu: Remove superfluous memory_region_set_enabled()hw/display/virtio-gpu-virgl.c+0 -20 replies
2/5virtio-gpu: Validate hostmem mapping offsethw/display/virtio-gpu-virgl.c+10 -00 replies
3/5virtio-gpu: Replace finish_unmapping with mapping_statehw/display/trace-events hw/display/virtio-gpu-virgl.c+23 -70 replies
4/5virtio-gpu: Destroy virgl resources on virtio-gpu resethw/display/virtio-gpu-gl.c hw/display/virtio-gpu-virgl.c include/hw/virtio/virtio-gpu.h+101 -400 replies
5/5virtio-gpu: Support mapping hostmem blobs with map_fixedhw/display/virtio-gpu-gl.c hw/display/virtio-gpu-virgl.c include/hw/virtio/virtio-gpu.h+100 -22 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchAkihiko OdakiAlex BennéeYiwei Zhang
1/5R-b R-b
2/5
3/5
4/5
5/5T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v10 thread

Cover letter [RFC PATCH v10 0/5] Support mapping virtio-gpu virgl hostmem blobs using MAP_FIXED API

Virglrender got a new API that allows mapping host blobs at a given memory address using MAP_FIXED mmap flag [1]. Usage of this new API brings major performance and stability improvement for venus and drm native contexts, see commit message of the RFC patch for details.

Sending early to collect review feeback and have patch prepared by the time new version of libvirglrenderer will be released with the stabilized API.

[1] https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1374

Based-on: [email protected]

Changelog:

v10:- Changed mapping_state switch-case to use fallthrough as was suggested
by Akihiko Odaki.

v9: - Added patch converting finish_unmapping to mapping_state that was
suggested by Akihiko Odaki to address MR unmapping problem that may arise on resetting virtio-gpu.

- Changed virtio_gpu_virgl_reset() to return true/false. Suggested by Akihiko Odaki.

- Made virtio_gpu_virgl_reset() and virtio_gpu_virgl_init() static.

v8: - Added virtio_gpu_virgl_update_render_state() to virgl_resume_cmdq_bh(),
making sure that GPU is reset once cmd execution is resumed after suspencion. Suggested by Akihiko Odaki.

v7: - Changed virtio_gpu_virgl_reset() to keep virtio-gpu in reset state
when reset fails and renamed cmd_suspended -> suspended argument of resource_unref(), as was suggested by Akihiko Odaki.

v6: - Updated comment for virtio_gpu_virgl_reset(), removing part
telling that reset at "runtime" is unexpected and removing excessive error message about a failed reset. Requested by Akihiko Odaki.

v5: - Switched to use error_setg_errno() for qemu_ram_mmap() error
handling, as was suggested Akihiko Odaki.

- Added r-b from Alex Bennée to the first patch.

- Moved hostmem mapping offset validation to upper function as was suggested by Alex Bennée.

- Dropped all patches and changes that made funcs to return -1 since it was rejected by Alex Bennée. Refactoring can be done later on in a separate patchset.

- Extended clarifying comment of virtio_gpu_virgl_reset().

v4: - Addressed v3 review comments from Akihiko Odaki.

- Dropped patch making resource_unmap() error reported as a host failure instead of guest and added patch improving resource_map_blob() error reporting.

- Re-added CONFIG_WIN32 checks.

- Added clarifying comment to virtio_gpu_virgl_reset() RE unsupported context restoring.

v3: - Addressed v2 review comments from Akihiko Odaki.

- Droped check for CONFIG_WIN32. My current understanding that MAP_FIXED is supported by Cygwin.

- Added new patches resetting virgl resources, validating hostmem offset and improving error-handlings.

- Added r-b from Akihiko Odaki to the frist patch and t-b from Yiwei Zhang to the map_fixed patch.

v2: - Addressed v1 review comments from Akihiko Odaki

- Added patch that removes unnecessary memory_region_set_enabled(), suggested by Akihiko Odaki

Dmitry Osipenko (5):
virtio-gpu: Remove superfluous memory_region_set_enabled()
virtio-gpu: Validate hostmem mapping offset
virtio-gpu: Replace finish_unmapping with mapping_state
virtio-gpu: Destroy virgl resources on virtio-gpu reset
virtio-gpu: Support mapping hostmem blobs with map_fixed

 hw/display/trace-events        |   2 +-
 hw/display/virtio-gpu-gl.c     |  58 ++++++---
 hw/display/virtio-gpu-virgl.c  | 216 ++++++++++++++++++++++++++++-----
 include/hw/virtio/virtio-gpu.h |   9 +-
 4 files changed, 234 insertions(+), 51 deletions(-)
Signature · 1 line
2.52.0