From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Alon Levy 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> Subject: [Qemu-devel] [RFC v4 4/9] qxl: screen_dump in vga: do a single ppm_save List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com, spice-devel@freedesktop.org, yhalperi@redhat.com, elmarco@redhat.com 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; -- 1.7.9.1