Skip to contentSkip to conversation

x86/vga: set the default device from the fixup.

PATCH In review Dave Airlie 2 participants 2 messages May 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/vga: set the default device from the fixup.

From: Dave Airlie <[email protected]>

Since Matthew's efi/vga changes on non-EFI machines we were failing to tell the vgaarb/switcheroo what the default device was, this sets the default device in the quirk if none has been set before.

This fixes the switcheroo on my T410s.

[hpa: please ack to put this on top of the other patches in my -next tree].

Cc Matthew Garrett <[email protected]>
Cc H. Peter Anvin <[email protected]>
---
 arch/x86/pci/fixup.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/x86/pci/fixup.c +3 -0
index d0e6e40..cf81c02 100644
@@ -7,6 +7,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <asm/pci_x86.h>
+#include <asm/vga.h>
 
 static void __devinit pci_fixup_i450nx(struct pci_dev *d)
 {
@@ -348,6 +349,8 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
 	if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
 		pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
 		dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
+		if (vga_default_device() == NULL)
+			vga_set_default_device(pdev);
 	}
 }
 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
Signature · 1 line
1.7.6
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dave Airlie

From: Dave Airlie <[email protected]>

Since Matthew's efi/vga changes on non-EFI machines we were failing to tell the vgaarb/switcheroo what the default device was, this sets the default device in the quirk if none has been set before.

Quoted 7 lines

This fixes the switcheroo on my T410s.

[hpa: please ack to put this on top of the other patches in my -next tree].

Cc Matthew Garrett <[email protected]>
Cc H. Peter Anvin <[email protected]>

... although I would prefer the

	if (!vga_default_device())

syntax as a matter of style.

-hpa