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]> --- ui/gtk-egl.c | 1 - ui/gtk-gl-area.c | 1 - 2 files changed, 2 deletions(-) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index ae9239999cdb..0dbb429958e5 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -180,7 +180,6 @@ void gd_egl_refresh(DisplayChangeListener *dcl) if (vc->gfx.glupdates) { vc->gfx.glupdates = 0; - gtk_egl_set_scanout_mode(vc, false); gd_egl_draw(vc); } } diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index cd86022d264a..c709b2ce0f63 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -199,7 +199,6 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl) if (vc->gfx.glupdates) { vc->gfx.glupdates = 0; - gtk_gl_area_set_scanout_mode(vc, false); gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area)); } } -- 2.51.1
