]> xenbits.xen.org Git - xenclient/ioemu-pq.git/commitdiff
fix clearing screen on switching bug
authorJames Mckenzie <jamesmck@british-chap.cam.xci-test.com>
Wed, 2 Dec 2009 14:22:00 +0000 (14:22 +0000)
committerJames Mckenzie <jamesmck@british-chap.cam.xci-test.com>
Wed, 2 Dec 2009 14:22:00 +0000 (14:22 +0000)
master/vga-clear-hw-fb-on-resize

index 28c429d21321b5f3fe4bfca30bda54c90e8b37a5..b257e282739cd29dbdd7c562af20f6d3bf03cbca 100644 (file)
@@ -1,13 +1,14 @@
 diff --git a/hw/vga.c b/hw/vga.c
-index e4e27a9..21ea2ac 100644
+index e4e27a9..cd0ce41 100644
 --- a/hw/vga.c
 +++ b/hw/vga.c
-@@ -638,6 +638,12 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
+@@ -638,6 +638,13 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
                       set_vram_mapping(s, s->lfb_addr, s->lfb_end);
                  }
  
 +                /* clear the screen (should be done in BIOS) */
 +                if (!(val & VBE_DISPI_NOCLEARMEM)) {
++                  fprintf(stderr,"VGA Clearing screen at %s:%d\n",__FILE__,__LINE__);
 +                    memset(s->vram_ptr, 0,
 +                           s->vbe_regs[VBE_DISPI_INDEX_YRES] * s->vbe_line_offset);
 +                }
@@ -15,11 +16,39 @@ index e4e27a9..21ea2ac 100644
                  s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] =
                      s->vbe_regs[VBE_DISPI_INDEX_XRES];
                  s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] =
-@@ -1610,6 +1616,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
+@@ -1554,6 +1561,25 @@ void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
+     }
+ }
++static void
++check_cls (VGAState * s, int width, int height, int depth, int line_offset)
++{
++  static int last_width, last_height, last_depth, last_line_offset;
++
++  if ((last_width == width) && (last_height == height)
++      && (last_depth == depth) && (last_line_offset == line_offset))
++    return;
++
++  last_width = width;
++  last_height = height;
++  last_depth = depth;
++  last_line_offset = line_offset;
++
++  fprintf (stderr, "VGA Clearing screen at %s:%d\n", __FILE__, __LINE__);
++
++  memset (s->vram_ptr + (s->start_addr * 4), 0x00, s->line_offset * height);
++}
++
+ /*
+  * graphic modes
+  */
+@@ -1610,6 +1636,9 @@ static void vga_draw_graphic(VGAState *s, int full_update)
          disp_width != s->last_width ||
          height != s->last_height ||
          s->last_depth != depth) {
-+        memset(s->vram_ptr + (s->start_addr * 4), 0x00, s->line_offset * height);
++
++      check_cls(s,width,height,depth,s->line_offset);
++
          if (depth == 32) {
              if (is_graphic_console()) {
                  qemu_free_displaysurface(s->ds);