[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.13 03/17] stdvga: fix screen blanking
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.13 03/17] stdvga: fix screen blanking |
Date: |
Thu, 4 Jul 2024 15:48:10 +0300 |
From: Gerd Hoffmann <kraxel@redhat.com>
In case the display surface uses a shared buffer (i.e. uses vga vram
directly instead of a shadow) go unshare the buffer before clearing it.
This avoids vga memory corruption, which in turn fixes unblanking not
working properly with X11.
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2067
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20240605131444.797896-2-kraxel@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit b1cf266c82cb1211ee2785f1813a6a3f3e693390)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 0cb26a791b..8e2d44bea3 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1746,6 +1746,13 @@ static void vga_draw_blank(VGACommonState *s, int
full_update)
if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
return;
+ if (is_buffer_shared(surface)) {
+ /* unshare buffer, otherwise the blanking corrupts vga vram */
+ surface = qemu_create_displaysurface(s->last_scr_width,
+ s->last_scr_height);
+ dpy_gfx_replace_surface(s->con, surface);
+ }
+
w = s->last_scr_width * surface_bytes_per_pixel(surface);
d = surface_data(surface);
for(i = 0; i < s->last_scr_height; i++) {
--
2.39.2
- [Stable-7.2.13 00/17] Patch Round-up for stable 7.2.13, freeze on 2024-07-14, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 01/17] target/i386: fix size of EBP writeback in gen_enter(), Michael Tokarev, 2024/07/04
- [Stable-7.2.13 02/17] virtio-net: drop too short packets early, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 04/17] linux-user: Make TARGET_NR_setgroups affect only the current thread, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 03/17] stdvga: fix screen blanking,
Michael Tokarev <=
- [Stable-7.2.13 05/17] tcg/loongarch64: Fix tcg_out_movi vs some pcrel pointers, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 06/17] gitlab-ci.d/buildtest: Merge the --without-default-* jobs, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 07/17] Update lcitool and fedora to 37, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 09/17] tests: Update our CI to use CentOS Stream 9 instead of 8, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 08/17] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 10/17] tests: don't run benchmarks for the tsan build, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 11/17] gitlab-ci: Disable the riscv64-debian-cross-container by default, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 12/17] i386/cpu: fixup number of addressable IDs for processor cores in the physical package, Michael Tokarev, 2024/07/04
- [Stable-7.2.13 13/17] target/arm: Fix VCMLA Dd, Dn, Dm[idx], Michael Tokarev, 2024/07/04
- [Stable-7.2.13 15/17] iotests/244: Don't store data-file with protocol in image, Michael Tokarev, 2024/07/04