@samitouri / QOSamiQemu / commits / 8acd000280

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 <akihiko.odaki@daynix.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Yiwei Zhang <zzyiwei@gmail.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Message-ID: <20260303151422.977399-2-dmitry.osipenko@collabora.com> Message-ID: <20260304165043.1437519-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Dmitry Osipenko committed Mar 4, 2026 at 16:50 UTC 8acd000280df0e02182a45e26db979c5faf49366
2 files changed -2
ui/gtk-egl.c
-1
@@ -180,7 +180,6 @@ void gd_egl_refresh(DisplayChangeListener *dcl)
180
181 if (vc->gfx.glupdates) {
182 vc->gfx.glupdates = 0;
183 - gtk_egl_set_scanout_mode(vc, false);
183 gd_egl_draw(vc);
184 }
185 }
ui/gtk-gl-area.c
-1
@@ -199,7 +199,6 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl)
199
200 if (vc->gfx.glupdates) {
201 vc->gfx.glupdates = 0;
202 - gtk_gl_area_set_scanout_mode(vc, false);
202 gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area));
203 }
204 }