Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: d3a4969dc5acbece7f2ff3acc666de09dd830523
https://github.com/qemu/qemu/commit/d3a4969dc5acbece7f2ff3acc666de09dd830523
Author: Andrew Keesler <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-base.c
M qapi/virtio.json
Log Message:
-----------
Support per-head resolutions with virtio-gpu
In 454f4b0f, we started down the path of supporting separate
configurations per display head (e.g., you have 2 heads - one with
EDID name "AAA" and the other with EDID name "BBB").
In this change, we add resolution to this configuration surface (e.g.,
you have 2 heads - one with resolution 111x222 and the other with
resolution 333x444).
-display vnc=localhost:0,id=aaa,display=vga,head=0 \
-display vnc=localhost:1,id=bbb,display=vga,head=1 \
-device '{"driver":"virtio-vga",
"max_outputs":2,
"id":"vga",
"outputs":[
{
"name":"AAA",
"xres":111,
"yres":222
},
{
"name":"BBB",
"xres":333,
"yres":444
}
]}'
Here is the behavior matrix of the current resolution configuration
surface (xres/yres) with the new resolution configuration surface
(outputs[i].xres/yres).
Note - we use "xres" and "yres" (instead of, say, "width" and "height")
to match analogous virtio_gpu_base_conf.xres/yres.
Case: !(xres || yres) && !(outputs[i].has_xres && outputs[i].has_yres)
Behavior: current behavior - outputs[0] enabled with default xres/yres
Case: (xres || yres) && !(outputs[i].has_xres && outputs[i].has_yres)
Behavior: current behavior - outputs[0] enabled with xres/yres
Case: outputs[i].has_xres && outputs[i].has_yres
Behavior: new behavior - outputs[i] enabled with outputs[i].xres/yres
Case: outputs[i].has_xres != outputs[i].has_yres
Behavior: error
Signed-off-by: Andrew Keesler <[email protected]>
Acked-by: Markus Armbruster <[email protected]>
Message-ID: <[email protected]>
[AJB: fix format strings for size_t in error_setg]
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 48f12f521dd12e8756c3138121fa4bf6d8337cb8
https://github.com/qemu/qemu/commit/48f12f521dd12e8756c3138121fa4bf6d8337cb8
Author: Dongwon Kim <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-udmabuf-stubs.c
M hw/display/virtio-gpu-udmabuf.c
M hw/display/virtio-gpu.c
M include/hw/virtio/virtio-gpu.h
Log Message:
-----------
virtio-gpu: Fix scanout dmabuf cleanup during resource destruction
When a virtio-gpu resource is destroyed, any associated udmabuf must be
properly torn down. Currently, the code may leave dangling references
to dmabuf file descriptors in the scanout primary buffers.
This patch updates virtio_gpu_fini_udmabuf to:
1. Iterate through all active scanouts.
2. Identify dmabufs that match the resource's file descriptor.
3. Close the dmabuf and invalidate the resource's FD reference to
prevent use-after-free or double-close scenarios.
4. Finally, trigger the underlying udmabuf destruction.
This ensures that the display backend does not attempt to access
memory or FDs that have been released by the guest or the host.
Cc: Alex Bennée <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Marc-André Lureau <[email protected]>
Cc: Vivek Kasireddy <[email protected]>
Signed-off-by: Dongwon Kim <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 8acd000280df0e02182a45e26db979c5faf49366
https://github.com/qemu/qemu/commit/8acd000280df0e02182a45e26db979c5faf49366
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M ui/gtk-egl.c
M ui/gtk-gl-area.c
Log Message:
-----------
ui/gtk: Don't disable scanout when display is refreshed
Display refreshment is invoked by a timer and it erroneously disables
the active scanout if it happens to be invoked after scanout has been
enabled. This offending scanout-disable race condition with a timer
can be easily hit when Qemu runs with a disabled vsync by using SDL or
GTK displays (with vblank_mode=0 for GTK). Refreshment of display's
content shouldn't disable the active display. Fix it by keeping the
scanout's state unchanged when display is redrawn.
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 5bb16eb70701b01ae9ffe2d7e5165f5a70c5df69
https://github.com/qemu/qemu/commit/5bb16eb70701b01ae9ffe2d7e5165f5a70c5df69
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M ui/sdl2-gl.c
Log Message:
-----------
ui/sdl2: Don't disable scanout when display is refreshed
Display refreshment is invoked by a timer and it erroneously disables
the active scanout if it happens to be invoked after scanout has been
enabled. This offending scanout-disable race condition with a timer
can be easily hit when Qemu runs with a disabled vsync by using SDL or
GTK displays (with vblank_mode=0 for GTK). Refreshment of display's
content shouldn't disable the active display. Fix it by keeping the
scanout's state unchanged when display is redrawn.
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 3beb637032f2591e779bfd1af04be33a90c8cbeb
https://github.com/qemu/qemu/commit/3beb637032f2591e779bfd1af04be33a90c8cbeb
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M include/ui/egl-context.h
M ui/dbus.c
M ui/egl-context.c
M ui/egl-headless.c
M ui/gtk-egl.c
M ui/spice-display.c
Log Message:
-----------
ui/egl: Don't change bound GL context when creating new context
Don't change bound GL context when creating new GL context for consistency
with behavior expected by virglrenderer that assumes context-creation doesn't
switch context. eglCreateContext() doesn't require GL context to be bound
when it's invoked. Update qemu_egl_create_context() to spawn GL sub-contexts
from a given shared GL context instead of a currently-bound context.
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 47ab60066835fb324f35f13dc717c9f33f864185
https://github.com/qemu/qemu/commit/47ab60066835fb324f35f13dc717c9f33f864185
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M ui/gtk-gl-area.c
Log Message:
-----------
ui/gdk: Restore original context after new context creation
Get currently bound GL context when creating new GL context and restore
it after the creation for consistency with behavior expected by virglrenderer
that assumes context-creation doesn't switch context.
Reviewed-by: Marc-André Lureau <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 2b0e2edc83662e6ab9d68cdaff151e232eee4d41
https://github.com/qemu/qemu/commit/2b0e2edc83662e6ab9d68cdaff151e232eee4d41
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M ui/sdl2-gl.c
Log Message:
-----------
ui/sdl2: Restore original context after new context creation
SDL API changes GL context to a newly created GL context, which differs
from other GL providers that don't switch context. Change SDL backend to
restore the original GL context. This allows Qemu's virtio-gpu to support
new virglrenderer async-fencing feature for Virgl contexts, otherwise
virglrenderer's vrend creates a fence-sync context on the Qemu's
main-loop thread that erroneously stays in-use by the main-loop after
creation, not allowing vrend's fence-sync thread switch to this new
context that belongs to it.
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 52053b7e0a0e285ce3448b830053b05fb0a9b1a8
https://github.com/qemu/qemu/commit/52053b7e0a0e285ce3448b830053b05fb0a9b1a8
Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M include/ui/sdl2.h
M meson.build
M ui/sdl2-gl.c
M ui/sdl2.c
Log Message:
-----------
ui/sdl2: Implement dpy dmabuf functions
If EGL is used, we can rely on dmabuf to import textures without
doing copies.
To get this working on X11, we use the existing SDL hint:
SDL_HINT_VIDEO_X11_FORCE_EGL (because dmabuf can't be used with GLX).
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
[AJB: ifdef CONFIG_OPENGL/CONFIG_GBM for non-linux hosts]
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 235f9b36383e4cc7a790bca51eddbe38edd5438c
https://github.com/qemu/qemu/commit/235f9b36383e4cc7a790bca51eddbe38edd5438c
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-virgl.c
M hw/display/virtio-gpu.c
M hw/virtio/virtio.c
M include/hw/virtio/virtio.h
Log Message:
-----------
virtio-gpu: Ensure BHs are invoked only from main-loop thread
QEMU's display GL core is tied to main-loop thread and virtio-gpu
interacts with display while processing GPU commands. Virtio-gpu BHs
work in generic AIO context that can be invoked on vCPU thread, while
GL and UI toolkits are bound to the main-loop thread.
Make virtio-gpu BHs use iohandler AIO context that is handled in a
main-loop thread only.
0 SDL_GL_MakeCurrent() (libSDL3)
1 SDL_GL_MakeCurrent_REAL() (libSDL2)
2 sdl2_gl_make_context_current() (ui/sdl2-gl.c:201)
3 make_current() (virglrenderer.c:639)
4 vrend_finish_context_switch() (vrend_renderer.c:11630)
5 vrend_hw_switch_context() (vrend_renderer.c:11613)
6 vrend_renderer_force_ctx_0() (vrend_renderer.c:12986)
7 virgl_renderer_force_ctx_0() (virglrenderer.c:460)
8 virtio_gpu_virgl_process_cmd() (virtio-gpu-virgl.c:1013)
9 virtio_gpu_process_cmdq() (virtio-gpu.c:1050)
10 virtio_gpu_gl_handle_ctrl() (virtio-gpu-gl.c:86)
11 aio_bh_poll() (util/async.c)
12 aio_poll() (util/aio-posix.c)
13 blk_pwrite() (block/block-gen.c:1985)
14 pflash_update() (pflash_cfi01.c:396)
15 pflash_write() (pflash_cfi01.c:541)
16 memory_region_dispatch_write() (system/memory.c:1554)
17 flatview_write() (system/physmem.c:3333)
18 address_space_write() (system/physmem.c:3453)
19 kvm_cpu_exec() (accel/kvm/kall-all.c:3248)
20 kvm_vcpu_thread_fn() (accel/kvm/kaccel-ops.c:53)
Cc: [email protected]
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 17bf86af36e2f2fe94ec48311f7d454654d166d5
https://github.com/qemu/qemu/commit/17bf86af36e2f2fe94ec48311f7d454654d166d5
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-virgl.c
Log Message:
-----------
virtio-gpu: Handle virgl fence creation errors
Print out error messages when virgl fence creation fails to aid debugging
of the fence-related bugs.
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Tested-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 6698eae8a1f6d897ea0ad62e47448c296eec0bf9
https://github.com/qemu/qemu/commit/6698eae8a1f6d897ea0ad62e47448c296eec0bf9
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-gl.c
M hw/display/virtio-gpu-virgl.c
M include/hw/virtio/virtio-gpu.h
M meson.build
Log Message:
-----------
virtio-gpu: Support asynchronous fencing
Support asynchronous fencing feature of virglrenderer. It allows Qemu to
handle fence as soon as it's signalled instead of periodically polling
the fence status. This feature is required for enabling DRM context
support in Qemu because legacy fencing mode isn't supported for DRM
contexts in virglrenderer.
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Tested-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 893598209fde32ca5f013a012b120af3a458bcae
https://github.com/qemu/qemu/commit/893598209fde32ca5f013a012b120af3a458bcae
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M docs/system/devices/virtio/virtio-gpu.rst
M hw/display/virtio-gpu-gl.c
M hw/display/virtio-gpu-virgl.c
M hw/display/virtio-gpu.c
M include/hw/virtio/virtio-gpu.h
Log Message:
-----------
virtio-gpu: Support DRM native context
Add support for DRM native contexts to VirtIO-GPU. DRM context is enabled
using a new virtio-gpu-gl device option "drm_native_context=on".
Unlike Virgl and Venus contexts that operate on application API level,
DRM native contexts work on a kernel UAPI level. This lower level results
in a lightweight context implementations that yield better performance.
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Tested-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: d847a5a53fb680e649f95eba25aaf89e8576d4b1
https://github.com/qemu/qemu/commit/d847a5a53fb680e649f95eba25aaf89e8576d4b1
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M docs/system/devices/virtio/virtio-gpu.rst
Log Message:
-----------
docs/system: virtio-gpu: Add link to Mesa VirGL doc
Extend virtio-gpu documentation with a link to the Mesa VirGL
documentation.
Suggested-by: Akihiko Odaki <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: c12998c2fdbe384445d98694049580edc5b363e9
https://github.com/qemu/qemu/commit/c12998c2fdbe384445d98694049580edc5b363e9
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M docs/system/devices/virtio/virtio-gpu.rst
Log Message:
-----------
docs/system: virtio-gpu: Update Venus link
Change virtio-gpu Venus link, pointing it at the Mesa Venus
documentation instead of the protocol. The Mesa doc provides more
information and also has a link to the protocol.
Suggested-by: Akihiko Odaki <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 13a97a1963505851d7587d3f50a317f1ad0a8fd6
https://github.com/qemu/qemu/commit/13a97a1963505851d7587d3f50a317f1ad0a8fd6
Author: Alex Bennée <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M docs/system/devices/virtio/virtio-gpu.rst
Log Message:
-----------
docs/system: virtio-gpu: Document host/guest requirements
This attempts to tidy up the VirtIO GPU documentation to make the list
of requirements clearer. There are still a lot of moving parts and the
distros have some catching up to do before this is all handled
automatically.
Cc: Sergio Lopez Pascual <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
[[email protected]: Extended and corrected doc]
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 276a6c2919b75138943a68938e4f677ab2ce8197
https://github.com/qemu/qemu/commit/276a6c2919b75138943a68938e4f677ab2ce8197
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-virgl.c
Log Message:
-----------
virtio-gpu: Remove superfluous memory_region_set_enabled()
There is no need to explicitly enable/disable memory region when it's
added or deleted respectively. Remove superfluous set_enabled() calls
for consistency.
Suggested-by: Akihiko Odaki <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: d0803a90c8fa54c3867ab1ae4b9aee7e57d2e0d2
https://github.com/qemu/qemu/commit/d0803a90c8fa54c3867ab1ae4b9aee7e57d2e0d2
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-virgl.c
Log Message:
-----------
virtio-gpu: Validate hostmem mapping offset
Check hostmem mapping boundaries originated from guest.
Suggested-by: Akihiko Odaki <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 46113335386c3b4d7adac732bb24558ef9be7271
https://github.com/qemu/qemu/commit/46113335386c3b4d7adac732bb24558ef9be7271
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/trace-events
M hw/display/virtio-gpu-virgl.c
Log Message:
-----------
virtio-gpu: Replace finish_unmapping with mapping_state
Allow virtio_gpu_virgl_unmap_resource_blob() to be invoked while async
unmapping is in progress. Do it in preparation to improvement of virtio-gpu
resetting that will require this change.
Suggested-by: Akihiko Odaki <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: bd9258917fbf57eb0de030d03cd5bbb4acc88402
https://github.com/qemu/qemu/commit/bd9258917fbf57eb0de030d03cd5bbb4acc88402
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-gl.c
M hw/display/virtio-gpu-virgl.c
M include/hw/virtio/virtio-gpu.h
Log Message:
-----------
virtio-gpu: Destroy virgl resources on virtio-gpu reset
Properly destroy virgl resources on virtio-gpu reset to not leak resources
on a hot reboot of a VM.
Suggested-by: Akihiko Odaki <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 4eb0aace85f507e21bb8ac323ad81c5860f7a52d
https://github.com/qemu/qemu/commit/4eb0aace85f507e21bb8ac323ad81c5860f7a52d
Author: Dmitry Osipenko <[email protected]>
Date: 2026-03-06 (Fri, 06 Mar 2026)
Changed paths:
M hw/display/virtio-gpu-gl.c
M hw/display/virtio-gpu-virgl.c
M include/hw/virtio/virtio-gpu.h
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Commit: 1ae4271ab8dbfbf5dc28b36baa7f3fd5fd2215e1
https://github.com/qemu/qemu/commit/1ae4271ab8dbfbf5dc28b36baa7f3fd5fd2215e1
Author: Peter Maydell <[email protected]>
Date: 2026-03-07 (Sat, 07 Mar 2026)
Changed paths:
M docs/system/devices/virtio/virtio-gpu.rst
M hw/display/trace-events
M hw/display/virtio-gpu-base.c
M hw/display/virtio-gpu-gl.c
M hw/display/virtio-gpu-udmabuf-stubs.c
M hw/display/virtio-gpu-udmabuf.c
M hw/display/virtio-gpu-virgl.c
M hw/display/virtio-gpu.c
M hw/virtio/virtio.c
M include/hw/virtio/virtio-gpu.h
M include/hw/virtio/virtio.h
M include/ui/egl-context.h
M include/ui/sdl2.h
M meson.build
M qapi/virtio.json
M ui/dbus.c
M ui/egl-context.c
M ui/egl-headless.c
M ui/gtk-egl.c
M ui/gtk-gl-area.c
M ui/sdl2-gl.c
M ui/sdl2.c
M ui/spice-display.c
Log Message:
-----------
Merge tag 'pull-11.0-virtio-gpu-updates-060326-1' of
https://gitlab.com/stsquad/qemu into staging
virtio-gpu updates (resolution, error handling, fences, native context)
- support per-head resolution definitions
- don't disable scanouts on sdl and gtk when display refreshed
- take care not confuse virgl with switching contexts
- use dmabuf to import textures when we can
- keep virtio BH processing to main-loop
- improve error handling for fence creation
- support async fences
- add support for DRM native context
- update virtio-gpu docs
- remove superfluous memory region enabling
- validate mapping offsets
- destroy vrigl resources on reset
- support mapping hostmem blobs with map_fixed
# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmmrEysACgkQ+9DbCVqe
# KkQhugf/eab7ZSMfQzOArOjKcr+SSXiFE3wXg9HKRrbZx/yHRAiQ/Fv9Qx7uH8Q5
# Q7/A1l9WN/iwv2/jHWJv7gSOrYaRYIL0vXn/oriVNncZx779o56YhTIEYcSZ+zaF
# lHwLHpnzi2jcrmlhV49Mp1+tUH9U3OXwWzAUKTjhJxnLomoBwwcBaftbbBUj2cmS
# a3t1SMeIEq1hX7fCDnkBUfkUGAmPbk/vp/oXxF5SmBJIiyKB+O9jbx408hMQsNFo
# vulBmD2a5EOPwvBC0K6v+9aAbUicOFHwoQyeFvM8HTObMPj6+F40fvq+STNre22X
# Ln9a+tB/nq+7auX1D9VZSCkH7vzGRw==
# =x8lu
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri Mar 6 17:47:23 2026 GMT
# gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key)
<[email protected]>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44
* tag 'pull-11.0-virtio-gpu-updates-060326-1' of
https://gitlab.com/stsquad/qemu:
virtio-gpu: Support mapping hostmem blobs with map_fixed
virtio-gpu: Destroy virgl resources on virtio-gpu reset
virtio-gpu: Replace finish_unmapping with mapping_state
virtio-gpu: Validate hostmem mapping offset
virtio-gpu: Remove superfluous memory_region_set_enabled()
docs/system: virtio-gpu: Document host/guest requirements
docs/system: virtio-gpu: Update Venus link
docs/system: virtio-gpu: Add link to Mesa VirGL doc
virtio-gpu: Support DRM native context
virtio-gpu: Support asynchronous fencing
virtio-gpu: Handle virgl fence creation errors
virtio-gpu: Ensure BHs are invoked only from main-loop thread
ui/sdl2: Implement dpy dmabuf functions
ui/sdl2: Restore original context after new context creation
ui/gdk: Restore original context after new context creation
ui/egl: Don't change bound GL context when creating new context
ui/sdl2: Don't disable scanout when display is refreshed
ui/gtk: Don't disable scanout when display is refreshed
virtio-gpu: Fix scanout dmabuf cleanup during resource destruction
Support per-head resolutions with virtio-gpu
Signed-off-by: Peter Maydell <[email protected]>
Compare: https://github.com/qemu/qemu/compare/d41b9b44ac9a...1ae4271ab8db
To unsubscribe from these emails, change your notification settings at
https://github.com/qemu/qemu/settings/notifications