]> xenbits.xensource.com Git - seabios.git/commitdiff
Enable VGA output when setting Cirrus-specific mode
authorLaszlo Ersek <lersek@redhat.com>
Thu, 14 Feb 2013 04:43:32 +0000 (05:43 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 17 Feb 2013 01:01:45 +0000 (20:01 -0500)
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@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
vgasrc/clext.c

index dd45df3cbe9a20d4cc528f6016de6493cfe96e3d..d02b8802fd2d5315347f3a55c070a4a71ca10384 100644 (file)
@@ -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