Hi,
Here is the runtime vga hardware detection patch series, rebased and adapted to latest master.
Gerd Hoffmann (7): vga: move code to vgahw.c vga: add pci hardware detection vga: add isa hardware detection vga: adapt kconfig vga: add vmware vga: add qxl vga: fix bochs lfb size display
Makefile | 2 +- vgasrc/Kconfig | 61 ++++++++---------- vgasrc/bochsvga.c | 10 +++- vgasrc/bochsvga.h | 1 + vgasrc/clext.c | 6 ++ vgasrc/clext.h | 1 + vgasrc/vgahw.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++ vgasrc/vgahw.h | 113 ++++++++----------------------- 8 files changed, 266 insertions(+), 119 deletions(-) create mode 100644 vgasrc/vgahw.c
Create vgahw.c, move code from vgahw.h there, soon we will add more bits there which will make inlining less useful.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- Makefile | 2 +- vgasrc/vgahw.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vgasrc/vgahw.h | 93 ++++++------------------------------------------------ 3 files changed, 106 insertions(+), 84 deletions(-) create mode 100644 vgasrc/vgahw.c
diff --git a/Makefile b/Makefile index 0343ce5..1dcfaeb 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,7 @@ $(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o tools/checkrom.py SRCVGA=src/output.c src/util.c src/pci.c \ vgasrc/vgabios.c vgasrc/vgafb.c vgasrc/vgafonts.c vgasrc/vbe.c \ vgasrc/stdvga.c vgasrc/stdvgamodes.c vgasrc/stdvgaio.c \ - vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c + vgasrc/vgahw.c vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c
CFLAGS16VGA = $(CFLAGS16INC) -g -Isrc
diff --git a/vgasrc/vgahw.c b/vgasrc/vgahw.c new file mode 100644 index 0000000..be5945e --- /dev/null +++ b/vgasrc/vgahw.c @@ -0,0 +1,95 @@ +#include "vgahw.h" + +struct vgamode_s *vgahw_find_mode(int mode) +{ + if (CONFIG_VGA_CIRRUS) + return clext_find_mode(mode); + if (CONFIG_VGA_BOCHS) + return bochsvga_find_mode(mode); + return stdvga_find_mode(mode); +} + +int vgahw_set_mode(struct vgamode_s *vmode_g, int flags) +{ + if (CONFIG_VGA_CIRRUS) + return clext_set_mode(vmode_g, flags); + if (CONFIG_VGA_BOCHS) + return bochsvga_set_mode(vmode_g, flags); + return stdvga_set_mode(vmode_g, flags); +} + +void vgahw_list_modes(u16 seg, u16 *dest, u16 *last) +{ + if (CONFIG_VGA_CIRRUS) + clext_list_modes(seg, dest, last); + else if (CONFIG_VGA_BOCHS) + bochsvga_list_modes(seg, dest, last); + else + stdvga_list_modes(seg, dest, last); +} + +int vgahw_init(void) +{ + if (CONFIG_VGA_CIRRUS) + return clext_init(); + if (CONFIG_VGA_BOCHS) + return bochsvga_init(); + if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX) + return geodevga_init(); + return stdvga_init(); +} + +int vgahw_get_window(struct vgamode_s *vmode_g, int window) +{ + if (CONFIG_VGA_CIRRUS) + return clext_get_window(vmode_g, window); + if (CONFIG_VGA_BOCHS) + return bochsvga_get_window(vmode_g, window); + return stdvga_get_window(vmode_g, window); +} + +int vgahw_set_window(struct vgamode_s *vmode_g, int window, int val) +{ + if (CONFIG_VGA_CIRRUS) + return clext_set_window(vmode_g, window, val); + if (CONFIG_VGA_BOCHS) + return bochsvga_set_window(vmode_g, window, val); + return stdvga_set_window(vmode_g, window, val); +} + +int vgahw_get_linelength(struct vgamode_s *vmode_g) +{ + if (CONFIG_VGA_CIRRUS) + return clext_get_linelength(vmode_g); + if (CONFIG_VGA_BOCHS) + return bochsvga_get_linelength(vmode_g); + return stdvga_get_linelength(vmode_g); +} + +int vgahw_set_linelength(struct vgamode_s *vmode_g, int val) +{ + if (CONFIG_VGA_CIRRUS) + return clext_set_linelength(vmode_g, val); + if (CONFIG_VGA_BOCHS) + return bochsvga_set_linelength(vmode_g, val); + return stdvga_set_linelength(vmode_g, val); +} + +int vgahw_get_displaystart(struct vgamode_s *vmode_g) +{ + if (CONFIG_VGA_CIRRUS) + return clext_get_displaystart(vmode_g); + if (CONFIG_VGA_BOCHS) + return bochsvga_get_displaystart(vmode_g); + return stdvga_get_displaystart(vmode_g); +} + +int vgahw_set_displaystart(struct vgamode_s *vmode_g, int val) +{ + if (CONFIG_VGA_CIRRUS) + return clext_set_displaystart(vmode_g, val); + if (CONFIG_VGA_BOCHS) + return bochsvga_set_displaystart(vmode_g, val); + return stdvga_set_displaystart(vmode_g, val); +} + diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h index af6b068..751d4fd 100644 --- a/vgasrc/vgahw.h +++ b/vgasrc/vgahw.h @@ -9,88 +9,15 @@ #include "stdvga.h" // stdvga_set_mode #include "geodevga.h" // geodevga_init
-static inline struct vgamode_s *vgahw_find_mode(int mode) { - if (CONFIG_VGA_CIRRUS) - return clext_find_mode(mode); - if (CONFIG_VGA_BOCHS) - return bochsvga_find_mode(mode); - return stdvga_find_mode(mode); -} - -static inline int vgahw_set_mode(struct vgamode_s *vmode_g, int flags) { - if (CONFIG_VGA_CIRRUS) - return clext_set_mode(vmode_g, flags); - if (CONFIG_VGA_BOCHS) - return bochsvga_set_mode(vmode_g, flags); - return stdvga_set_mode(vmode_g, flags); -} - -static inline void vgahw_list_modes(u16 seg, u16 *dest, u16 *last) { - if (CONFIG_VGA_CIRRUS) - clext_list_modes(seg, dest, last); - else if (CONFIG_VGA_BOCHS) - bochsvga_list_modes(seg, dest, last); - else - stdvga_list_modes(seg, dest, last); -} - -static inline int vgahw_init(void) { - if (CONFIG_VGA_CIRRUS) - return clext_init(); - if (CONFIG_VGA_BOCHS) - return bochsvga_init(); - if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX) - return geodevga_init(); - return stdvga_init(); -} - -static inline int vgahw_get_window(struct vgamode_s *vmode_g, int window) { - if (CONFIG_VGA_CIRRUS) - return clext_get_window(vmode_g, window); - if (CONFIG_VGA_BOCHS) - return bochsvga_get_window(vmode_g, window); - return stdvga_get_window(vmode_g, window); -} - -static inline int vgahw_set_window(struct vgamode_s *vmode_g, int window - , int val) { - if (CONFIG_VGA_CIRRUS) - return clext_set_window(vmode_g, window, val); - if (CONFIG_VGA_BOCHS) - return bochsvga_set_window(vmode_g, window, val); - return stdvga_set_window(vmode_g, window, val); -} - -static inline int vgahw_get_linelength(struct vgamode_s *vmode_g) { - if (CONFIG_VGA_CIRRUS) - return clext_get_linelength(vmode_g); - if (CONFIG_VGA_BOCHS) - return bochsvga_get_linelength(vmode_g); - return stdvga_get_linelength(vmode_g); -} - -static inline int vgahw_set_linelength(struct vgamode_s *vmode_g, int val) { - if (CONFIG_VGA_CIRRUS) - return clext_set_linelength(vmode_g, val); - if (CONFIG_VGA_BOCHS) - return bochsvga_set_linelength(vmode_g, val); - return stdvga_set_linelength(vmode_g, val); -} - -static inline int vgahw_get_displaystart(struct vgamode_s *vmode_g) { - if (CONFIG_VGA_CIRRUS) - return clext_get_displaystart(vmode_g); - if (CONFIG_VGA_BOCHS) - return bochsvga_get_displaystart(vmode_g); - return stdvga_get_displaystart(vmode_g); -} - -static inline int vgahw_set_displaystart(struct vgamode_s *vmode_g, int val) { - if (CONFIG_VGA_CIRRUS) - return clext_set_displaystart(vmode_g, val); - if (CONFIG_VGA_BOCHS) - return bochsvga_set_displaystart(vmode_g, val); - return stdvga_set_displaystart(vmode_g, val); -} +struct vgamode_s *vgahw_find_mode(int mode); +int vgahw_set_mode(struct vgamode_s *vmode_g, int flags); +void vgahw_list_modes(u16 seg, u16 *dest, u16 *last); +int vgahw_init(void); +int vgahw_get_window(struct vgamode_s *vmode_g, int window); +int vgahw_set_window(struct vgamode_s *vmode_g, int window, int val); +int vgahw_get_linelength(struct vgamode_s *vmode_g); +int vgahw_set_linelength(struct vgamode_s *vmode_g, int val); +int vgahw_get_displaystart(struct vgamode_s *vmode_g); +int vgahw_set_displaystart(struct vgamode_s *vmode_g, int val);
#endif // vgahw.h
Add support for pci hardware detection (using pci id lookup), so we can create a unified rom with support for different pieces of hardware.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- vgasrc/vgahw.c | 109 ++++++++++++++++++++++++++++++++++++++++++++----------- vgasrc/vgahw.h | 20 ++++++++++ 2 files changed, 107 insertions(+), 22 deletions(-)
diff --git a/vgasrc/vgahw.c b/vgasrc/vgahw.c index be5945e..77b8e77 100644 --- a/vgasrc/vgahw.c +++ b/vgasrc/vgahw.c @@ -1,28 +1,72 @@ #include "vgahw.h" +#include "config.h" // CONFIG_* +#include "util.h" // dprintf +#include "biosvar.h" // GET_GLOBAL +#include "pci.h" // pci_config_readw +#include "pci_regs.h" // PCI_VENDOR_ID +#include "vgabios.h" // VgaBDF + +struct vga_pci_table { + u16 vid; + u16 did; + char *name; + enum vga_type type; + int supported; +}; + +static struct vga_pci_table hwtab[] VAR16 = { + { + .vid = 0x1013, + .did = 0x00b8, + .name = "QEMU Cirrus VGA (CLGD 54xx)", + .type = VGA_TYPE_CIRRUS, + .supported = CONFIG_VGA_CIRRUS, + },{ + .vid = 0x1234, + .did = 0x1111, + .name = "QEMU Standard VGA", + .type = VGA_TYPE_BOCHS, + .supported = CONFIG_VGA_BOCHS, + },{ + .vid = 0x100b, + .did = 0x0030, + .name = "Geode GX2", + .type = VGA_TYPE_GEODEGX2, + .supported = CONFIG_VGA_GEODEGX2, + },{ + .vid = 0x1022, + .did = 0x2081, + .name = "Geode LX", + .type = VGA_TYPE_GEODELX, + .supported = CONFIG_VGA_GEODELX, + } +}; + +enum vga_type vga_type VAR16;
struct vgamode_s *vgahw_find_mode(int mode) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_find_mode(mode); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_find_mode(mode); return stdvga_find_mode(mode); }
int vgahw_set_mode(struct vgamode_s *vmode_g, int flags) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_set_mode(vmode_g, flags); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_set_mode(vmode_g, flags); return stdvga_set_mode(vmode_g, flags); }
void vgahw_list_modes(u16 seg, u16 *dest, u16 *last) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) clext_list_modes(seg, dest, last); - else if (CONFIG_VGA_BOCHS) + else if (HAVE_VGA_BOCHS) bochsvga_list_modes(seg, dest, last); else stdvga_list_modes(seg, dest, last); @@ -30,66 +74,87 @@ void vgahw_list_modes(u16 seg, u16 *dest, u16 *last)
int vgahw_init(void) { - if (CONFIG_VGA_CIRRUS) + if (CONFIG_VGA_PCI) { + u16 bdf = GET_GLOBAL(VgaBDF); + u16 vid = pci_config_readw(bdf, PCI_VENDOR_ID); + u16 did = pci_config_readw(bdf, PCI_DEVICE_ID); + int i; + + for (i = 0; i < ARRAY_SIZE(hwtab); i++) { + if (GET_GLOBAL(hwtab[i].vid) == vid && + GET_GLOBAL(hwtab[i].did) == did) { + dprintf(1, "vgahw: detected %s [pci %04x:%04x]\n", + GET_GLOBAL(hwtab[i].name), vid, did); + if (GET_GLOBAL(hwtab[i].supported)) { + SET_VGA(vga_type, GET_GLOBAL(hwtab[i].type)); + } else { + SET_VGA(vga_type, VGA_TYPE_STDVGA); + dprintf(1, "vgahw: support not compiled, using stdvga\n"); + } + break; + } + } + } + + if (HAVE_VGA_CIRRUS) return clext_init(); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_init(); - if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX) + if (HAVE_VGA_GEODEGX2 || HAVE_VGA_GEODELX) return geodevga_init(); return stdvga_init(); }
int vgahw_get_window(struct vgamode_s *vmode_g, int window) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_get_window(vmode_g, window); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_get_window(vmode_g, window); return stdvga_get_window(vmode_g, window); }
int vgahw_set_window(struct vgamode_s *vmode_g, int window, int val) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_set_window(vmode_g, window, val); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_set_window(vmode_g, window, val); return stdvga_set_window(vmode_g, window, val); }
int vgahw_get_linelength(struct vgamode_s *vmode_g) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_get_linelength(vmode_g); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_get_linelength(vmode_g); return stdvga_get_linelength(vmode_g); }
int vgahw_set_linelength(struct vgamode_s *vmode_g, int val) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_set_linelength(vmode_g, val); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_set_linelength(vmode_g, val); return stdvga_set_linelength(vmode_g, val); }
int vgahw_get_displaystart(struct vgamode_s *vmode_g) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_get_displaystart(vmode_g); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_get_displaystart(vmode_g); return stdvga_get_displaystart(vmode_g); }
int vgahw_set_displaystart(struct vgamode_s *vmode_g, int val) { - if (CONFIG_VGA_CIRRUS) + if (HAVE_VGA_CIRRUS) return clext_set_displaystart(vmode_g, val); - if (CONFIG_VGA_BOCHS) + if (HAVE_VGA_BOCHS) return bochsvga_set_displaystart(vmode_g, val); return stdvga_set_displaystart(vmode_g, val); } - diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h index 751d4fd..2f51ee8 100644 --- a/vgasrc/vgahw.h +++ b/vgasrc/vgahw.h @@ -9,6 +9,26 @@ #include "stdvga.h" // stdvga_set_mode #include "geodevga.h" // geodevga_init
+enum vga_type { + VGA_TYPE_UNDEFINED = 0, + VGA_TYPE_STDVGA, + VGA_TYPE_CIRRUS, + VGA_TYPE_BOCHS, + VGA_TYPE_GEODEGX2, + VGA_TYPE_GEODELX, +}; + +extern enum vga_type vga_type; + +#define HAVE_VGA_CIRRUS (CONFIG_VGA_CIRRUS && \ + (GET_GLOBAL(vga_type) == VGA_TYPE_CIRRUS)) +#define HAVE_VGA_BOCHS (CONFIG_VGA_BOCHS && \ + (GET_GLOBAL(vga_type) == VGA_TYPE_BOCHS)) +#define HAVE_VGA_GEODEGX2 (CONFIG_VGA_GEODEGX2 && \ + (GET_GLOBAL(vga_type) == VGA_TYPE_GEODEGX2)) +#define HAVE_VGA_GEODELX (CONFIG_VGA_GEODELX && \ + (GET_GLOBAL(vga_type) == VGA_TYPE_GEODELX)) + struct vgamode_s *vgahw_find_mode(int mode); int vgahw_set_mode(struct vgamode_s *vmode_g, int flags); void vgahw_list_modes(u16 seg, u16 *dest, u16 *last);
Try to find isa vga cards in case pci probe found nothing.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- vgasrc/bochsvga.c | 8 ++++++++ vgasrc/bochsvga.h | 1 + vgasrc/clext.c | 6 ++++++ vgasrc/clext.h | 1 + vgasrc/vgahw.c | 19 +++++++++++++++++++ 5 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index e6ab794..e92186a 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -302,3 +302,11 @@ bochsvga_init(void)
return 0; } + +int +bochsvga_isa_probe(void) +{ + dispi_write(VBE_DISPI_INDEX_ID, VBE_DISPI_ID0); + return dispi_read(VBE_DISPI_INDEX_ID) == VBE_DISPI_ID0; +} + diff --git a/vgasrc/bochsvga.h b/vgasrc/bochsvga.h index 57b2b69..3f72bf0 100644 --- a/vgasrc/bochsvga.h +++ b/vgasrc/bochsvga.h @@ -62,5 +62,6 @@ int bochsvga_get_displaystart(struct vgamode_s *vmode_g); int bochsvga_set_displaystart(struct vgamode_s *vmode_g, int val); int bochsvga_set_mode(struct vgamode_s *vmode_g, int flags); int bochsvga_init(void); +int bochsvga_isa_probe(void);
#endif // bochsvga.h diff --git a/vgasrc/clext.c b/vgasrc/clext.c index 26b34e0..2e32e61 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -610,3 +610,9 @@ clext_init(void)
return 0; } + +int +clext_isa_probe(void) +{ + return cirrus_check(); +} diff --git a/vgasrc/clext.h b/vgasrc/clext.h index 3d83507..e6aa3f9 100644 --- a/vgasrc/clext.h +++ b/vgasrc/clext.h @@ -15,5 +15,6 @@ int clext_set_mode(struct vgamode_s *vmode_g, int flags); struct bregs; void clext_1012(struct bregs *regs); int clext_init(void); +int clext_isa_probe(void);
#endif // clext.h diff --git a/vgasrc/vgahw.c b/vgasrc/vgahw.c index 77b8e77..1401fba 100644 --- a/vgasrc/vgahw.c +++ b/vgasrc/vgahw.c @@ -96,6 +96,25 @@ int vgahw_init(void) } }
+ if (GET_GLOBAL(vga_type) == VGA_TYPE_UNDEFINED) { + if (CONFIG_VGA_CIRRUS) { + if (clext_isa_probe()) { + SET_VGA(vga_type, VGA_TYPE_CIRRUS); + dprintf(1, "vgahw: detected Cirrus VGA [isa]\n"); + } + } else if (CONFIG_VGA_BOCHS) { + if (bochsvga_isa_probe()) { + SET_VGA(vga_type, VGA_TYPE_BOCHS); + dprintf(1, "vgahw: detected bochs svga [isa]\n"); + } + } + } + + if (GET_GLOBAL(vga_type) == VGA_TYPE_UNDEFINED) { + SET_VGA(vga_type, VGA_TYPE_STDVGA); + dprintf(1, "vgahw: no hw found, using stdvga\n"); + } + if (HAVE_VGA_CIRRUS) return clext_init(); if (HAVE_VGA_BOCHS)
With support for multiple vga hardware types being selectable it isn't a choice any more.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- vgasrc/Kconfig | 61 ++++++++++++++++++++++++------------------------------- 1 files changed, 27 insertions(+), 34 deletions(-)
diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig index 881e9ec..fc7fec4 100644 --- a/vgasrc/Kconfig +++ b/vgasrc/Kconfig @@ -1,44 +1,37 @@ # Kconfig SeaBIOS VGA BIOS configuration
menu "VGA ROM" - choice - prompt "VGA Hardware Type" - default NO_VGABIOS - - config NO_VGABIOS - bool "None" - help - Do not build a VGA BIOS. - - config VGA_STANDARD_VGA - bool "Standard VGA" - help - Build basic VGA BIOS support. - - config VGA_CIRRUS - bool "QEMU Cirrus CLGD 54xx VGA BIOS" - help - Build support for Cirrus VGA emulation. + config BUILD_VGABIOS + bool "Build vgabios" + default !COREBOOT
- config VGA_BOCHS - bool "Bochs DISPI interface VGA BIOS" - help - Build support for Bochs DISPI interface. + config VGA_CIRRUS + bool "QEMU Cirrus CLGD 54xx support" + depends on BUILD_VGABIOS + default !COREBOOT + help + Build support for Cirrus VGA emulation.
- config VGA_GEODEGX2 - bool "GeodeGX2 interface VGA BIOS" - help - Build support for Geode GX2 vga. + config VGA_BOCHS + bool "Bochs DISPI interface support" + depends on BUILD_VGABIOS + default !COREBOOT + help + Build support for Bochs DISPI interface.
- config VGA_GEODELX - bool "GeodeLX interface VGA BIOS" - help - Build support for Geode LX vga. - endchoice + config VGA_GEODEGX2 + bool "GeodeGX2 interface support" + depends on BUILD_VGABIOS + default n + help + Build support for Geode GX2 vga.
- config BUILD_VGABIOS - bool - default !NO_VGABIOS + config VGA_GEODELX + bool "GeodeLX interface support" + depends on BUILD_VGABIOS + default n + help + Build support for Geode LX vga.
config VGA_VBE depends on BUILD_VGABIOS
Add vmware vga to the device list.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- vgasrc/vgahw.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/vgasrc/vgahw.c b/vgasrc/vgahw.c index 1401fba..48fb070 100644 --- a/vgasrc/vgahw.c +++ b/vgasrc/vgahw.c @@ -28,6 +28,12 @@ static struct vga_pci_table hwtab[] VAR16 = { .type = VGA_TYPE_BOCHS, .supported = CONFIG_VGA_BOCHS, },{ + .vid = 0x15ad, + .did = 0x0405, + .name = "QEMU VMware SVGA", + .type = VGA_TYPE_BOCHS, + .supported = CONFIG_VGA_BOCHS, + },{ .vid = 0x100b, .did = 0x0030, .name = "Geode GX2",
Add QXL vga to the device list.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- vgasrc/vgahw.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/vgasrc/vgahw.c b/vgasrc/vgahw.c index 48fb070..92c2472 100644 --- a/vgasrc/vgahw.c +++ b/vgasrc/vgahw.c @@ -34,6 +34,12 @@ static struct vga_pci_table hwtab[] VAR16 = { .type = VGA_TYPE_BOCHS, .supported = CONFIG_VGA_BOCHS, },{ + .vid = 0x1b36, + .did = 0x0100, + .name = "QXL paravirtual VGA", + .type = VGA_TYPE_BOCHS, + .supported = CONFIG_VGA_BOCHS, + },{ .vid = 0x100b, .did = 0x0030, .name = "Geode GX2",
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- vgasrc/bochsvga.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index e92186a..71f9b9f 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -278,7 +278,7 @@ bochsvga_init(void) SET_VGA(VBE_capabilities, VBE_CAPABILITY_8BIT_DAC);
dprintf(1, "VBE DISPI: lfb_addr=%x, size %d MB\n", - lfb_addr, totalmem / 16); + lfb_addr, totalmem >> 20);
// Validate modes u16 en = dispi_read(VBE_DISPI_INDEX_ENABLE);
On Mon, Feb 06, 2012 at 03:51:43PM +0100, Gerd Hoffmann wrote:
Signed-off-by: Gerd Hoffmann kraxel@redhat.com
vgasrc/bochsvga.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks. I've applied this patch.
-Kevin
On Mon, Feb 06, 2012 at 03:51:36PM +0100, Gerd Hoffmann wrote:
Hi,
Here is the runtime vga hardware detection patch series, rebased and adapted to latest master.
Thinking about this further, if multiple drivers are compiled in, I'm not sure what we'd set the vendorid/deviceid in the PCI header to. This isn't an issue for qemu as it modifies the rom to match the ids when deploying it. However, on coreboot, seabios wont run the rom unless the ids match. So, should a geode user select both geode types, it wont actually work. I'm not sure how to fix that.
-Kevin
On 02/07/12 01:38, Kevin O'Connor wrote:
On Mon, Feb 06, 2012 at 03:51:36PM +0100, Gerd Hoffmann wrote:
Hi,
Here is the runtime vga hardware detection patch series, rebased and adapted to latest master.
Thinking about this further, if multiple drivers are compiled in, I'm not sure what we'd set the vendorid/deviceid in the PCI header to. This isn't an issue for qemu as it modifies the rom to match the ids when deploying it. However, on coreboot, seabios wont run the rom unless the ids match. So, should a geode user select both geode types, it wont actually work. I'm not sure how to fix that.
We could keep the kconfig select, so only one item is selectable, and introduce a CONFIG_VGA_QEMU as option which builds a vgabios with cirrus+bochs support & runtime hardware detection.
One wouldn't be able to build a pure cirrus / bochs bios then. I don't think this is an issue as I don't think they are used outside qemu. bochs is sort-of paravirtual anyway, and I doubt anyone runs a cirrus bios on non-virtual hardware ...
cheers, Gerd
Gerd Hoffmann wrote:
and I doubt anyone runs a cirrus bios on non-virtual hardware ...
If the Cirrus support is exclusively for virtual machines then at the very least please make that abundantly clear in the menuconfig oneline description.
//Peter
On Tue, Feb 07, 2012 at 03:41:05PM +0100, Peter Stuge wrote:
Gerd Hoffmann wrote:
and I doubt anyone runs a cirrus bios on non-virtual hardware ...
If the Cirrus support is exclusively for virtual machines then at the very least please make that abundantly clear in the menuconfig oneline description.
Agreed. The description does say "QEMU", but I think we can expand on that in Kconfig. See the patch below.
-Kevin
From 197ea6c9b6cfff73e8613f32c2d86ea7b0a138cb Mon Sep 17 00:00:00 2001
From: Kevin O'Connor kevin@koconnor.net Date: Tue, 7 Feb 2012 21:03:23 -0500 Subject: [PATCH] vgabios: Don't allow building of emulator vgaroms on coreboot.
If coreboot building is selected, don't allow the emulator based vga roms to be selected. Also, clarify the help text to make this clear.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- vgasrc/Kconfig | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig index 881e9ec..c436aeb 100644 --- a/vgasrc/Kconfig +++ b/vgasrc/Kconfig @@ -11,19 +11,25 @@ menu "VGA ROM" Do not build a VGA BIOS.
config VGA_STANDARD_VGA + depends on !COREBOOT bool "Standard VGA" help - Build basic VGA BIOS support. + Build basic VGA BIOS support for use on emulators.
config VGA_CIRRUS + depends on !COREBOOT bool "QEMU Cirrus CLGD 54xx VGA BIOS" help - Build support for Cirrus VGA emulation. + Build support for Cirrus VGA emulation found on QEMU + and Bochs emulators. This is for emulators; it is not + intended for use on real Cirrus hardware.
config VGA_BOCHS + depends on !COREBOOT bool "Bochs DISPI interface VGA BIOS" help - Build support for Bochs DISPI interface. + Build support for Bochs DISPI interface found on QEMU + and Bochs emulators.
config VGA_GEODEGX2 bool "GeodeGX2 interface VGA BIOS"
On Tue, Feb 07, 2012 at 11:20:27AM +0100, Gerd Hoffmann wrote:
On 02/07/12 01:38, Kevin O'Connor wrote:
Thinking about this further, if multiple drivers are compiled in, I'm not sure what we'd set the vendorid/deviceid in the PCI header to. This isn't an issue for qemu as it modifies the rom to match the ids when deploying it. However, on coreboot, seabios wont run the rom unless the ids match. So, should a geode user select both geode types, it wont actually work. I'm not sure how to fix that.
We could keep the kconfig select, so only one item is selectable, and introduce a CONFIG_VGA_QEMU as option which builds a vgabios with cirrus+bochs support & runtime hardware detection.
I was thinking about that as well. It's possible to build a new "virtual" qemu vga device type that just calls the bochs/cirrus functions as needed. However, I do wonder if just a little build magic is what's called for here - see the patch below for an example.
One wouldn't be able to build a pure cirrus / bochs bios then. I don't think this is an issue as I don't think they are used outside qemu. bochs is sort-of paravirtual anyway, and I doubt anyone runs a cirrus bios on non-virtual hardware ...
The bochsvga/cirrus code is purely for bochs/qemu/kvm/xen. Running on real hardware could cause bad things to happen. Kconfig should probably reflect this.
-Kevin
--- /dev/null 2011-10-15 16:04:45.388999735 -0400 +++ tools/build-qemu-vgaroms.sh 2012-02-07 20:46:13.000000000 -0500 @@ -0,0 +1,25 @@ +#!/bin/sh +# Script to build the vgaroms that qemu uses + +mkdir -p out/ +cp .config out/config-BACKUP + +cat > .config <<EOF +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_CIRRUS=y +EOF +make oldnoconfig +make out/vgabios.bin +cp out/vgabios.bin out/vgabios-cirrus.bin + +cat > .config <<EOF +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +EOF +make oldnoconfig +make out/vgabios.bin +cp out/vgabios.bin out/vgabios-stdvga.bin +cp out/vgabios.bin out/vgabios-vmware.bin +cp out/vgabios.bin out/vgabios-qxl.bin + +cp out/config-BACKUP .config