Skip to content
Snippets Groups Projects
Commit cb8962c1 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Gerd Hoffmann
Browse files

ui: do not create a surface when resizing a GL scanout


qemu_console_resize() will create a blank surface and replace the
current scanout with it if called while the current scanout is
GL (texture or dmabuf).

This is not only very costly, but also can produce glitches on the
display/listener side.

Instead, compare the current console size with the fitting console
functions, which also works when the scanout is GL.

Note: there might be still an unnecessary surface creation on calling
qemu_console_resize() when the size is actually changing, but display
backends currently rely on DisplaySurface details during
dpy_gfx_switch() to handle various resize aspects. We would need more
refactoring to handle resize without DisplaySurface, this is left for a
future improvement.

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220214201337.1814787-4-marcandre.lureau@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 6cdcf881
No related branches found
No related tags found
No related merge requests found
......@@ -2400,13 +2400,12 @@ static void vc_chr_open(Chardev *chr,
void qemu_console_resize(QemuConsole *s, int width, int height)
{
DisplaySurface *surface = qemu_console_surface(s);
DisplaySurface *surface;
assert(s->console_type == GRAPHIC_CONSOLE);
if (surface && (surface->flags & QEMU_ALLOCATED_FLAG) &&
pixman_image_get_width(surface->image) == width &&
pixman_image_get_height(surface->image) == height) {
if (qemu_console_get_width(s, -1) == width &&
qemu_console_get_height(s, -1) == height) {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment