From patchwork Mon Aug 3 15:14:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 30610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 54AA8B7067 for ; Tue, 4 Aug 2009 03:22:51 +1000 (EST) Received: from localhost ([127.0.0.1]:50183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MY1FF-0003Q9-QB for incoming@patchwork.ozlabs.org; Mon, 03 Aug 2009 13:22:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXzEL-00058y-S7 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:13:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXzEH-00057v-U5 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:13:41 -0400 Received: from [199.232.76.173] (port=35549 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXzEG-00057j-HK for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:13:37 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:18447 helo=SMTP.EU.CITRIX.COM) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXzEG-0001BH-80 for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:13:36 -0400 X-IronPort-AV: E=Sophos;i="4.43,315,1246838400"; d="scan'208";a="6472591" Received: from lonpmailmx01.citrite.net ([10.30.224.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP; 03 Aug 2009 15:13:34 +0000 Received: from kaball.uk.xensource.com (10.80.2.59) by smtprelay.citirx.com (10.30.224.162) with Microsoft SMTP Server id 8.1.358.0; Mon, 3 Aug 2009 16:13:34 +0100 Date: Mon, 3 Aug 2009 16:14:39 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball-desktop To: qemu-devel@nongnu.org Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] vga: do not resize the screen on hw_invalidate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi all, currently vga always resizes the screen when vga_hw_invalidate is called while this is not required and all the other graphic emulators don't. This patch fixes it, making vga invalidate behaviour consistent with the other emulated devices. Signed-off-by: Stefano Stabellini --- hw/vga.c | 6 +++--- hw/vga_int.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 4d74ffe..53b5ff6 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1837,7 +1837,8 @@ static void vga_update_display(void *opaque) if (ds_get_bits_per_pixel(s->ds) == 0) { /* nothing to do */ } else { - full_update = 0; + full_update = s->full_update; + s->full_update = 0; if (!(s->ar_index & 0x20)) { graphic_mode = GMODE_BLANK; } else { @@ -1867,8 +1868,7 @@ static void vga_invalidate_display(void *opaque) { VGAState *s = (VGAState *)opaque; - s->last_width = -1; - s->last_height = -1; + s->full_update = 1; } void vga_reset(void *opaque) diff --git a/hw/vga_int.h b/hw/vga_int.h index 631b1b0..8fdf51d 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -158,6 +158,7 @@ typedef struct VGACommonState { uint32_t last_width, last_height; /* in chars or pixels */ uint32_t last_scr_width, last_scr_height; /* in pixels */ uint32_t last_depth; /* in bits */ + uint8_t full_update; uint8_t cursor_start, cursor_end; uint32_t cursor_offset; unsigned int (*rgb_to_pixel)(unsigned int r,