[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 74/76] stdvga: fix screen blanking
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 74/76] stdvga: fix screen blanking |
Date: |
Tue, 18 Jun 2024 18:00:36 +0200 |
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>
---
hw/display/vga.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 30facc6c8e..be2b19b839 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1762,6 +1762,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.41.0
- [PULL 64/76] hw/intc/loongson_ipi: Replace ipi_getcpu with cpu_by_arch_id, (continued)
- [PULL 64/76] hw/intc/loongson_ipi: Replace ipi_getcpu with cpu_by_arch_id, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 66/76] hw/s390x: Introduce s390_skeys_get|set() helpers, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 65/76] hw/mips/loongson3_virt: Wire up loongson_ipi device, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 67/76] target/s390x: Use s390_skeys_get|set() helper, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 68/76] util/readline: Fix lints for readline_handle_byte, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 69/76] util/readline: Add C-n, C-p shortcuts, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 70/76] util/readline: Add C-u shortcut, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 71/76] MAINTAINERS: drop virtio-gpu maintainership, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 72/76] MAINTAINERS: drop spice+ui maintainership, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 73/76] ui/cocoa: Use qemu_add_mouse_change_notifier, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 74/76] stdvga: fix screen blanking,
Philippe Mathieu-Daudé <=
- [PULL 75/76] ui+display: rename is_placeholder() -> surface_is_placeholder(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 76/76] ui+display: rename is_buffer_shared() -> surface_is_allocated(), Philippe Mathieu-Daudé, 2024/06/18
- Re: [PULL 00/76] Misc patches for 2024-06-18, Richard Henderson, 2024/06/18