[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.1 11/32] ui/sdl2: set swap interval explicitly when OpenGL i
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.1 11/32] ui/sdl2: set swap interval explicitly when OpenGL is enabled |
Date: |
Mon, 7 Oct 2024 22:16:28 +0300 |
From: Gert Wollny <gert.wollny@collabora.com>
Before 176e3783f2ab (ui/sdl2: OpenGL window context)
SDL_CreateRenderer was called unconditionally setting
the swap interval to 0. Since SDL_CreateRenderer is now no
longer called when OpenGL is enabled, the swap interval is
no longer set explicitly and vsync handling depends on
the environment settings which may lead to a performance
regression with virgl as reported in
https://gitlab.com/qemu-project/qemu/-/issues/2565
Restore the old vsync handling by explicitly calling
SDL_GL_SetSwapInterval if OpenGL is enabled.
Fixes: 176e3783f2ab (ui/sdl2: OpenGL window context)
Closes: https://gitlab.com/qemu-project/qemu/-/issues/2565
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID:
<01020191e05ce6df-84da6386-62c2-4ce8-840e-ad216ac253dd-000000@eu-west-1.amazonses.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit ae23cd00170baaa2777eb1ee87b70f472dbb3c44)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 98ed974371..51299f3645 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -115,6 +115,7 @@ void sdl2_window_create(struct sdl2_console *scon)
SDL_SetHint(SDL_HINT_RENDER_BATCHING, "1");
scon->winctx = SDL_GL_CreateContext(scon->real_window);
+ SDL_GL_SetSwapInterval(0);
} else {
/* The SDL renderer is only used by sdl2-2D, when OpenGL is disabled */
scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0);
--
2.39.5
- [Stable-9.1.1 01/32] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64, (continued)
- [Stable-9.1.1 01/32] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 03/32] crypto: run qcrypto_pbkdf2_count_iters in a new thread, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 02/32] iotests: fix expected output from gnutls, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 04/32] crypto: check gnutls & gcrypt support the requested pbkdf hash, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 05/32] crypto: avoid leak of ctx when bad cipher mode is given, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 07/32] tests/docker: update debian i686 and mipsel images to bookworm, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 08/32] contrib/plugins/Makefile: Add a 'distclean' target, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 06/32] tests/docker: remove debian-armel-cross, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 09/32] hw/audio/virtio-sound: fix heap buffer overflow, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 10/32] hw/intc/arm_gic: fix spurious level triggered interrupts, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 11/32] ui/sdl2: set swap interval explicitly when OpenGL is enabled,
Michael Tokarev <=
- [Stable-9.1.1 12/32] gitlab: fix logic for changing docker tag on stable branches, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 13/32] softmmu: Support concurrent bounce buffers, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 14/32] softmmu/physmem: fix memory leak in dirty_memory_extend(), Michael Tokarev, 2024/10/07
- [Stable-9.1.1 15/32] softmmu/physmem.c: Keep transaction attribute in address_space_map(), Michael Tokarev, 2024/10/07
- [Stable-9.1.1 16/32] mac_dbdma: Remove leftover `dma_memory_unmap` calls, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 17/32] migration/multifd: Fix rb->receivedmap cleanup race, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 18/32] hw/char/stm32l4x5_usart.c: Enable USART ACK bit response, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 19/32] target/arm: Correct ID_AA64ISAR1_EL1 value for neoverse-v1, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 20/32] target/hppa: Fix random 32-bit linux-user crashes, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 26/32] hw/mips/jazz: fix typo in in-built NIC alias, Michael Tokarev, 2024/10/07