From e36236eade412dd3894f75f78a7b3d7c1037e6c3 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Tue, 30 Dec 2014 09:13:16 -0800 Subject: [PATCH] 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 Reviewed-by: Maarten Lankhorst Acked-by: Alex Deucher --- hw/xfree86/common/xf86platformBus.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 387b5f1ad..c1aaba41a 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; } }