diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 39b32484e..fc17d1504 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -286,6 +286,7 @@ xf86platformProbe(void) { int i; Bool pci = TRUE; + XF86ConfOutputClassPtr cl; config_odev_probe(xf86PlatformDeviceProbe); @@ -301,6 +302,24 @@ xf86platformProbe(void) } } + /* First see if there is an OutputClass match marking a device as primary */ + for (i = 0; i < xf86_num_platform_devices; i++) { + struct xf86_platform_device *dev = &xf86_platform_devices[i]; + for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { + if (!OutputClassMatches(cl, dev)) + continue; + + if (xf86CheckBoolOption(cl->option_lst, "PrimaryGPU", FALSE)) { + xf86Msg(X_CONFIG, "OutputClass \"%s\" setting %s as PrimaryGPU\n", + cl->identifier, dev->attribs->path); + primaryBus.type = BUS_PLATFORM; + primaryBus.id.plat = dev; + return 0; + } + } + } + + /* Then check for pci_device_is_boot_vga() */ for (i = 0; i < xf86_num_platform_devices; i++) { struct xf86_platform_device *dev = &xf86_platform_devices[i]; diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man index 8928a53b9..79b71a84b 100644 --- a/hw/xfree86/man/xorg.conf.man +++ b/hw/xfree86/man/xorg.conf.man @@ -1285,11 +1285,21 @@ When an output device has been matched to the .B OutputClass section, any .B Option -entries are applied to the device. See the +entries are applied to the device. One +.B OutputClass +specific +.B Option +is recognized. See the .B Device section below for a description of the remaining .B Option entries. +.TP 7 +.BI "Option \*qPrimaryGPU\*q \*q" boolean \*q +This option specifies that the matched device should be treated as the +primary GPU, replacing the selection of the GPU used as output by the +firmware. If multiple output devices match an OutputClass section with +the PrimaryGPU option set, the first one enumerated becomes the primary GPU. .SH "DEVICE SECTION" The config file may have multiple .B Device