From patchwork Sun Jun 2 16:23:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 248133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A47942C00A3 for ; Mon, 3 Jun 2013 02:23:35 +1000 (EST) Received: from localhost ([::1]:47013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjB49-0002LM-O7 for incoming@patchwork.ozlabs.org; Sun, 02 Jun 2013 12:23:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjB3v-0002LF-2R for qemu-devel@nongnu.org; Sun, 02 Jun 2013 12:23:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjB3u-0006af-2z for qemu-devel@nongnu.org; Sun, 02 Jun 2013 12:23:19 -0400 Received: from katherinewilliamsonsoprano.co.uk ([82.165.34.74]:34294 helo=p15195424.pureserver.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjB3t-0006aW-QW for qemu-devel@nongnu.org; Sun, 02 Jun 2013 12:23:18 -0400 Received: from 93-96-138-231.zone4.bethere.co.uk ([93.96.138.231] helo=kentang.lan) by p15195424.pureserver.info with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.43) id 1UjB3l-0006fw-Ts; Sun, 02 Jun 2013 17:23:17 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org Date: Sun, 2 Jun 2013 17:23:00 +0100 Message-Id: <1370190180-18232-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 X-SA-Exim-Connect-IP: 93.96.138.231 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.1 (built Wed, 05 Jan 2005 10:54:05 -0500) X-SA-Exim-Scanned: Yes (on p15195424.pureserver.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 82.165.34.74 Cc: Mark Cave-Ayland Subject: [Qemu-devel] [PATCHv2] tcx: Fix 24-bit display mode 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 d08151bf (conversion of tcx to the memory API) broke the 24-bit mode of the tcx display adapter by accidentally passing in the final address of the dirty region to memory_region_reset_dirty() instead of its size. Signed-off-by: Mark Cave-Ayland --- hw/display/tcx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index fc27f45..995641c 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -193,15 +193,16 @@ static inline void reset_dirty(TCXState *ts, ram_addr_t page_min, ram_addr_t cpage) { memory_region_reset_dirty(&ts->vram_mem, - page_min, page_max + TARGET_PAGE_SIZE, + page_min, + (page_max - page_min) + TARGET_PAGE_SIZE, DIRTY_MEMORY_VGA); memory_region_reset_dirty(&ts->vram_mem, page24 + page_min * 4, - page24 + page_max * 4 + TARGET_PAGE_SIZE, + (page_max - page_min) * 4 + TARGET_PAGE_SIZE, DIRTY_MEMORY_VGA); memory_region_reset_dirty(&ts->vram_mem, cpage + page_min * 4, - cpage + page_max * 4 + TARGET_PAGE_SIZE, + (page_max - page_min) * 4 + TARGET_PAGE_SIZE, DIRTY_MEMORY_VGA); } @@ -285,7 +286,8 @@ static void tcx_update_display(void *opaque) /* reset modified pages */ if (page_max >= page_min) { memory_region_reset_dirty(&ts->vram_mem, - page_min, page_max + TARGET_PAGE_SIZE, + page_min, + (page_max - page_min) + TARGET_PAGE_SIZE, DIRTY_MEMORY_VGA); } }