From: Juan Quintela <quint...@trasno.org> Now page_min/max are not needed anymore.
Signed-off-by: Juan Quintela <quint...@redhat.com> --- hw/display/sm501.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index c75d6ac..2b2bfac 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1270,8 +1270,6 @@ static void sm501_draw_crt(SM501State * s) draw_hwc_line_func * draw_hwc_line = NULL; int full_update = 0; int y_start = -1; - ram_addr_t page_min = ~0l; - ram_addr_t page_max = 0l; ram_addr_t offset = 0; /* choose draw_line function */ @@ -1328,8 +1326,9 @@ static void sm501_draw_crt(SM501State * s) ram_addr_t page1 = offset + width * src_bpp - 1; /* check dirty flags for each line */ - update = memory_region_get_dirty(&s->local_mem_region, page0, - page1 - page0, DIRTY_MEMORY_VGA); + update = memory_region_test_and_clear_dirty(&s->local_mem_region, page0, + page1 - page0, + DIRTY_MEMORY_VGA); /* draw line and change status */ if (update) { @@ -1346,10 +1345,6 @@ static void sm501_draw_crt(SM501State * s) if (y_start < 0) y_start = y; - if (page0 < page_min) - page_min = page0; - if (page1 > page_max) - page_max = page1; } else { if (y_start >= 0) { /* flush to display */ @@ -1365,13 +1360,6 @@ static void sm501_draw_crt(SM501State * s) /* complete flush to display */ if (y_start >= 0) dpy_gfx_update(s->con, 0, y_start, width, y - y_start); - - /* clear dirty flags */ - if (page_min != ~0l) { - memory_region_reset_dirty(&s->local_mem_region, - page_min, page_max + TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA); - } } static void sm501_update_display(void *opaque) -- 1.8.3.1