* [PATCH] ui/dbus: skip GL scanout dispatch for placeholder surfaces
@ 2026-09-07 22:18 Rick Vernam
2026-09-08 8:31 ` Marc-André Lureau
0 siblings, 1 reply; 2+ messages in thread
From: Rick Vernam @ 2026-09-07 22:18 UTC (permalink / raw)
To: marcandre.lureau; +Cc: qemu-devel, rtvernam
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 in
ui/dbus-listener.c dbus_gl_gfx_switch().
Signed-off-by: Rick Vernam <rtvernam@gmail.com>
---
ui/dbus-listener.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index 2e2f6ba418..5f627f6acf 100644
--- a/ui/dbus-listener.c
+++ b/ui/dbus-listener.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ui/dbus: skip GL scanout dispatch for placeholder surfaces
2026-09-07 22:18 [PATCH] ui/dbus: skip GL scanout dispatch for placeholder surfaces Rick Vernam
@ 2026-09-08 8:31 ` Marc-André Lureau
0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2026-09-08 8:31 UTC (permalink / raw)
To: Rick Vernam; +Cc: qemu-devel
Hi
On Tue, Sep 8, 2026 at 2:18 AM Rick Vernam <rtvernam@gmail.com> wrote:
>
> 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?
>
> 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()
>
> 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.
Not for this reason though, afaict. (for secondary/disabled screens)
>
> This patch adds an equivalent check in
> ui/dbus-listener.c dbus_gl_gfx_switch().
>
> Signed-off-by: Rick Vernam <rtvernam@gmail.com>
> ---
> ui/dbus-listener.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
> index 2e2f6ba418..5f627f6acf 100644
> --- a/ui/dbus-listener.c
> +++ b/ui/dbus-listener.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-08 8:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 22:18 [PATCH] ui/dbus: skip GL scanout dispatch for placeholder surfaces Rick Vernam
2026-09-08 8:31 ` Marc-André Lureau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.