Skip to contentSkip to conversation

vga: fix region checks in wraparound case

PATCH In review Gerd Hoffmann 2 participants 2 messages Oct 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vga: fix region checks in wraparound case

Cc "Dr. David Alan Gilbert" <[email protected]>
---
 hw/display/vga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/vga.c +2 -2
index 1d19f6b..a64a094 100644
@@ -1666,9 +1666,9 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
             /* scanline wraps from end of video memory to the start */
             assert(force_shadow);
             update = memory_region_snapshot_get_dirty(&s->vram, snap,
-                                                      page0, 0);
+                                                      page0, s->vbe_size - page0);
             update |= memory_region_snapshot_get_dirty(&s->vram, snap,
-                                                       page1, 0);
+                                                       0, page1);
         } else {
             update = memory_region_snapshot_get_dirty(&s->vram, snap,
                                                       page0, page1 - page0);
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · * Gerd Hoffmann ([email protected]) wrote:
Cc "Dr. David Alan Gilbert" <[email protected]>

Makes more sense to me;

Quoted 23 lines
---
 hw/display/vga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/vga.c +2 -2
index 1d19f6b..a64a094 100644
@@ -1666,9 +1666,9 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
             /* scanline wraps from end of video memory to the start */
             assert(force_shadow);
             update = memory_region_snapshot_get_dirty(&s->vram, snap,
-                                                      page0, 0);
+                                                      page0, s->vbe_size - page0);
             update |= memory_region_snapshot_get_dirty(&s->vram, snap,
-                                                       page1, 0);
+                                                       0, page1);
         } else {
             update = memory_region_snapshot_get_dirty(&s->vram, snap,
                                                       page0, page1 - page0);
Signature · 1 line
2.9.3

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK