From 8b56c8c6b2694500318eba14e291a0586837ebe8 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 19 Feb 2020 12:57:00 +0100 Subject: drivers: Replace set_vbe_mode_info_valid Currently it's not possible to add multiple graphics driver into one coreboot image. This patch series will fix this issue by providing a single API that multiple graphics driver can use. This is required for platforms that have two graphic cards, but different graphic drivers, like Intel+Aspeed on server platforms or Intel+Nvidia on consumer notebooks. The goal is to remove duplicated fill_fb_framebuffer(), the advertisment of multiple indepent framebuffers in coreboot tables, and better runtime/build time graphic configuration options. Replace set_vbe_mode_info_valid with fb_add_framebuffer_info or fb_new_framebuffer_info_from_edid. Change-Id: I95d1d62385a201c68c6c2527c023ad2292a235c5 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/39004 Tested-by: build bot (Jenkins) Reviewed-by: Hung-Te Lin --- src/drivers/emulation/qemu/bochs.c | 12 +++--------- src/drivers/emulation/qemu/cirrus.c | 10 ++-------- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'src/drivers/emulation/qemu') diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c index 5a6603ee1e..73fa19e2ca 100644 --- a/src/drivers/emulation/qemu/bochs.c +++ b/src/drivers/emulation/qemu/bochs.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include /* VGA init. We use the Bochs VESA VBE extensions */ #define VBE_DISPI_IOPORT_INDEX 0x01CE @@ -82,7 +82,6 @@ static struct resource res_legacy = { static void bochs_init_linear_fb(struct device *dev) { - struct edid edid; struct resource *res_fb, *res_io; int id, mem, bar; @@ -139,13 +138,8 @@ static void bochs_init_linear_fb(struct device *dev) bochs_vga_write(res_io, 0, 0x20); /* disable blanking */ - /* setup coreboot framebuffer */ - edid.mode.ha = width; - edid.mode.va = height; - edid.panel_bits_per_color = 8; - edid.panel_bits_per_pixel = 24; - edid_set_framebuffer_bits_per_pixel(&edid, 32, 0); - set_vbe_mode_info_valid(&edid, res_fb->base); + /* Advertise new mode */ + fb_add_framebuffer_info(res_fb->base, width, height, 4 * width, 32); } static void bochs_init_text_mode(struct device *dev) diff --git a/src/drivers/emulation/qemu/cirrus.c b/src/drivers/emulation/qemu/cirrus.c index d63f490603..d9e0e1bd14 100644 --- a/src/drivers/emulation/qemu/cirrus.c +++ b/src/drivers/emulation/qemu/cirrus.c @@ -1,13 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include -#include #include #include #include #include #include #include +#include static int width = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_XRES; static int height = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_YRES; @@ -299,13 +299,7 @@ static void cirrus_init_linear_fb(struct device *dev) vga_sr_write (CIRRUS_SR_EXTENDED_MODE, sr_ext); write_hidden_dac (hidden_dac); - struct edid edid; - edid.mode.ha = width; - edid.mode.va = height; - edid.panel_bits_per_color = 8; - edid.panel_bits_per_pixel = 24; - edid_set_framebuffer_bits_per_pixel(&edid, 32, 0); - set_vbe_mode_info_valid(&edid, addr); + fb_add_framebuffer_info(addr, width, height, 4 * width, 32); } static void cirrus_init_text_mode(struct device *dev) -- cgit v1.2.3