[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/35] ui: do not create a surface when resizing a GL scanout
From: |
Gerd Hoffmann |
Subject: |
[PULL 30/35] ui: do not create a surface when resizing a GL scanout |
Date: |
Fri, 4 Mar 2022 15:21:18 +0100 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220214201337.1814787-4-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/console.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/ui/console.c b/ui/console.c
index 79a01afd1ea7..365a2c14b809 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -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;
}
--
2.35.1
- [PULL 18/35] paaudio: reduce effective playback buffer size, (continued)
- [PULL 18/35] paaudio: reduce effective playback buffer size, Gerd Hoffmann, 2022/03/04
- [PULL 21/35] paaudio: fix samples vs. frames mix-up, Gerd Hoffmann, 2022/03/04
- [PULL 25/35] hw/i386: Improve bounds checking in OVMF table parsing, Gerd Hoffmann, 2022/03/04
- [PULL 20/35] ossaudio: reduce effective playback buffer size, Gerd Hoffmann, 2022/03/04
- [PULL 22/35] sdlaudio: fix samples vs. frames mix-up, Gerd Hoffmann, 2022/03/04
- [PULL 23/35] hw/usb/redirect.c: Stop using qemu_oom_check(), Gerd Hoffmann, 2022/03/04
- [PULL 24/35] coreaudio: Notify error in coreaudio_init_out, Gerd Hoffmann, 2022/03/04
- [PULL 29/35] ui/console: fix texture leak when calling surface_gl_create_texture(), Gerd Hoffmann, 2022/03/04
- [PULL 27/35] docs: Add spec of OVMF GUIDed table for SEV guests, Gerd Hoffmann, 2022/03/04
- [PULL 28/35] ui/console: fix crash when using gl context with non-gl listeners, Gerd Hoffmann, 2022/03/04
- [PULL 30/35] ui: do not create a surface when resizing a GL scanout,
Gerd Hoffmann <=
- [PULL 31/35] ui/clipboard: fix use-after-free regression, Gerd Hoffmann, 2022/03/04
- [PULL 32/35] ui/cocoa: Add Services menu, Gerd Hoffmann, 2022/03/04
- [PULL 26/35] hw/i386: Replace magic number with field length calculation, Gerd Hoffmann, 2022/03/04
- [PULL 33/35] softmmu/qdev-monitor: Add virtio-gpu-gl aliases, Gerd Hoffmann, 2022/03/04
- [PULL 35/35] hw/display/vmware_vga: replace fprintf calls with trace events, Gerd Hoffmann, 2022/03/04
- [PULL 34/35] edid: Fix clock of Detailed Timing Descriptor, Gerd Hoffmann, 2022/03/04
- Re: [PULL 00/35] Kraxel 20220304 patches, Peter Maydell, 2022/03/05