[RFC PATCH v3 0/7] Support mapping virtio-gpu virgl hostmem blobs using MAP_FIXED API

Dmitry Osipenko posted 7 patches 6 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251120040632.4036204-1-dmitry.osipenko@collabora.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>
hw/display/virtio-gpu-gl.c     |  51 ++++++++++-
hw/display/virtio-gpu-virgl.c  | 159 ++++++++++++++++++++++++++-------
include/hw/virtio/virtio-gpu.h |   8 +-
3 files changed, 183 insertions(+), 35 deletions(-)
[RFC PATCH v3 0/7] Support mapping virtio-gpu virgl hostmem blobs using MAP_FIXED API
Posted by Dmitry Osipenko 6 hours ago
Virglrender got a new unstable 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: 20251116125641.2255794-1-dmitry.osipenko@collabora.com

Changelog:

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 (7):
  virtio-gpu: Remove superfluous memory_region_set_enabled()
  virtio-gpu: Validate hostmem mapping offset
  virtio-gpu: Make virtio_gpu_virgl_unmap_resource_blob() return -1 on
    error
  virtio-gpu: Blame host for virgl blob resource unmapping error
  virtio-gpu: Destroy virgl resources on virtio-gpu reset
  virtio-gpu: Make virtio_gpu_virgl_init() return -1 on error
  virtio-gpu: Support mapping hostmem blobs with map_fixed

 hw/display/virtio-gpu-gl.c     |  51 ++++++++++-
 hw/display/virtio-gpu-virgl.c  | 159 ++++++++++++++++++++++++++-------
 include/hw/virtio/virtio-gpu.h |   8 +-
 3 files changed, 183 insertions(+), 35 deletions(-)

-- 
2.51.1