[SeaBIOS] [PATCH] Enable VGA output when setting Cirrus-specific mode

Laszlo Ersek lersek at redhat.com
Mon Feb 18 21:27:26 CET 2013


Hi,

could someone please review this one-liner?

Thanks!
Laszlo

(PS: sorry for top posting)

On 02/14/13 05:43, Laszlo Ersek wrote:
> This patch does the same for Cirrus as David's following patch for bochs,
> originally posted under
> <http://www.seabios.org/pipermail/seabios/2013-February/005434.html>:
> 
>   Enable VGA output when settings bochs-specific mode
> 
>   When used from OVMF+CSM, we got no video output. It appears that we were
>   never enabling the display output except when configuring a text mode.
>   Which never happens, in the OVMF+CSM case.
> 
> In my testing on RHEL-6.3 with OVMF -D CSM_ENABLE / CONFIG_CSM bios.bin /
> CONFIG_QEMU vgabios.bin, using Cirrus, VESA mode 0x115 is selected (Direct
> Color, 800x600x24).
> 
> According to <http://www.osdever.net/FreeVGA/vga/attrreg.htm>,
> 
>   cirrus_switch_mode()
>     stdvga_attr_mask()
> 
> currently keeps/sets the "Attribute Controller Graphics Enable" bit set in
> the "Attribute Mode Control Register". When invoked from OVMF+CSM, that is
> not enough however, so let's do the same as for Bochs:
> 
>   stdvga_attrindex_write(0x20);
> 
> which corresponds to setting the "Palette Address Source" bit in the
> "Attribute Address Register":
> 
>   "This bit is set to 0 to load color values to the registers in the
>   internal palette. It is set to 1 for normal operation of the attribute
>   controller. [...]"
> 
> clext_set_mode()
>   stdvga_set_mode() -- for regular modes
>     stdvga_attrindex_write() -- existing call
>   cirrus_switch_mode() -- for Cirrus modes
>     stdvga_attrindex_write() -- call added by this patch
> 
> Signed-off-by: Laszlo Ersek <lersek at redhat.com>
> ---
>  My motivation for using Cirrus instead of stdvga is three-fold:
>  - using libvirt on RHEL-6.3, Cirrus seems to be the default video card
>    for the guests I tend to create,
>  - it provides better max resolution in the Fedora 18 guest,
>  - for some reason (maybe due to kernel build options?) the Fedora 18
>    guest can't display character mode consoles on stdvga, but works well
>    with Cirrus. (F18/Xorg/{stdvga,cirrus} are OK, and so are
>    RHEL6/{Xorg,console}/{stdvga,cirrus}.)
>  Tested with RHEL-6, Fedora 18, and Windows 8 Consumer Preview. 
> 
>  vgasrc/clext.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/vgasrc/clext.c b/vgasrc/clext.c
> index dd45df3..d02b880 100644
> --- a/vgasrc/clext.c
> +++ b/vgasrc/clext.c
> @@ -433,6 +433,7 @@ cirrus_switch_mode(struct cirrus_mode_s *table)
>      else if (memmodel != MM_TEXT)
>          on = 0x01;
>      stdvga_attr_mask(0x10, 0x01, on);
> +    stdvga_attrindex_write(0x20);
>  }
>  
>  static void




More information about the SeaBIOS mailing list