From: Julian Pidancet Date: Sun, 5 Feb 2012 04:51:06 +0000 (+0000) Subject: Xen: Use VGA Hooks to make VGA passthrough work on certain devices X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=seabios.git;a=commitdiff_plain;h=02145150f64d4fcb9e122bc7fcc11c23fbbe9fbc Xen: Use VGA Hooks to make VGA passthrough work on certain devices The Intel gfx VGA option ROM on certain platforms requires the 155f50 BIOS function to be implemented (even if it does nothing), to work properly. v2: Ignore the case where Option ROMs are pre-deployed. Make vgahook_setup independent of wether the CB* variables are set. VGA hooks can be enabled on non-coreboot and non-Xen configurations. Signed-off-by: Julian Pidancet --- diff --git a/src/Kconfig b/src/Kconfig index cf0bff0..250663a 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -283,7 +283,6 @@ menu "BIOS interfaces" Support S3 resume handler. config VGAHOOKS - depends on COREBOOT bool "Hardware specific VGA helpers" default y help diff --git a/src/coreboot.c b/src/coreboot.c index ee9dd8b..e328c15 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -117,7 +117,7 @@ find_cb_subtable(struct cb_header *cbh, u32 tag) } static struct cb_memory *CBMemTable; -const char *CBvendor, *CBpart; +const char *CBvendor = "", *CBpart = ""; // Populate max ram and e820 map info by scanning for a coreboot table. static void diff --git a/src/vgahooks.c b/src/vgahooks.c index a8f667c..20a2e2e 100644 --- a/src/vgahooks.c +++ b/src/vgahooks.c @@ -185,12 +185,21 @@ intel_155f40(struct bregs *regs) set_success(regs); } +static void +intel_155f50(struct bregs *regs) +{ + /* Mandatory hook on some Dell laptops */ + regs->ax = 0x005f; + set_success(regs); +} + static void intel_155f(struct bregs *regs) { switch (regs->al) { case 0x35: intel_155f35(regs); break; case 0x40: intel_155f40(regs); break; + case 0x50: intel_155f50(regs); break; default: handle_155fXX(regs); break; } } @@ -205,6 +214,15 @@ intel_155f(struct bregs *regs) #define BOOT_DISPLAY_EFP2 (1 << 6) #define BOOT_DISPLAY_LCD2 (1 << 7) +static void +intel_setup(struct pci_device *pci) +{ + VGAHookHandlerType = VH_INTEL; + + IntelDisplayType = BOOT_DISPLAY_DEFAULT; + IntelDisplayId = 3; +} + static void roda_setup(struct pci_device *pci) { @@ -254,7 +272,7 @@ handle_155f(struct bregs *regs) void vgahook_setup(struct pci_device *pci) { - if (!CONFIG_VGAHOOKS || !CBvendor || !CBpart) + if (!CONFIG_VGAHOOKS) return; if (strcmp(CBvendor, "KONTRON") == 0 && strcmp(CBpart, "986LCD-M") == 0) @@ -265,4 +283,6 @@ vgahook_setup(struct pci_device *pci) roda_setup(pci); else if (pci->vendor == PCI_VENDOR_ID_VIA) via_setup(pci); + else if (pci->vendor == PCI_VENDOR_ID_INTEL) + intel_setup(pci); }