ia64/xen-unstable
changeset 18882:5e066dc410ac
vga: Clear the screen when relinquishing VGA to dom0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Dec 05 11:37:20 2008 +0000 (2008-12-05) |
parents | b44e244d7bb9 |
children | eed39afde7dd |
files | xen/drivers/video/vesa.c xen/drivers/video/vga.c |
line diff
1.1 --- a/xen/drivers/video/vesa.c Fri Dec 05 11:05:45 2008 +0000 1.2 +++ b/xen/drivers/video/vesa.c Fri Dec 05 11:37:20 2008 +0000 1.3 @@ -146,10 +146,20 @@ void __init vesa_init(void) 1.4 xfree(text_buf); 1.5 } 1.6 1.7 -void __init vesa_endboot(void) 1.8 +void __init vesa_endboot(bool_t keep) 1.9 { 1.10 - xpos = 0; 1.11 - vga_puts = vesa_scroll_puts; 1.12 + if ( keep ) 1.13 + { 1.14 + xpos = 0; 1.15 + vga_puts = vesa_scroll_puts; 1.16 + } 1.17 + else 1.18 + { 1.19 + unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3; 1.20 + for ( i = 0; i < vlfb_info.height; i++ ) 1.21 + memset(lfb + i * vlfb_info.bytes_per_line, 0, 1.22 + vlfb_info.width * bpp); 1.23 + } 1.24 } 1.25 1.26 #if defined(CONFIG_X86)
2.1 --- a/xen/drivers/video/vga.c Fri Dec 05 11:05:45 2008 +0000 2.2 +++ b/xen/drivers/video/vga.c Fri Dec 05 11:37:20 2008 +0000 2.3 @@ -57,10 +57,10 @@ static unsigned int columns, lines; 2.4 2.5 #ifdef CONFIG_X86_64 2.6 void vesa_early_init(void); 2.7 -void vesa_endboot(void); 2.8 +void vesa_endboot(bool_t keep); 2.9 #else 2.10 #define vesa_early_init() ((void)0) 2.11 -#define vesa_endboot() ((void)0) 2.12 +#define vesa_endboot(x) ((void)0) 2.13 #endif 2.14 2.15 void __init vga_init(void) 2.16 @@ -99,16 +99,27 @@ void __init vga_init(void) 2.17 2.18 void __init vga_endboot(void) 2.19 { 2.20 - if ( vga_puts == vga_noop_puts ) 2.21 + if ( !vga_console_info.video_type ) 2.22 return; 2.23 2.24 printk("Xen is %s VGA console.\n", 2.25 vgacon_keep ? "keeping" : "relinquishing"); 2.26 2.27 - vesa_endboot(); 2.28 - 2.29 if ( !vgacon_keep ) 2.30 vga_puts = vga_noop_puts; 2.31 + 2.32 + switch ( vga_console_info.video_type ) 2.33 + { 2.34 + case XEN_VGATYPE_TEXT_MODE_3: 2.35 + vesa_endboot(vgacon_keep); 2.36 + break; 2.37 + case XEN_VGATYPE_VESA_LFB: 2.38 + if ( !vgacon_keep ) 2.39 + memset(video, 0, columns * lines * 2); 2.40 + break; 2.41 + default: 2.42 + BUG(); 2.43 + } 2.44 } 2.45 2.46 static void vga_text_puts(const char *s)