xcp-1.6-updates/xen-4.1.hg

changeset 23222:69610d3a7ba7

vesa: flush lfb after zeroing

If Xen is going to relinquish the VGA console, flush the linear frame
buffer after zeroing it in vesa_endboot().

Failing to do so in some circumstances leads to the actual linear
framebuffer on the graphics card still containing the output of the
Xen boot console can lead to ugly graphics output when dom0 is setting
up the graphics card for its own use.

While the patch is quite large, it is mostly just code motion to
prevent having to forward declare lfb_flush(). The only functional
change to vesa_endboot() is to insert a call to lbf_flush().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24615:ac9f32525376
xen-unstable date: Sat Jan 28 13:42:25 2012 +0000
author Andrew Cooper <andrew.cooper3@citrix.com>
date Tue Jan 31 11:45:57 2012 +0000 (2012-01-31)
parents 31be3984d927
children 00c4b19f2648
files xen/drivers/video/vesa.c
line diff
     1.1 --- a/xen/drivers/video/vesa.c	Tue Jan 31 11:45:37 2012 +0000
     1.2 +++ b/xen/drivers/video/vesa.c	Tue Jan 31 11:45:57 2012 +0000
     1.3 @@ -153,24 +153,6 @@ void __init vesa_init(void)
     1.4      xfree(line_len);
     1.5  }
     1.6  
     1.7 -void __init vesa_endboot(bool_t keep)
     1.8 -{
     1.9 -    if ( keep )
    1.10 -    {
    1.11 -        xpos = 0;
    1.12 -        vga_puts = vesa_scroll_puts;
    1.13 -    }
    1.14 -    else
    1.15 -    {
    1.16 -        unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3;
    1.17 -        for ( i = 0; i < vlfb_info.height; i++ )
    1.18 -            memset(lfb + i * vlfb_info.bytes_per_line, 0,
    1.19 -                   vlfb_info.width * bpp);
    1.20 -    }
    1.21 -
    1.22 -    xfree(line_len);
    1.23 -}
    1.24 -
    1.25  #if defined(CONFIG_X86)
    1.26  
    1.27  #include <asm/mtrr.h>
    1.28 @@ -217,6 +199,25 @@ static void lfb_flush(void)
    1.29  
    1.30  #endif
    1.31  
    1.32 +void __init vesa_endboot(bool_t keep)
    1.33 +{
    1.34 +    if ( keep )
    1.35 +    {
    1.36 +        xpos = 0;
    1.37 +        vga_puts = vesa_scroll_puts;
    1.38 +    }
    1.39 +    else
    1.40 +    {
    1.41 +        unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3;
    1.42 +        for ( i = 0; i < vlfb_info.height; i++ )
    1.43 +            memset(lfb + i * vlfb_info.bytes_per_line, 0,
    1.44 +                   vlfb_info.width * bpp);
    1.45 +        lfb_flush();
    1.46 +    }
    1.47 +
    1.48 +    xfree(line_len);
    1.49 +}
    1.50 +
    1.51  /* Render one line of text to given linear framebuffer line. */
    1.52  static void vesa_show_line(
    1.53      const unsigned char *text_line,