ui/dbus: skip GL scanout dispatch for placeholder surfaces
PATCH 1/1 ui/dbus: skip GL scanout dispatch for placeholder surfaces
When using -display dbus,gl=on together with a virgl-capable video device (e.g. virtio-vga-gl), a guest-initiated reboot aborts QEMU with "dbus_scanout_texture: Assertion `tex_id' failed"
virtio-gpu's device reset path blanks each console via qemu_console_set_surface(con, NULL), qemu_console_set_surface() in turn substitues a placeholder DisplaySurface. The placeholder DisplaySurface does not have a GL texture.
Other GL-capable UI backends already guard against this: both sdl2_gl_switch() (ui/sdl2-gl.c) and the 2D SDL path (ui/sdl2-2d.c) check surface_is_placeholder() before touching GL-texture state.
This patch adds an equivalent check inui/dbus-listener.c dbus_gl_gfx_switch().
--- ui/dbus-listener.c | 3 +++ 1 file changed, 3 insertions(+)
ui/dbus-listener.c +3 -0
@@ -861,6 +861,9 @@ static void dbus_gl_gfx_switch(DisplayChangeListener *dcl,trace_dbus_gl_gfx_switch (new_surface); ddl->ds = new_surface; +if (surface_is_placeholder (new_surface)) { +return ;/* nothing real to scan out; avoid dereferencing a non-GL surface */ + } ddl->ds_share =SHARE_KIND_NONE ;if (ddl->ds) {int width =surface_width (ddl->ds);
Signature · 1 line
2.55.0
Hi
Quoted 4 lines · Rick Vernam
When using -display dbus,gl=on together with a virgl-capable video device (e.g. virtio-vga-gl), a guest-initiated reboot aborts QEMU with "
dbus_scanout_texture: Assertion `tex_id' failed"
I do not observe such crash. How did you configure QEMU? Can you provide a backtrace?
Quoted 5 lines
virtio-gpu's device reset path blanks each console via
qemu_console_set_surface(con, NULL),qemu_console_set_surface()in turn substitues a placeholder DisplaySurface. The placeholder DisplaySurface does not have a GL texture.
Before calling gfx_switch(), it calls gfx_create_texture()
Quoted 4 lines
Other GL-capable UI backends already guard against this: both
sdl2_gl_switch()(ui/sdl2-gl.c) and the 2D SDL path (ui/sdl2-2d.c) checksurface_is_placeholder()before touching GL-texture state.
Not for this reason though, afaict. (for secondary/disabled screens)
Quoted 26 lines
This patch adds an equivalent check in
ui/dbus-listener.cdbus_gl_gfx_switch().Signed-off-by Rick Vernam <[email protected]>--- ui/dbus-listener.c | 3 +++ 1 file changed, 3 insertions(+)ui/dbus-listener.c +3
-1@@ -861,6 +861,9 @@ static void dbus_gl_gfx_switch(DisplayChangeListener *dcl,trace_dbus_gl_gfx_switch (new_surface); ddl->ds = new_surface; +if (surface_is_placeholder (new_surface)) { +return ;/* nothing real to scan out; avoid dereferencing a non-GL surface */ + } ddl->ds_share =SHARE_KIND_NONE ;if (ddl->ds) {int width =surface_width (ddl->ds); --2.55.0