Skip to content

Commit

Permalink
ui/console: fix qemu_console_resize() regression
Browse files Browse the repository at this point in the history
The display may be corrupted when changing screen colour depth in
qemu-system-ppc/MacOS since 7.0.

Do not short-cut qemu_console_resize() if the surface is backed by vga
vram. When the scanout isn't set, or it is already allocated, or opengl,
and the size is fitting, we still avoid the reallocation & replace path.

Fixes: commit cb8962c ("ui: do not create a surface when resizing a GL scanout")

Reported-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]>
Tested-by: Mark Cave-Ayland <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
elmarco committed Aug 18, 2022
1 parent f0caba4 commit 88738ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -2575,11 +2575,13 @@ static void vc_chr_open(Chardev *chr,

void qemu_console_resize(QemuConsole *s, int width, int height)
{
DisplaySurface *surface;
DisplaySurface *surface = qemu_console_surface(s);

assert(s->console_type == GRAPHIC_CONSOLE);

if (qemu_console_get_width(s, -1) == width &&
if ((s->scanout.kind != SCANOUT_SURFACE ||
(surface && surface->flags & QEMU_ALLOCATED_FLAG)) &&
qemu_console_get_width(s, -1) == width &&
qemu_console_get_height(s, -1) == height) {
return;
}
Expand Down

0 comments on commit 88738ea

Please sign in to comment.