From patchwork Tue Feb 21 21:39:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 142376 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 053CCB6EEC for ; Wed, 22 Feb 2012 09:28:28 +1100 (EST) Received: from localhost ([::1]:58845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzxRw-0000yR-QM for incoming@patchwork.ozlabs.org; Tue, 21 Feb 2012 16:40:40 -0500 Received: from eggs.gnu.org ([140.186.70.92]:59753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzxRF-0008KK-4n for qemu-devel@nongnu.org; Tue, 21 Feb 2012 16:39:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzxRD-0005hG-QN for qemu-devel@nongnu.org; Tue, 21 Feb 2012 16:39:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzxRD-0005h9-Jr for qemu-devel@nongnu.org; Tue, 21 Feb 2012 16:39:55 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1LLds37005598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 21 Feb 2012 16:39:54 -0500 Received: from garlic.redhat.com (vpn-200-36.tlv.redhat.com [10.35.200.36]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1LLdc66001985; Tue, 21 Feb 2012 16:39:52 -0500 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com, spice-devel@freedesktop.org, yhalperi@redhat.com, elmarco@redhat.com Date: Tue, 21 Feb 2012 23:39:32 +0200 Message-Id: <1329860377-6284-5-git-send-email-alevy@redhat.com> In-Reply-To: <1329860377-6284-1-git-send-email-alevy@redhat.com> References: <1329860377-6284-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v4 4/9] qxl: screen_dump in vga: do a single ppm_save X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Using vga->screen_dump results in a number of calls to ppm_save, instead of a single one. Lacking time to test all the possible users of vga->screen_dump, avoid the redundant calls by doing the vga_hw_update+ ppm_save in qxl_hw_screen_dump. Signed-off-by: Alon Levy --- hw/qxl.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index ac69125..8bdc510 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1438,7 +1438,6 @@ static void qxl_hw_invalidate(void *opaque) static void qxl_hw_screen_dump(void *opaque, const char *filename) { PCIQXLDevice *qxl = opaque; - VGACommonState *vga = &qxl->vga; switch (qxl->mode) { case QXL_MODE_COMPAT: @@ -1447,7 +1446,14 @@ static void qxl_hw_screen_dump(void *opaque, const char *filename) ppm_save(filename, qxl->ssd.ds->surface); break; case QXL_MODE_VGA: - vga->screen_dump(vga, filename); + /* + * TODO: vga_hw_screen_dump needless does a number of ppm_save calls + * fix it instead of redoing it correctly here (needs testing which is + * why it isn't yet done) + */ + qxl->vga.invalidate(&qxl->vga); + vga_hw_update(); + ppm_save(filename, qxl->ssd.ds->surface); break; default: break;