pl110 display update fix
PATCH 1/1 pl110 display update fix
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
Index: hw/pl110.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pl110.c,v
retrieving revision 1.7
pl110.c +8 -12
@@ -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;