From 6d8266b91d7c8338350f7f8b81c21d10c97aceb6 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 20 May 2017 16:46:01 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/19804 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/drivers/emulation/qemu/bochs.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/drivers/emulation/qemu/bochs.c') diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c index 74a72471a7..48556a8150 100644 --- a/src/drivers/emulation/qemu/bochs.c +++ b/src/drivers/emulation/qemu/bochs.c @@ -41,7 +41,6 @@ #define VBE_DISPI_LFB_ENABLED 0x40 #define VBE_DISPI_NOCLEARMEM 0x80 -#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; @@ -56,11 +55,9 @@ static int bochs_read(int index) outw(index, VBE_DISPI_IOPORT_INDEX); return inw(VBE_DISPI_IOPORT_DATA); } -#endif -static void bochs_init(struct device *dev) +static void bochs_init_linear_fb(struct device *dev) { -#if IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE) struct edid edid; int id, mem, bar; u32 addr; @@ -115,10 +112,20 @@ static void bochs_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 +} + +static void bochs_init_text_mode(struct device *dev) +{ vga_misc_write(0x1); vga_textmode_init(); -#endif +} + +static void bochs_init(struct device *dev) +{ + if (IS_ENABLED(CONFIG_LINEAR_FRAMEBUFFER)) + bochs_init_linear_fb(dev); + else if (IS_ENABLED(CONFIG_VGA_TEXT_FRAMEBUFFER)) + bochs_init_text_mode(dev); } static struct device_operations qemu_graph_ops = { -- cgit v1.2.3