summaryrefslogtreecommitdiff
path: root/src/drivers/emulation/qemu/cirrus.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2017-05-20 16:46:01 +0200
committerMartin Roth <martinroth@google.com>2017-06-04 18:47:19 +0200
commit6d8266b91d7c8338350f7f8b81c21d10c97aceb6 (patch)
tree9b10087e4cd90b56fbe1474c46958b2e3286b30d /src/drivers/emulation/qemu/cirrus.c
parent49d99fcebc7c3860def51812c2f723ad3e8a4ea3 (diff)
downloadcoreboot-6d8266b91d7c8338350f7f8b81c21d10c97aceb6.tar.xz
Kconfig: Add choice of framebuffer mode
Rename `FRAMEBUFFER_KEEP_VESA_MODE` to `LINEAR_FRAMEBUFFER` and put it together with new `VGA_TEXT_FRAMEBUFFER` into a choice. There are two versions of `LINEAR_FRAMEBUFFER` that differ only in the prompt and help text (one for `HAVE_VBE_LINEAR_FRAMEBUFFER` and one for `HAVE_LINEAR_FRAMEBUFFER`). Due to `kconfig_lint` we have to model that with additional symbols. Change-Id: I9144351491a14d9bb5e650c14933b646bc83fab0 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/19804 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/emulation/qemu/cirrus.c')
-rw-r--r--src/drivers/emulation/qemu/cirrus.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/drivers/emulation/qemu/cirrus.c b/src/drivers/emulation/qemu/cirrus.c
index dc20f540ae..61b329d26c 100644
--- a/src/drivers/emulation/qemu/cirrus.c
+++ b/src/drivers/emulation/qemu/cirrus.c
@@ -31,11 +31,9 @@
#include <pc80/vga.h>
#include <pc80/vga_io.h>
-#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)
static int width = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_XRES;
static int height = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_YRES;
static u32 addr = 0;
-#endif
enum
{
@@ -194,7 +192,6 @@ enum
#define CIRRUS_SR_EXTENDED_MODE_32BPP 0x08
#define CIRRUS_HIDDEN_DAC_888COLOR 0xc5
-#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)
static void
write_hidden_dac (uint8_t data)
{
@@ -205,11 +202,9 @@ write_hidden_dac (uint8_t data)
inb (0x3c6);
outb (data, 0x3c6);
}
-#endif
-static void cirrus_init(struct device *dev)
+static void cirrus_init_linear_fb(struct device *dev)
{
-#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)
uint8_t cr_ext, cr_overlay;
unsigned pitch = (width * 4) / VGA_CR_PITCH_DIVISOR;
uint8_t sr_ext = 0, hidden_dac = 0;
@@ -334,11 +329,20 @@ static void cirrus_init(struct device *dev)
edid.panel_bits_per_pixel = 24;
edid_set_framebuffer_bits_per_pixel(&edid, 32, 0);
set_vbe_mode_info_valid(&edid, addr);
-#else
- vga_misc_write(0x1);
+}
+static void cirrus_init_text_mode(struct device *dev)
+{
+ vga_misc_write(0x1);
vga_textmode_init();
-#endif
+}
+
+static void cirrus_init(struct device *dev)
+{
+ if (IS_ENABLED(CONFIG_LINEAR_FRAMEBUFFER))
+ cirrus_init_linear_fb(dev);
+ else if (IS_ENABLED(CONFIG_VGA_TEXT_FRAMEBUFFER))
+ cirrus_init_text_mode(dev);
}
static struct device_operations qemu_cirrus_graph_ops = {