Commit 5bb16eb707 for qemu.org

commit 5bb16eb70701b01ae9ffe2d7e5165f5a70c5df69
Author: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Date:   Wed Mar 4 16:50:26 2026 +0000

    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 <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-3-dmitry.osipenko@collabora.com>
    Message-ID: <20260304165043.1437519-5-alex.bennee@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 3be17d1079..5eca024823 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -51,7 +51,6 @@ static void sdl2_gl_render_surface(struct sdl2_console *scon)
     int ww, wh;

     SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
-    sdl2_set_scanout_mode(scon, false);

     SDL_GetWindowSize(scon->real_window, &ww, &wh);
     surface_gl_setup_viewport(scon->gls, scon->surface, ww, wh);