From patchwork Thu Mar 1 07:34:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 143944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7A5FFB6F62 for ; Thu, 1 Mar 2012 18:35:02 +1100 (EST) Received: from localhost ([::1]:40225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S30XT-000171-97 for incoming@patchwork.ozlabs.org; Thu, 01 Mar 2012 02:34:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S30XI-00016m-PU for qemu-devel@nongnu.org; Thu, 01 Mar 2012 02:34:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S30XE-0004lI-15 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 02:34:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S30XD-0004kp-PW for qemu-devel@nongnu.org; Thu, 01 Mar 2012 02:34:43 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q217YgQs009486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Mar 2012 02:34:42 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q217YfV1002179; Thu, 1 Mar 2012 02:34:41 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 4E07740AA8; Thu, 1 Mar 2012 08:34:40 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2012 08:34:40 +0100 Message-Id: <1330587280-13038-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] fix screendump 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 Commit 45efb16124efef51de5157afc31984b5a47700f9 optimized a bit too much. We can skip the vga_invalidate_display() in case no console switch happened because we don't need a full redraw then. We can *not* skip vga_hw_update() though, because the screen content will be stale then in case nobody else calls vga_hw_update(). Trigger: vga textmode with vnc display and no client connected. Reported-by: Avi Kivity Signed-off-by: Gerd Hoffmann Reviewed-by: Alon Levy --- hw/blizzard.c | 4 +--- hw/omap_lcdc.c | 5 ++--- hw/vga.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/blizzard.c b/hw/blizzard.c index c7d844d..29074c4 100644 --- a/hw/blizzard.c +++ b/hw/blizzard.c @@ -937,9 +937,7 @@ static void blizzard_screen_dump(void *opaque, const char *filename, { BlizzardState *s = (BlizzardState *) opaque; - if (cswitch) { - blizzard_update_display(opaque); - } + blizzard_update_display(opaque); if (s && ds_get_data(s->state)) ppm_save(filename, s->state->surface); } diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c index f172093..4a08e9d 100644 --- a/hw/omap_lcdc.c +++ b/hw/omap_lcdc.c @@ -267,9 +267,8 @@ static int ppm_save(const char *filename, uint8_t *data, static void omap_screen_dump(void *opaque, const char *filename, bool cswitch) { struct omap_lcd_panel_s *omap_lcd = opaque; - if (cswitch) { - omap_update_display(opaque); - } + + omap_update_display(opaque); if (omap_lcd && ds_get_data(omap_lcd->state)) ppm_save(filename, ds_get_data(omap_lcd->state), omap_lcd->width, omap_lcd->height, diff --git a/hw/vga.c b/hw/vga.c index 5994f43..16546ef 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -2413,7 +2413,7 @@ static void vga_screen_dump(void *opaque, const char *filename, bool cswitch) if (cswitch) { vga_invalidate_display(s); - vga_hw_update(); } + vga_hw_update(); ppm_save(filename, s->ds->surface); }