xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Mar 31 16:45:07 PDT 2015


 hw/xfree86/common/xf86platformBus.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit e36236eade412dd3894f75f78a7b3d7c1037e6c3
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Tue Dec 30 09:13:16 2014 -0800

    xfree86: Add GPU screens even if there are no active GDevs
    
    xf86platformProbeDev creates GPU screens for any platform devices that were not
    matched by a GDev in the loop above, but only if there was at least one device.
    This means that it's impossible to configure a device as a GPU screen if there
    is only one platform device that matches that driver.
    
    Instead, create a GPU screen (if possible) for any platform device that was not
    claimed by the GDev loop.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>
    Acked-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 387b5f1..c1aaba4 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -428,6 +428,10 @@ xf86platformProbeDev(DriverPtr drvp)
 
     /* find the main device or any device specificed in xorg.conf */
     for (i = 0; i < numDevs; i++) {
+        /* skip inactive devices */
+        if (!devList[i]->active)
+            continue;
+
         for (j = 0; j < xf86_num_platform_devices; j++) {
             if (devList[i]->busID && *devList[i]->busID) {
                 if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID))
@@ -451,10 +455,14 @@ xf86platformProbeDev(DriverPtr drvp)
             continue;
     }
 
-    /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */
-    if (xf86Info.autoAddGPU && numDevs) {
+    /* if autoaddgpu devices is enabled then go find any unclaimed platform
+     * devices and add them as GPU screens */
+    if (xf86Info.autoAddGPU) {
         for (j = 0; j < xf86_num_platform_devices; j++) {
-            probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN);
+            if (probeSingleDevice(&xf86_platform_devices[j], drvp,
+                                  devList ?  devList[0] : NULL,
+                                  PLATFORM_PROBE_GPU_SCREEN))
+                foundScreen = TRUE;
         }
     }
 
commit 4ecda362594d771f401de467c2d58c0f552227a8
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Tue Dec 30 09:13:15 2014 -0800

    xfree86: Fix xf86_check_platform_slot's handling of PCI
    
    If a PCI entity is found, xf86_check_platform_slot performs a device ID check
    against the xf86_platform_device passed in.  However, it just returns
    immediately without checking the rest of the entities first.  This leads to this
    situation happening:
    
    1. The nvidia driver creates an entity 0 with bus.type == BUS_PCI
    2. The intel driver creates entity 1 for its platform device, opening
       /dev/dri/card0
    3. xf86platformProbeDev calls probeSingleDevice on the Intel platform device,
       which calls doPlatformProbe, which calls xf86_check_platform_slot.
    4. xf86_check_platform_slot compares the Intel platform device against the
       NVIDIA PCI entity.  Since they don't have the same device ID, it returns
       TRUE.
    5. doPlatformProbe calls xf86ClaimPlatformSlot, which creates a duplicate entity
       for the Intel one.
    
    Fix this by only returning FALSE if the PCI ID matches, and continuing the loop
    otherwise.  In the scenario above, this allows it to continue on to find the
    Intel platform device that matches the second entity.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>
    Acked-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 15988b8..387b5f1 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -153,8 +153,10 @@ xf86_check_platform_slot(const struct xf86_platform_device *pd)
     for (i = 0; i < xf86NumEntities; i++) {
         const EntityPtr u = xf86Entities[i];
 
-        if (pd->pdev && u->bus.type == BUS_PCI)
-            return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci);
+        if (pd->pdev && u->bus.type == BUS_PCI &&
+            MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci)) {
+            return FALSE;
+        }
         if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) {
             return FALSE;
         }


More information about the xorg-commit mailing list