From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdaS-0006JK-PJ for qemu-devel@nongnu.org; Fri, 11 Oct 2013 10:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUdaN-0007Dq-MG for qemu-devel@nongnu.org; Fri, 11 Oct 2013 10:21:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdaN-0007Cg-Cp for qemu-devel@nongnu.org; Fri, 11 Oct 2013 10:20:59 -0400 From: Juan Quintela Date: Fri, 11 Oct 2013 16:20:45 +0200 Message-Id: <1381501250-19351-3-git-send-email-quintela@redhat.com> In-Reply-To: <1381501250-19351-1-git-send-email-quintela@redhat.com> References: <1381501250-19351-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH 2/7] vga: port to test_and_clear instead of test/reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: balrog@zabor.org, i.mitsyanko@samsung.com, paul@codesourcery.com, Juan Quintela From: Juan Quintela Now page_min/max are not needed anymore. Signed-off-by: Juan Quintela Signed-off-by: Juan Quintela --- hw/display/vga.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 7b91d9c..d411c5c 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1640,7 +1640,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) DisplaySurface *surface = qemu_console_surface(s->con); int y1, y, update, linesize, y_start, double_scan, mask, depth; int width, height, shift_control, line_offset, bwidth, bits; - ram_addr_t page0, page1, page_min, page_max; + ram_addr_t page0, page1; int disp_width, multi_scan, multi_run; uint8_t *d; uint32_t v, addr1, addr; @@ -1784,8 +1784,6 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) addr1 = (s->start_addr * 4); bwidth = (width * bits + 7) / 8; y_start = -1; - page_min = -1; - page_max = 0; d = surface_data(surface); linesize = surface_stride(surface); y1 = 0; @@ -1803,17 +1801,14 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) update = full_update; page0 = addr; page1 = addr + bwidth - 1; - update |= memory_region_get_dirty(&s->vram, page0, page1 - page0, - DIRTY_MEMORY_VGA); + update |= memory_region_test_and_clear_dirty(&s->vram, page0, + page1 - page0, + DIRTY_MEMORY_VGA); /* explicit invalidation for the hardware cursor */ update |= (s->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1; if (update) { if (y_start < 0) y_start = y; - if (page0 < page_min) - page_min = page0; - if (page1 > page_max) - page_max = page1; if (!(is_buffer_shared(surface))) { vga_draw_line(s, d, s->vram_ptr + addr, width); if (s->cursor_draw_line) @@ -1846,13 +1841,6 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) dpy_gfx_update(s->con, 0, y_start, disp_width, y - y_start); } - /* reset modified pages */ - if (page_max >= page_min) { - memory_region_reset_dirty(&s->vram, - page_min, - page_max - page_min, - DIRTY_MEMORY_VGA); - } memset(s->invalidated_y_table, 0, ((height + 31) >> 5) * 4); } -- 1.8.3.1