aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/video
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-12-05 11:37:20 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-12-05 11:37:20 +0000
commitd78c163951889e91e4697f4c651fb4582338b48f (patch)
tree9868cca4cf2f82dc2eae00e0b245a23852fea638 /xen/drivers/video
parent1badf51374df2054366eccc600f4368a89a29fa7 (diff)
downloadxen-d78c163951889e91e4697f4c651fb4582338b48f.tar.gz
xen-d78c163951889e91e4697f4c651fb4582338b48f.tar.bz2
xen-d78c163951889e91e4697f4c651fb4582338b48f.zip
vga: Clear the screen when relinquishing VGA to dom0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/drivers/video')
-rw-r--r--xen/drivers/video/vesa.c16
-rw-r--r--xen/drivers/video/vga.c21
2 files changed, 29 insertions, 8 deletions
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)