xserver-multidpi/randr
Dave Airlie 078277e4d9 xf86: autobind GPUs to the screen
This is a modified version of a patch we've been carry-ing in Fedora and
RHEL for years now. This patch automatically adds secondary GPUs to the
master as output sink / offload source making e.g. the use of
slave-outputs just work, with requiring the user to manually run
"xrandr --setprovideroutputsource" before he can hookup an external
monitor to his hybrid graphics laptop.

There is one problem with this patch, which is why it was not upstreamed
before. What to do when a secondary GPU gets detected really is a policy
decission (e.g. one may want to autobind PCI GPUs but not USB ones) and
as such should be under control of the Desktop Environment.

Unconditionally adding autobinding support to the xserver will result
in races between the DE dealing with the hotplug of a secondary GPU
and the server itself dealing with it.

However we've waited for years for any Desktop Environments to actually
start doing some sort of autoconfiguration of secondary GPUs and there
is still not a single DE dealing with this, so I believe that it is
time to upstream this now.

To avoid potential future problems if any DEs get support for doing
secondary GPU configuration themselves, the new autobind functionality
is made optional. Since no DEs currently support doing this themselves it
is enabled by default. When DEs grow support for doing this themselves
they can disable the servers autobinding through the servers cmdline or a
xorg.conf snippet.

Signed-off-by: Dave Airlie <airlied@gmail.com>
[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
---
Changes in v2:
-Make the default enabled instead of installing a xorg.conf
 snippet which enables it unconditionally

Changes in v3:
-Handle GPUScreen autoconfig in randr/rrprovider.c, looking at
 rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c
 looking at xf86CrtcConfig->provider. This fixes the autoconfig not
 working with the nvidia binary driver
2019-08-07 12:26:59 +02:00
..
Makefile.am Add RandR leases with modesetting driver support [v6] 2018-02-27 12:39:50 -05:00
meson.build meson: Distribute more SDK headers 2018-04-02 13:42:08 -04:00
randr.c During reset/shutdown, clean up leases in DIX instead of each driver 2018-08-02 10:15:26 -04:00
randrstr.h xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
rrcrtc.c randr: rrCheckPixmapBounding should only increase screen size 2018-08-24 09:55:48 +02:00
rrdispatch.c Add RandR leases with modesetting driver support [v6] 2018-02-27 12:39:50 -05:00
rrinfo.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
rrlease.c During reset/shutdown, clean up leases in DIX instead of each driver 2018-08-02 10:15:26 -04:00
rrmode.c Add RandR leases with modesetting driver support [v6] 2018-02-27 12:39:50 -05:00
rrmonitor.c rrmonitor: allocate using the correct type 2018-01-31 14:43:56 -05:00
rroutput.c During reset/shutdown, clean up leases in DIX instead of each driver 2018-08-02 10:15:26 -04:00
rrpointer.c randr: Fix logic in RRPointerToNearestCrtc 2014-07-30 14:40:17 -07:00
rrproperty.c Add RandR leases with modesetting driver support [v6] 2018-02-27 12:39:50 -05:00
rrprovider.c xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
rrproviderproperty.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
rrscreen.c Add RandR leases with modesetting driver support [v6] 2018-02-27 12:39:50 -05:00
rrsdispatch.c Add RandR leases with modesetting driver support [v6] 2018-02-27 12:39:50 -05:00
rrtransform.c randr: Silence -Wshift-negative-value warnings 2015-10-19 11:51:52 -04:00
rrtransform.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
rrxinerama.c dispatch: Mark swapped dispatch as _X_COLD 2017-03-01 10:16:20 -05:00