Skip to content

Commit 37f037c

Browse files
kraxelMichael Tokarev
authored andcommitted
stdvga: fix screen blanking
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: [email protected] Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2067 Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Marc-André Lureau <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> (cherry picked from commit b1cf266) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 1608a7f commit 37f037c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hw/display/vga.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,6 +1772,13 @@ static void vga_draw_blank(VGACommonState *s, int full_update)
17721772
if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
17731773
return;
17741774

1775+
if (is_buffer_shared(surface)) {
1776+
/* unshare buffer, otherwise the blanking corrupts vga vram */
1777+
surface = qemu_create_displaysurface(s->last_scr_width,
1778+
s->last_scr_height);
1779+
dpy_gfx_replace_surface(s->con, surface);
1780+
}
1781+
17751782
w = s->last_scr_width * surface_bytes_per_pixel(surface);
17761783
d = surface_data(surface);
17771784
for(i = 0; i < s->last_scr_height; i++) {

0 commit comments

Comments
 (0)