[PATCH xserver 4/6] xfree86: xf86platformProbe: split finding pci-info and setting primary GPU

Hans de Goede hdegoede at redhat.com
Mon Dec 12 16:03:15 UTC 2016


This is a preparation patch for allowing an OutputClass section to
override the default primary GPU device selection.

Signed-off-by: Hans de Goede <hdegoede at 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 96816c5..fb4b6ea 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -146,16 +146,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
@@ -308,6 +301,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



More information about the xorg-devel mailing list