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@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Aaron Plattner 2014-12-30 09:13:16 -08:00
parent 4ecda36259
commit e36236eade
1 changed files with 11 additions and 3 deletions

View File

@ -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;
}
}