diff options
Diffstat (limited to 'arch/ia64/pci')
| -rw-r--r-- | arch/ia64/pci/fixup.c | 29 | ||||
| -rw-r--r-- | arch/ia64/pci/pci.c | 14 | 
2 files changed, 19 insertions, 24 deletions
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index 5dc969dd4ac..1fe9aa5068e 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c @@ -5,6 +5,7 @@  #include <linux/pci.h>  #include <linux/init.h> +#include <linux/vgaarb.h>  #include <asm/machvec.h> @@ -19,9 +20,10 @@   * IORESOURCE_ROM_SHADOW is used to associate the boot video   * card with this copy. On laptops this copy has to be used since   * the main ROM may be compressed or combined with another image. - * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW - * is marked here since the boot video device will be the only enabled - * video device at this point. + * See pci_map_rom() for use of this flag. Before marking the device + * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set + * by either arch cde or vga-arbitration, if so only apply the fixup to this + * already determined primary video card.   */  static void pci_fixup_video(struct pci_dev *pdev) @@ -35,9 +37,6 @@ static void pci_fixup_video(struct pci_dev *pdev)  		return;  	/* Maybe, this machine supports legacy memory map. */ -	if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) -		return; -  	/* Is VGA routed to us? */  	bus = pdev->bus;  	while (bus) { @@ -50,9 +49,7 @@ static void pci_fixup_video(struct pci_dev *pdev)  		 * type BRIDGE, or CARDBUS. Host to PCI controllers use  		 * PCI header type NORMAL.  		 */ -		if (bridge -		    &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE) -		       ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) { +		if (bridge && (pci_is_bridge(bridge))) {  			pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,  						&config);  			if (!(config & PCI_BRIDGE_CTL_VGA)) @@ -60,10 +57,14 @@ static void pci_fixup_video(struct pci_dev *pdev)  		}  		bus = bus->parent;  	} -	pci_read_config_word(pdev, PCI_COMMAND, &config); -	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() || pdev == vga_default_device()) { +		pci_read_config_word(pdev, PCI_COMMAND, &config); +		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"); +			vga_set_default_device(pdev); +		}  	}  } -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, +				PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video); diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 2326790b7d8..291a582777c 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg)  		return NULL;  	controller->segment = seg; -	controller->node = -1;  	return controller;  } @@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)  	struct pci_root_info *info = NULL;  	int busnum = root->secondary.start;  	struct pci_bus *pbus; -	int pxm, ret; +	int ret;  	controller = alloc_pci_controller(domain);  	if (!controller)  		return NULL; -	controller->acpi_handle = device->handle; - -	pxm = acpi_get_pxm(controller->acpi_handle); -#ifdef CONFIG_NUMA -	if (pxm >= 0) -		controller->node = pxm_to_node(pxm); -#endif +	controller->companion = device; +	controller->node = acpi_get_node(device->handle);  	info = kzalloc(sizeof(*info), GFP_KERNEL);  	if (!info) { @@ -489,7 +483,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)  {  	struct pci_controller *controller = bridge->bus->sysdata; -	ACPI_HANDLE_SET(&bridge->dev, controller->acpi_handle); +	ACPI_COMPANION_SET(&bridge->dev, controller->companion);  	return 0;  }  | 
