[SeaBIOS] [PATCH 1/3] vgahooks: Allow usage of VGA hooks in the Xen case

julian.pidancet at gmail.com julian.pidancet at gmail.com
Mon Jan 30 14:55:54 CET 2012


From: Julian Pidancet <julian.pidancet at citrix.com>

This patch enables the VGAHOOKS config option if the BIOS is configured
for Xen.
In the Xen VGA passthrough case, the option ROM can be extracted from
the physical device by hvmloader and pre-deployed for seabios. This
patch also allows setting up VGA hooks in case the VGA option ROM is
already deployed by hvmloader.

Signed-off-by: Julian Pidancet <julian.pidancet at citrix.com>
---
 src/Kconfig      |    2 +-
 src/optionroms.c |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index 4270014..9ea48bb 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -283,7 +283,7 @@ menu "BIOS interfaces"
             Support S3 resume handler.
 
     config VGAHOOKS
-        depends on COREBOOT
+        depends on COREBOOT || XEN
         bool "Hardware specific VGA helpers"
         default y
         help
diff --git a/src/optionroms.c b/src/optionroms.c
index 27cfffd..62de40e 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -427,6 +427,15 @@ vga_setup(void)
     ScreenAndDebug = romfile_loadint("etc/screen-and-debug", 1);
 
     if (CONFIG_OPTIONROMS_DEPLOYED) {
+        /* Setup VGA hooks */
+        struct pci_device *pci;
+        foreachpci(pci) {
+            if (!is_pci_vga(pci))
+                continue;
+            vgahook_setup(pci);
+            break;
+        }
+
         // Option roms are already deployed on the system.
         init_optionrom((void*)BUILD_ROM_START, 0, 1);
     } else {
-- 
Julian Pidancet




More information about the SeaBIOS mailing list