Received: from eggs.gnu.org ([2001:4830:134:3::10]:42029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpDYu-0003SQ-BE for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:02:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpDYo-0001OC-E7 for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:02:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpDYo-0001Nd-7j for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:02:02 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BBC5C05AA5B for ; Wed, 28 Sep 2016 12:02:01 +0000 (UTC) From: Gerd Hoffmann Date: Wed, 28 Sep 2016 14:01:54 +0200 Message-Id: <1475064117-11571-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1475064117-11571-1-git-send-email-kraxel@redhat.com> References: <1475064117-11571-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/4] console: skip same-size resize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann From: Marc-Andr=C3=A9 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=C3=A9 Lureau Message-id: 20160826094711.14470-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann --- ui/console.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; =20 assert(s->console_type =3D=3D GRAPHIC_CONSOLE); + + if (s->surface && + pixman_image_get_width(s->surface->image) =3D=3D width && + pixman_image_get_height(s->surface->image) =3D=3D height) { + return; + } + surface =3D qemu_create_displaysurface(width, height); dpy_gfx_replace_surface(s, surface); } --=20 1.8.3.1