From patchwork Fri Aug 26 09:47:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 663040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sLGSV6cS4z9sBf for ; Fri, 26 Aug 2016 19:48:09 +1000 (AEST) Received: from localhost ([::1]:59750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdDk6-00086E-Cz for incoming@patchwork.ozlabs.org; Fri, 26 Aug 2016 05:48:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdDjU-0007kB-1r for qemu-devel@nongnu.org; Fri, 26 Aug 2016 05:47:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdDjO-0003jF-0p for qemu-devel@nongnu.org; Fri, 26 Aug 2016 05:47:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdDjN-0003iq-R8 for qemu-devel@nongnu.org; Fri, 26 Aug 2016 05:47:21 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 8559481246 for ; Fri, 26 Aug 2016 09:47:20 +0000 (UTC) Received: from localhost (ovpn-116-31.phx2.redhat.com [10.3.116.31]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7Q9lI5w012697; Fri, 26 Aug 2016 05:47:19 -0400 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Fri, 26 Aug 2016 13:47:11 +0400 Message-Id: <20160826094711.14470-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 26 Aug 2016 09:47:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] console: skip same-size resize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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); }