aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-08-26 13:47:11 +0400
committerGerd Hoffmann <kraxel@redhat.com>2016-09-28 12:49:26 +0200
commitcd958edb1fae85d0c7d1e1acbff82d22724e8d64 (patch)
tree6cbe468332cab73000187aab999bd8e8dc9a39b0 /ui
parent7cfdc02dae0d2ff58c897496cfdbbafc0eda0f3f (diff)
downloadqemu-cd958edb1fae85d0c7d1e1acbff82d22724e8d64.zip
qemu-cd958edb1fae85d0c7d1e1acbff82d22724e8d64.tar.gz
qemu-cd958edb1fae85d0c7d1e1acbff82d22724e8d64.tar.bz2
console: skip same-size resize
virtio-gpu does a set-scanout at each frame (it might be a driver regression). qemu_console_resize() recreate a surface even if the size didn't change, and this shows up in profiling reports because the surface is cleared. With this patch, I get a +15-20% glmark2 improvement. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20160826094711.14470-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/console.c b/ui/console.c
index 3940762..394786b 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2101,6 +2101,13 @@ void qemu_console_resize(QemuConsole *s, int width, int height)
DisplaySurface *surface;
assert(s->console_type == GRAPHIC_CONSOLE);
+
+ if (s->surface &&
+ pixman_image_get_width(s->surface->image) == width &&
+ pixman_image_get_height(s->surface->image) == height) {
+ return;
+ }
+
surface = qemu_create_displaysurface(width, height);
dpy_gfx_replace_surface(s, surface);
}