Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HI1r8-0003Za-BQ for qemu-devel@nongnu.org; Fri, 16 Feb 2007 07:06:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HI1r5-0003ZO-Va for qemu-devel@nongnu.org; Fri, 16 Feb 2007 07:06:25 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HI1r5-0003ZL-QJ for qemu-devel@nongnu.org; Fri, 16 Feb 2007 07:06:23 -0500 Received: from pasmtpa.tele.dk ([80.160.77.114]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HI1r4-0005qs-TV for qemu-devel@nongnu.org; Fri, 16 Feb 2007 07:06:23 -0500 Received: from tuxedo.home.lan (0x535c82dc.virnxx18.adsl-dhcp.tele.dk [83.92.130.220]) by pasmtpA.tele.dk (Postfix) with ESMTP id 2D63C8000AF for ; Fri, 16 Feb 2007 13:06:22 +0100 (CET) Date: Fri, 16 Feb 2007 13:06:21 +0100 Message-ID: <20070216120621.GA16930@tuxedo.home.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline From: lars@segv.dk (Lars Munch) Subject: [Qemu-devel] [PATCH] pl110 display update fix Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi The pl110 controller do not update all rows correctly if you set a resolution where src_width < TARGET_PAGE_SIZE. I ran into this problem at the resolution 480x640x16. The attached patch fixes this problem. -- Lars Munch --azLHFNyN32YCQGCU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pl110-update-fix.patch" Index: hw/pl110.c =================================================================== RCS file: /sources/qemu/qemu/hw/pl110.c,v retrieving revision 1.7 diff -u -r1.7 pl110.c --- hw/pl110.c 22 Oct 2006 00:18:54 -0000 1.7 +++ hw/pl110.c 16 Feb 2007 11:33:53 -0000 @@ -113,7 +113,7 @@ uint8_t *dest; uint8_t *src; int first, last = 0; - int dirty, new_dirty; + int dirty; int i; if (!pl110_enabled(s)) @@ -184,25 +184,21 @@ first = -1; addr = base; - dirty = cpu_physical_memory_get_dirty(addr, VGA_DIRTY_FLAG); - new_dirty = dirty; for (i = 0; i < s->rows; i++) { - if ((addr & ~TARGET_PAGE_MASK) + src_width >= TARGET_PAGE_SIZE) { - uint32_t tmp; - new_dirty = 0; - for (tmp = 0; tmp < src_width; tmp += TARGET_PAGE_SIZE) { - new_dirty |= cpu_physical_memory_get_dirty(addr + tmp, - VGA_DIRTY_FLAG); - } + uint32_t tmp; + + dirty = cpu_physical_memory_get_dirty(addr, VGA_DIRTY_FLAG); + for (tmp = (addr+TARGET_PAGE_SIZE) & TARGET_PAGE_MASK; + !dirty && tmp < addr + src_width; tmp += TARGET_PAGE_SIZE) { + dirty |= cpu_physical_memory_get_dirty(tmp, VGA_DIRTY_FLAG); } - if (dirty || new_dirty || s->invalidate) { + if (dirty || s->invalidate) { fn(pallette, dest, src, s->cols); if (first == -1) first = i; last = i; } - dirty = new_dirty; addr += src_width; dest += dest_width; src += src_width; --azLHFNyN32YCQGCU--