From patchwork Wed Sep 28 12:01:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9353765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DC246077A for ; Wed, 28 Sep 2016 12:02:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D35829515 for ; Wed, 28 Sep 2016 12:02:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EAE729520; Wed, 28 Sep 2016 12:02:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3432329515 for ; Wed, 28 Sep 2016 12:02:41 +0000 (UTC) Received: from localhost ([::1]:58300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpDZQ-0003Sk-Fv for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Sep 2016 08:02:40 -0400 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) Received: from nilsson.home.kraxel.org (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8SC20Ol025787; Wed, 28 Sep 2016 08:02:00 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 4E95280B96; Wed, 28 Sep 2016 14:01:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org 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 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 28 Sep 2016 12:02:01 +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] [PULL 1/4] 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?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: 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 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; 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); }