summaryrefslogtreecommitdiff
path: root/src/drivers/emulation/qemu
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/emulation/qemu')
-rw-r--r--src/drivers/emulation/qemu/Kconfig4
-rw-r--r--src/drivers/emulation/qemu/bochs.c19
-rw-r--r--src/drivers/emulation/qemu/cirrus.c22
3 files changed, 28 insertions, 17 deletions
diff --git a/src/drivers/emulation/qemu/Kconfig b/src/drivers/emulation/qemu/Kconfig
index f8aad88730..58daaa4487 100644
--- a/src/drivers/emulation/qemu/Kconfig
+++ b/src/drivers/emulation/qemu/Kconfig
@@ -16,11 +16,11 @@ config DRIVERS_EMULATION_QEMU_BOCHS
config DRIVERS_EMULATION_QEMU_BOCHS_XRES
int "bochs vga xres"
default 800
- depends on FRAMEBUFFER_KEEP_VESA_MODE
+ depends on LINEAR_FRAMEBUFFER
depends on DRIVERS_EMULATION_QEMU_BOCHS
config DRIVERS_EMULATION_QEMU_BOCHS_YRES
int "bochs vga yres"
default 600
- depends on FRAMEBUFFER_KEEP_VESA_MODE
+ depends on LINEAR_FRAMEBUFFER
depends on DRIVERS_EMULATION_QEMU_BOCHS
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 = {
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 = {