All of lore.kernel.org
 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

* Re: [Qemu-devel] [PATCH] console: skip same-size resize
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2016-09-07 11:10 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

On Fr, 2016-08-26 at 13:47 +0400, Marc-André Lureau wrote:
> virtio-gpu does a set-scanout at each frame (it might be a driver
> regression).

xorg vs wayland maybe?  as far I know only wayland pageflips for each
frame.

> 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.

Does anything break if you simply drop the qemu_console_resize() call
from virgl_cmd_set_scanout?  In theory we should not need a surface in
the first place in scanout mode, but I suspect there is a reason why the
call is there ...

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH] console: skip same-size resize
  2016-09-07 11:10 ` Gerd Hoffmann
@ 2016-09-07 13:00   ` Marc-André Lureau
  0 siblings, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2016-09-07 13:00 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

Hi

On Wed, Sep 7, 2016 at 4:10 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> On Fr, 2016-08-26 at 13:47 +0400, Marc-André Lureau wrote:
> > virtio-gpu does a set-scanout at each frame (it might be a driver
> > regression).
>
> xorg vs wayland maybe?  as far I know only wayland pageflips for each
> frame.
>

Don't know, I am using Xorg


>
> > 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.
>
> Does anything break if you simply drop the qemu_console_resize() call
> from virgl_cmd_set_scanout?  In theory we should not need a surface in
> the first place in scanout mode, but I suspect there is a reason why the
> call is there ...
>
>
Isn't it there to resize the display window too? In any case, isn't this
patch good to have?

-- 
Marc-André Lureau

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.