Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39004 )
Change subject: [WIP]drivers: Replace set_vbe_mode_info_valid ......................................................................
[WIP]drivers: Replace set_vbe_mode_info_valid
Replace set_vbe_mode_info_valid with fb_fill_framebuffer_info, as it doesn't need a complete edid struct s paramter.
The platforms doesn't read an EDID anyway.
Change-Id: I95d1d62385a201c68c6c2527c023ad2292a235c5 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/aspeed/common/ast_mode_corebootfb.c M src/drivers/emulation/qemu/bochs.c M src/drivers/emulation/qemu/cirrus.c M src/mainboard/emulation/qemu-armv7/mainboard.c M src/soc/nvidia/tegra210/dc.c 5 files changed, 33 insertions(+), 43 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/39004/1
diff --git a/src/drivers/aspeed/common/ast_mode_corebootfb.c b/src/drivers/aspeed/common/ast_mode_corebootfb.c index 2ec85ac..fed7754 100644 --- a/src/drivers/aspeed/common/ast_mode_corebootfb.c +++ b/src/drivers/aspeed/common/ast_mode_corebootfb.c @@ -30,6 +30,7 @@ */
#include <edid.h> +#include <framebuffer_info.h>
#include "ast_drv.h"
@@ -247,7 +248,12 @@ ast_hide_cursor(&crtc);
/* Advertise new mode */ - set_vbe_mode_info_valid(&edid, fb.mmio_addr); + struct edid_fb_info *info = fb_new_framebuffer_info(); + if (info) { + fb_fill_framebuffer_info(info, fb.mmio_addr, edid.x_resolution, + edid.y_resolution, edid.bytes_per_line, + edid.framebuffer_bits_per_pixel); + }
/* Clear display */ memset((void *)fb.mmio_addr, 0, edid.bytes_per_line * edid.y_resolution); diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c index d9e4ce1..959d431 100644 --- a/src/drivers/emulation/qemu/bochs.c +++ b/src/drivers/emulation/qemu/bochs.c @@ -12,7 +12,6 @@ */
#include <stdint.h> -#include <edid.h> #include <arch/io.h> #include <console/console.h> #include <device/device.h> @@ -20,6 +19,7 @@ #include <device/pci_ops.h> #include <pc80/vga.h> #include <pc80/vga_io.h> +#include <framebuffer_info.h>
/* VGA init. We use the Bochs VESA VBE extensions */ #define VBE_DISPI_IOPORT_INDEX 0x01CE @@ -65,7 +65,6 @@
static void bochs_init_linear_fb(struct device *dev) { - struct edid edid; int id, mem, bar; u32 addr;
@@ -112,13 +111,11 @@
outb(0x20, 0x3c0); /* 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, addr); + /* Advertise new mode */ + struct edid_fb_info *info = fb_new_framebuffer_info(); + if (info) { + fb_fill_framebuffer_info(info, addr, width, height, 4 * width, 24); + } }
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 6b1968c..8f048f9 100644 --- a/src/drivers/emulation/qemu/cirrus.c +++ b/src/drivers/emulation/qemu/cirrus.c @@ -13,13 +13,13 @@ */
#include <stdint.h> -#include <edid.h> #include <console/console.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ops.h> #include <pc80/vga.h> #include <pc80/vga_io.h> +#include <framebuffer_info.h>
static int width = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_XRES; static int height = CONFIG_DRIVERS_EMULATION_QEMU_BOCHS_YRES; @@ -311,14 +311,10 @@ 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); + struct edid_fb_info *info = fb_new_framebuffer_info(); + if (info) { + fb_fill_framebuffer_info(info, addr, width, height, 4 * width, 24); + } }
static void cirrus_init_text_mode(struct device *dev) diff --git a/src/mainboard/emulation/qemu-armv7/mainboard.c b/src/mainboard/emulation/qemu-armv7/mainboard.c index 338cff9..22340b2 100644 --- a/src/mainboard/emulation/qemu-armv7/mainboard.c +++ b/src/mainboard/emulation/qemu-armv7/mainboard.c @@ -18,15 +18,14 @@ #include <device/device.h> #include <cbmem.h> #include <halt.h> -#include <edid.h> #include <device/mmio.h> #include <ramdetect.h> #include <symbols.h> +#include <framebuffer_info.h>
static void init_gfx(void) { uint32_t *pl111; - struct edid edid; /* width is at most 4096 */ /* height is at most 1024 */ int width = 800, height = 600; @@ -42,12 +41,10 @@ write32(pl111 + 10, 0xff); write32(pl111 + 6, (5 << 1) | 0x801);
- edid.framebuffer_bits_per_pixel = 32; - edid.bytes_per_line = width * 4; - edid.x_resolution = width; - edid.y_resolution = height; - - set_vbe_mode_info_valid(&edid, framebuffer); + struct edid_fb_info *info = fb_new_framebuffer_info(); + if (info) { + fb_fill_framebuffer_info(info, framebuffer, width, height, 4 * width, 32); + } }
static void mainboard_enable(struct device *dev) diff --git a/src/soc/nvidia/tegra210/dc.c b/src/soc/nvidia/tegra210/dc.c index 46443cf..b4e3378 100644 --- a/src/soc/nvidia/tegra210/dc.c +++ b/src/soc/nvidia/tegra210/dc.c @@ -16,10 +16,10 @@ #include <console/console.h> #include <device/mmio.h> #include <stdint.h> -#include <edid.h> #include <device/device.h> #include <soc/nvidia/tegra/dc.h> #include <soc/display.h> +#include <framebuffer_info.h>
#include "chip.h"
@@ -226,19 +226,13 @@ void pass_mode_info_to_payload( struct soc_nvidia_tegra210_config *config) { - struct edid edid; - - edid.mode.va = config->display_yres; - edid.mode.ha = config->display_xres; - edid_set_framebuffer_bits_per_pixel(&edid, - config->framebuffer_bits_per_pixel, 64); - - printk(BIOS_INFO, "%s: bytes_per_line: %d, bits_per_pixel: %d\n " - " x_res x y_res: %d x %d, size: %d\n", - __func__, edid.bytes_per_line, - edid.framebuffer_bits_per_pixel, - edid.x_resolution, edid.y_resolution, - (edid.bytes_per_line * edid.y_resolution)); - - set_vbe_mode_info_valid(&edid, 0); + struct edid_fb_info *info = fb_new_framebuffer_info(); + if (info) { + uint32_t bytes_per_line = ALIGN_UP(config->display_xres * + DIV_ROUND_UP(config->framebuffer_bits_per_pixel, 8), 64); + //FIXME: Why not config->framebuffer_base? + fb_fill_framebuffer_info(info, 0, + config->display_xres, config->display_yres, + bytes_per_line, config->framebuffer_bits_per_pixel); + } }