summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHans De Goede <hdegoede@redhat.com>2016-12-12 17:03:15 +0100
committerTimo Aaltonen <tjaalton@debian.org>2018-02-13 10:32:35 +0200
commit0fdfba747463726e8a728a4259289809f7cb9a6f (patch)
tree29bbd332f00b7b426a8af2d0938324cf1eecdbff /hw
parent3126b279f3b6c22efd29d4a35ec0085686e0c2a1 (diff)
xfree86: xf86platformProbe: split finding pci-info and setting primary GPU
This is a preparation patch for allowing an OutputClass section to override the default primary GPU device selection. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit ab1a65b7755d081b41188104b21f4d21eaa3187b)
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86platformBus.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index a698c6cb5..39b32484e 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -145,16 +145,9 @@ platform_find_pci_info(struct xf86_platform_device *pd, char *busid)
iter = pci_slot_match_iterator_create(&devmatch);
info = pci_device_next(iter);
- if (info) {
+ if (info)
pd->pdev = info;
- pci_device_probe(info);
- if (pci_device_is_boot_vga(info)) {
- primaryBus.type = BUS_PLATFORM;
- primaryBus.id.plat = pd;
- }
- }
pci_iterator_destroy(iter);
-
}
static Bool
@@ -307,6 +300,20 @@ xf86platformProbe(void)
platform_find_pci_info(&xf86_platform_devices[i], busid);
}
}
+
+ for (i = 0; i < xf86_num_platform_devices; i++) {
+ struct xf86_platform_device *dev = &xf86_platform_devices[i];
+
+ if (!dev->pdev)
+ continue;
+
+ pci_device_probe(dev->pdev);
+ if (pci_device_is_boot_vga(dev->pdev)) {
+ primaryBus.type = BUS_PLATFORM;
+ primaryBus.id.plat = dev;
+ }
+ }
+
return 0;
}