From: Keir Fraser Date: Fri, 5 Dec 2008 11:37:20 +0000 (+0000) Subject: vga: Clear the screen when relinquishing VGA to dom0. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14026^2~69 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d78c163951889e91e4697f4c651fb4582338b48f;p=xen.git vga: Clear the screen when relinquishing VGA to dom0. Signed-off-by: Keir Fraser --- diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c index e36e358789..bace5c625d 100644 --- a/xen/drivers/video/vesa.c +++ b/xen/drivers/video/vesa.c @@ -146,10 +146,20 @@ void __init vesa_init(void) xfree(text_buf); } -void __init vesa_endboot(void) +void __init vesa_endboot(bool_t keep) { - xpos = 0; - vga_puts = vesa_scroll_puts; + if ( keep ) + { + xpos = 0; + vga_puts = vesa_scroll_puts; + } + else + { + unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3; + for ( i = 0; i < vlfb_info.height; i++ ) + memset(lfb + i * vlfb_info.bytes_per_line, 0, + vlfb_info.width * bpp); + } } #if defined(CONFIG_X86) diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c index ef21178a01..4582382375 100644 --- a/xen/drivers/video/vga.c +++ b/xen/drivers/video/vga.c @@ -57,10 +57,10 @@ static unsigned int columns, lines; #ifdef CONFIG_X86_64 void vesa_early_init(void); -void vesa_endboot(void); +void vesa_endboot(bool_t keep); #else #define vesa_early_init() ((void)0) -#define vesa_endboot() ((void)0) +#define vesa_endboot(x) ((void)0) #endif void __init vga_init(void) @@ -99,16 +99,27 @@ void __init vga_init(void) void __init vga_endboot(void) { - if ( vga_puts == vga_noop_puts ) + if ( !vga_console_info.video_type ) return; printk("Xen is %s VGA console.\n", vgacon_keep ? "keeping" : "relinquishing"); - vesa_endboot(); - if ( !vgacon_keep ) vga_puts = vga_noop_puts; + + switch ( vga_console_info.video_type ) + { + case XEN_VGATYPE_TEXT_MODE_3: + vesa_endboot(vgacon_keep); + break; + case XEN_VGATYPE_VESA_LFB: + if ( !vgacon_keep ) + memset(video, 0, columns * lines * 2); + break; + default: + BUG(); + } } static void vga_text_puts(const char *s)