Files
qemu/hw
Dmitry Osipenko 4eb0aace85 virtio-gpu: Support mapping hostmem blobs with map_fixed
Support mapping virgl blobs to a fixed location of a hostmem memory
region using new virglrenderer MAP_FIXED API.

This new feature closes multiple problems for virtio-gpu on QEMU:

- Having dedicated memory region for each mapped blob works notoriously
slow due to QEMU's memory region software design built around RCU that
isn't optimized for frequent removal of the regions

- KVM isn't optimized for a frequent slot changes too

- QEMU/KVM has a limit for a total number of created memory regions,
crashing QEMU when limit is reached

This patch makes virtio-gpu-gl to pre-create a single anonymous memory
region covering whole hostmem area to which blobs will be mapped using
the MAP_FIXED API.

Not all virgl resources will support mapping at a fixed memory address. For
them, we will continue to create individual nested memory sub-regions. In
particular, vrend resources may not have MAP_FIXED capability.

Venus and DRM native contexts will largely benefit from the MAP_FIXED
feature in terms of performance and stability improvement.

Tested-by: Yiwei Zhang <zzyiwei@gmail.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Message-ID: <20260303151422.977399-19-dmitry.osipenko@collabora.com>
Message-ID: <20260304165043.1437519-21-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2026-03-06 17:27:40 +00:00
..
2026-02-23 00:17:34 +01:00
2025-12-27 10:11:08 +01:00
2026-02-25 23:46:04 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-02-20 13:04:45 -05:00
2026-02-27 14:22:07 +01:00
2026-03-02 11:15:16 +05:30
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-02-03 08:32:33 +01:00