[coreboot-gerrit] Patch set updated for coreboot: 270c4a4 bochs: add support for native graphics
Ronald G. Minnich (rminnich@gmail.com)
gerrit at coreboot.org
Fri Nov 22 20:33:46 CET 2013
Ronald G. Minnich (rminnich at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4258
-gerrit
commit 270c4a472cb4e0a84257d18f531bd48a916a78fb
Author: Ronald G. Minnich <rminnich at google.com>
Date: Tue Nov 19 17:42:41 2013 -0800
bochs: add support for native graphics
Per our discussions with Gerd, qemu will now always do native graphics
on coreboot. The VGA BIOS capability is not needed and will no longer
be supported. Attempts to build without native graphics will result in
an error.
This code builds for both x86 emulation targets. I'm hitting an issue
testing that is unrelated to coreboot; if someone can test, that
would be helpful. Be sure to start qemu with -vga std.
We also add a test for the PCI BAR being zero and return silently if it
is.
Change-Id: I66188f61e1bac7ad93c989cc10f3e0b55140e148
Signed-off-by: Ronald G. Minnich <rminnich at google.com>
---
src/drivers/emulation/qemu/bochs.c | 42 +++++++++--------------------
src/mainboard/emulation/qemu-i440fx/Kconfig | 1 +
src/mainboard/emulation/qemu-q35/Kconfig | 1 +
3 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c
index 1fd7e28..eb11e34 100644
--- a/src/drivers/emulation/qemu/bochs.c
+++ b/src/drivers/emulation/qemu/bochs.c
@@ -1,4 +1,6 @@
+#include <stdint.h>
#include <delay.h>
+#include <edid.h>
#include <stdlib.h>
#include <string.h>
#include <arch/io.h>
@@ -64,8 +66,6 @@ static void bochs_init(device_t dev)
return;
}
mem = bochs_read(VBE_DISPI_INDEX_VIDEO_MEMORY_64K) * 64 * 1024;
- printk(BIOS_DEBUG, "QEMU VGA: bochs dispi interface found, "
- "%d MiB video memory\n", mem / ( 1024 * 1024));
/* find lfb pci bar */
addr = pci_read_config32(dev, PCI_BASE_ADDRESS_0);
@@ -78,6 +78,12 @@ static void bochs_init(device_t dev)
bar = 1;
}
addr &= ~PCI_BASE_ADDRESS_MEM_ATTR_MASK;
+
+ if (!addr)
+ return;
+
+ printk(BIOS_DEBUG, "QEMU VGA: bochs dispi interface found, "
+ "%d MiB video memory\n", mem / ( 1024 * 1024));
printk(BIOS_DEBUG, "QEMU VGA: framebuffer @ %x (pci bar %d)\n",
addr, bar);
@@ -95,33 +101,11 @@ static void bochs_init(device_t dev)
VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
outb(0x20, 0x3c0); /* disable blanking */
-}
-
-int vbe_mode_info_valid(void);
-int vbe_mode_info_valid(void)
-{
- return addr != 0;
-}
-
-void fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
-void fill_lb_framebuffer(struct lb_framebuffer *framebuffer)
-{
- printk(BIOS_DEBUG, "QEMU VGA: fill lb_framebuffer: %dx%d @ %x\n",
- width, height, addr);
-
- framebuffer->physical_address = addr;
- framebuffer->x_resolution = width;
- framebuffer->y_resolution = height;
- framebuffer->bytes_per_line = width * 4;
- framebuffer->bits_per_pixel = 32;
- framebuffer->red_mask_pos = 16;
- framebuffer->red_mask_size = 8;
- framebuffer->green_mask_pos = 8;
- framebuffer->green_mask_size = 8;
- framebuffer->blue_mask_pos = 0;
- framebuffer->blue_mask_size = 8;
- framebuffer->reserved_mask_pos = 24;
- framebuffer->reserved_mask_size = 8;
+ struct edid edid;
+ edid.ha = width;
+ edid.va = height;
+ edid.bpp = 32;
+ set_vbe_mode_info_valid(&edid, addr);
}
static struct device_operations qemu_graph_ops = {
diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig
index b462b8c..0d4d07a 100644
--- a/src/mainboard/emulation/qemu-i440fx/Kconfig
+++ b/src/mainboard/emulation/qemu-i440fx/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select BOARD_ROMSIZE_KB_256
select EARLY_CBMEM_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select MAINBOARD_DO_NATIVE_VGA_INIT
config MAINBOARD_DIR
string
diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig
index 9d78bb8..cd7024b 100644
--- a/src/mainboard/emulation/qemu-q35/Kconfig
+++ b/src/mainboard/emulation/qemu-q35/Kconfig
@@ -16,6 +16,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select BOARD_ROMSIZE_KB_256
select EARLY_CBMEM_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select MAINBOARD_DO_NATIVE_VGA_INIT
config MAINBOARD_DIR
string
More information about the coreboot-gerrit
mailing list