xorg-x11-server/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch

62 lines
1.8 KiB
Diff
Raw Normal View History

From ab1a65b7755d081b41188104b21f4d21eaa3187b Mon Sep 17 00:00:00 2001
From: Hans De Goede <hdegoede@redhat.com>
Date: Mon, 12 Dec 2016 17:03:15 +0100
Subject: [PATCH xserver 4/6] 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>
---
hw/xfree86/common/xf86platformBus.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index a698c6c..39b3248 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;
}
--
2.9.3