summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans De Goede <hdegoede@redhat.com>2016-12-12 17:03:16 +0100
committerTimo Aaltonen <tjaalton@debian.org>2018-02-13 10:32:40 +0200
commit58462152ac7e64641ca2ea6480bbb7a08e9022c7 (patch)
tree3419a769a09d460751c3a9f43906ee2df147f095
parent0fdfba747463726e8a728a4259289809f7cb9a6f (diff)
xfree86: Allow overriding primary GPU detection from an OutputClass section
Allow using: Option "PrimaryGPU" "yes" In an OutputClass section to override the default primary GPU device selection which selects 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. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit d75ffcdbf8c1e3c8e0d46debcd533a9f2560f0a8)
-rw-r--r--hw/xfree86/common/xf86platformBus.c19
-rw-r--r--hw/xfree86/man/xorg.conf.man12
2 files changed, 30 insertions, 1 deletions
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