qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] console: skip same-size resize
@ 2016-08-26  9:47 Marc-André Lureau
  2016-09-07 11:10 ` Gerd Hoffmann
  0 siblings, 1 reply; 3+ messages in thread
From: Marc-André Lureau @ 2016-08-26  9:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel, Marc-André Lureau

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>
---
 ui/console.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ui/console.c b/ui/console.c
index c24bfe4..2407b48 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2100,6 +2100,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);
 }
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-07 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-26  9:47 [Qemu-devel] [PATCH] console: skip same-size resize Marc-André Lureau
2016-09-07 11:10 ` Gerd Hoffmann
2016-09-07 13:00   ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).