From: James Mckenzie Date: Wed, 2 Dec 2009 14:22:00 +0000 (+0000) Subject: fix clearing screen on switching bug X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=22f9b5cf0ed27245090232bd4574bc24b01cab5e;p=xenclient%2Fioemu-pq.git fix clearing screen on switching bug --- diff --git a/master/vga-clear-hw-fb-on-resize b/master/vga-clear-hw-fb-on-resize index 28c429d..b257e28 100644 --- a/master/vga-clear-hw-fb-on-resize +++ b/master/vga-clear-hw-fb-on-resize @@ -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);