diff options
author | Tim Biermann <tbier@posteo.de> | 2021-09-19 20:19:30 +0200 |
---|---|---|
committer | Tim Biermann <tbier@posteo.de> | 2021-09-19 20:19:30 +0200 |
commit | 8b5737b6438f5fba4871da649d1988b144ea526d (patch) | |
tree | 2eec7af7c2269f27203ff86d0ffce3f24b181a48 /xorg-server | |
parent | 44b8ca6e518a00c1e794fa1d254f99eaada051f1 (diff) | |
download | xorg-8b5737b6438f5fba4871da649d1988b144ea526d.tar.gz xorg-8b5737b6438f5fba4871da649d1988b144ea526d.tar.xz |
[notify] xorg-server: build system changed to meson/ninja, new depedency nettle, check revdep after update
Diffstat (limited to 'xorg-server')
-rw-r--r-- | xorg-server/.footprint | 24 | ||||
-rw-r--r-- | xorg-server/.signature | 8 | ||||
-rw-r--r-- | xorg-server/0001-v2-FS-58644.patch | 57 | ||||
-rw-r--r-- | xorg-server/Pkgfile | 36 | ||||
-rw-r--r-- | xorg-server/xserver-autobind-hotplug.patch | 293 |
5 files changed, 381 insertions, 37 deletions
diff --git a/xorg-server/.footprint b/xorg-server/.footprint index fffdf7f8..b1c0248c 100644 --- a/xorg-server/.footprint +++ b/xorg-server/.footprint @@ -3,9 +3,8 @@ drwxr-xr-x root/root etc/X11/ drwxr-xr-x root/root etc/X11/xorg.conf.d/ drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -lrwxrwxrwx root/root usr/bin/X -> Xorg -rwxr-xr-x root/root usr/bin/Xnest --rwsr-xr-x root/root usr/bin/Xorg +-rwxr-xr-x root/root usr/bin/Xorg -rwxr-xr-x root/root usr/bin/Xvfb -rwxr-xr-x root/root usr/bin/cvt -rwxr-xr-x root/root usr/bin/gtf @@ -175,33 +174,24 @@ drwxr-xr-x root/root usr/include/xorg/ drwxr-xr-x root/root usr/lib/ drwxr-xr-x root/root usr/lib/pkgconfig/ -rw-r--r-- root/root usr/lib/pkgconfig/xorg-server.pc +drwxr-xr-x root/root usr/lib/xorg-server/ +-rwxr-xr-x root/root usr/lib/xorg-server/Xorg +-rwsr-xr-x root/root usr/lib/xorg-server/Xorg.wrap drwxr-xr-x root/root usr/lib/xorg/ drwxr-xr-x root/root usr/lib/xorg/modules/ drwxr-xr-x root/root usr/lib/xorg/modules/drivers/ --rwxr-xr-x root/root usr/lib/xorg/modules/drivers/modesetting_drv.la -rwxr-xr-x root/root usr/lib/xorg/modules/drivers/modesetting_drv.so drwxr-xr-x root/root usr/lib/xorg/modules/extensions/ --rwxr-xr-x root/root usr/lib/xorg/modules/extensions/libglx.la -rwxr-xr-x root/root usr/lib/xorg/modules/extensions/libglx.so --rwxr-xr-x root/root usr/lib/xorg/modules/libexa.la -rwxr-xr-x root/root usr/lib/xorg/modules/libexa.so --rwxr-xr-x root/root usr/lib/xorg/modules/libfb.la -rwxr-xr-x root/root usr/lib/xorg/modules/libfb.so --rwxr-xr-x root/root usr/lib/xorg/modules/libfbdevhw.la -rwxr-xr-x root/root usr/lib/xorg/modules/libfbdevhw.so --rwxr-xr-x root/root usr/lib/xorg/modules/libglamoregl.la -rwxr-xr-x root/root usr/lib/xorg/modules/libglamoregl.so --rwxr-xr-x root/root usr/lib/xorg/modules/libint10.la -rwxr-xr-x root/root usr/lib/xorg/modules/libint10.so --rwxr-xr-x root/root usr/lib/xorg/modules/libshadow.la -rwxr-xr-x root/root usr/lib/xorg/modules/libshadow.so --rwxr-xr-x root/root usr/lib/xorg/modules/libshadowfb.la -rwxr-xr-x root/root usr/lib/xorg/modules/libshadowfb.so --rwxr-xr-x root/root usr/lib/xorg/modules/libvbe.la -rwxr-xr-x root/root usr/lib/xorg/modules/libvbe.so --rwxr-xr-x root/root usr/lib/xorg/modules/libvgahw.la -rwxr-xr-x root/root usr/lib/xorg/modules/libvgahw.so --rwxr-xr-x root/root usr/lib/xorg/modules/libwfb.la -rwxr-xr-x root/root usr/lib/xorg/modules/libwfb.so -rw-r--r-- root/root usr/lib/xorg/protocol.txt drwxr-xr-x root/root usr/share/ @@ -214,6 +204,7 @@ drwxr-xr-x root/root usr/share/man/ drwxr-xr-x root/root usr/share/man/man1/ -rw-r--r-- root/root usr/share/man/man1/Xnest.1.gz -rw-r--r-- root/root usr/share/man/man1/Xorg.1.gz +-rw-r--r-- root/root usr/share/man/man1/Xorg.wrap.1.gz -rw-r--r-- root/root usr/share/man/man1/Xserver.1.gz -rw-r--r-- root/root usr/share/man/man1/Xvfb.1.gz -rw-r--r-- root/root usr/share/man/man1/cvt.1.gz @@ -223,9 +214,6 @@ drwxr-xr-x root/root usr/share/man/man4/ -rw-r--r-- root/root usr/share/man/man4/fbdevhw.4.gz -rw-r--r-- root/root usr/share/man/man4/modesetting.4.gz drwxr-xr-x root/root usr/share/man/man5/ +-rw-r--r-- root/root usr/share/man/man5/Xwrapper.config.5.gz -rw-r--r-- root/root usr/share/man/man5/xorg.conf.5.gz -rw-r--r-- root/root usr/share/man/man5/xorg.conf.d.5.gz -drwxr-xr-x root/root var/ -drwxr-xr-x root/root var/lib/ -drwxr-xr-x root/root var/lib/xkb/ --rw-r--r-- root/root var/lib/xkb/README.compiled diff --git a/xorg-server/.signature b/xorg-server/.signature index edfaa1ed..e7bff616 100644 --- a/xorg-server/.signature +++ b/xorg-server/.signature @@ -1,5 +1,7 @@ untrusted comment: verify with /etc/ports/xorg.pub -RWTSGWF5Q7TndJ8NqnSumNK4m6mlbqZQCmmsURA9Uh1B7UAssNlR3EcpzfLR1VCff+PY/adoxugmzGiYjYmv6V5WS4vYjydyFw8= -SHA256 (Pkgfile) = 37e19a73f6cb44812b92d64bd42086ee791202d0670f0931558a96bde73b2c27 -SHA256 (.footprint) = d159a275a4868001332954580ab4f70976c97a80334b157023935b36722e50cd +RWTSGWF5Q7TndEoK0L1fFjTMw5A7u0JA3TZLHVnXlipQmXhkoHynUQpEdCHkiryINOU1+WqosQPnTv3qKzNjrCW9MQRUuLk1dQ0= +SHA256 (Pkgfile) = dd85837f7c8fc4c0a431080b9577826c6bd5f06903c528e336bf2503352ac339 +SHA256 (.footprint) = 22ebe7390e74b30e28ca4833bba98490684c8b6258af9ee17d5940a114732333 SHA256 (xorg-server-1.20.13.tar.xz) = 40aa4e96a56a81a301f15a9b10e06a22700f12b42d9e0e453c7f11d354386300 +SHA256 (0001-v2-FS-58644.patch) = 6253fb5cf06cf650539be585d6ca13cfa00217b51ca9825476c8fd55c09341a4 +SHA256 (xserver-autobind-hotplug.patch) = cae1b7f296c18177de38f9b1215a4f916da2288b85f1fcb9e80373a42e2892b8 diff --git a/xorg-server/0001-v2-FS-58644.patch b/xorg-server/0001-v2-FS-58644.patch new file mode 100644 index 00000000..bb2e463e --- /dev/null +++ b/xorg-server/0001-v2-FS-58644.patch @@ -0,0 +1,57 @@ +From 17584285d296acaa80f131ca0e8b75eff675962b Mon Sep 17 00:00:00 2001 +From: fafryd <dz1125.bug.tracker@gmail.com> +Date: Sun, 20 May 2018 14:30:43 +0200 +Subject: [PATCH] v2 FS#58644 + +--- + hw/xfree86/common/meson.build | 13 +++++++++++++ + hw/xfree86/meson.build | 12 +++++++----- + 2 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/hw/xfree86/common/meson.build b/hw/xfree86/common/meson.build +index 514999ff6..0eff6e488 100644 +--- a/hw/xfree86/common/meson.build ++++ b/hw/xfree86/common/meson.build +@@ -1,3 +1,16 @@ ++if get_option('suid_wrapper') ++ x_sh = configure_file( ++ input: '../Xorg.sh.in', ++ output: 'Xorg', ++ configuration: conf_data, ++ ) ++ install_data( ++ x_sh, ++ install_mode: 'rwxr-xr-x', ++ install_dir: join_paths(get_option('prefix'), get_option('bindir')), ++ ) ++endif ++ + srcs_xorg_common = [ + 'xf86fbBus.c', + 'xf86noBus.c', +diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build +index cacf56d4c..d1295d404 100644 +--- a/hw/xfree86/meson.build ++++ b/hw/xfree86/meson.build +@@ -145,11 +145,13 @@ if get_option('suid_wrapper') + install_dir: get_option('libexecdir'), + # install_mode: ['r-sr-xr-x', 0, 0], + ) +- configure_file( +- input: 'Xorg.sh.in', +- output: 'Xorg', +- configuration: conf_data, +- install_dir: join_paths(get_option('prefix'), get_option('bindir')), ++ meson.add_install_script( ++ 'sh', '-c', ++ 'chmod u+s @0@@1@/@2@'.format( ++ '${DESTDIR}', ++ join_paths(get_option('prefix'), get_option('libexecdir')), ++ 'Xorg.wrap' ++ ) + ) + endif + +-- +2.17.0 + diff --git a/xorg-server/Pkgfile b/xorg-server/Pkgfile index c9d9c4e0..d9620a13 100644 --- a/xorg-server/Pkgfile +++ b/xorg-server/Pkgfile @@ -1,30 +1,34 @@ # Description: X Window System server # URL: http://xorg.freedesktop.org # Maintainer: CRUX Xorg Team, xorg-ports at crux dot nu -# Depends on: libepoxy xorg-bdftopcf xorg-font-util xorg-libdmx xorg-libxaw xorg-libxcomposite xorg-libxcursor xorg-libxfont2 xorg-libxft xorg-libxinerama xorg-libxkbfile xorg-libxres xorg-libxtst xorg-libxxf86dga xorg-mkfontscale xorg-xcb-util-keysyms +# Depends on: libepoxy nettle xorg-bdftopcf xorg-font-util xorg-libdmx xorg-libxaw xorg-libxcomposite xorg-libxcursor xorg-libxfont2 xorg-libxft xorg-libxinerama xorg-libxres xorg-libxtst xorg-libxxf86dga xorg-mkfontscale xorg-xcb-util-keysyms xorg-xkbcomp name=xorg-server version=1.20.13 -release=1 -source=(https://www.x.org/releases/individual/xserver/$name-$version.tar.xz) +release=2 +source=(https://www.x.org/releases/individual/xserver/$name-$version.tar.xz + 0001-v2-FS-58644.patch xserver-autobind-hotplug.patch) build() { - cd $name-$version + # https://bugs.freedesktop.org/show_bug.cgi?id=106588 + patch -Np1 -d $SRC/$name-$version -i $SRC/0001-v2-FS-58644.patch + patch -Np1 -d $SRC/$name-$version -i $SRC/xserver-autobind-hotplug.patch - ./configure \ + meson setup $name-$version build \ --prefix=/usr \ + --libexecdir=/usr/lib/$name \ --localstatedir=/var \ - --with-fontrootdir=/usr/share/fonts/X11 \ - --with-xkb-output=/var/lib/xkb \ - --enable-dri \ - --with-sha1=libcrypto \ - --disable-systemd-logind \ - --enable-glamor - - make - make DESTDIR=$PKG install - - rmdir $PKG/var/log + --buildtype=plain \ + --wrap-mode nodownload \ + -D b_lto=true \ + -D b_pie=true \ + -D os_vendor="CRUX" \ + -D xkb_dir=/usr/share/X11/xkb \ + -D xkb_output_dir=/var/lib/xkb \ + -D suid_wrapper=true \ + -D xorg=true + meson compile -C build + DESTDIR=$PKG meson install -C build install -m 755 -d $PKG/etc/X11/xorg.conf.d } diff --git a/xorg-server/xserver-autobind-hotplug.patch b/xorg-server/xserver-autobind-hotplug.patch new file mode 100644 index 00000000..86b96a23 --- /dev/null +++ b/xorg-server/xserver-autobind-hotplug.patch @@ -0,0 +1,293 @@ +From 471289fa1dc359555ceed6302f7d9605ab6be3ea Mon Sep 17 00:00:00 2001 +From: Dave Airlie <airlied@redhat.com> +Date: Mon, 2 Apr 2018 16:49:02 -0400 +Subject: [PATCH] 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> +--- + hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++ + hw/xfree86/common/xf86Globals.c | 2 ++ + hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++ + hw/xfree86/common/xf86Priv.h | 1 + + hw/xfree86/common/xf86Privstr.h | 1 + + hw/xfree86/common/xf86platformBus.c | 4 ++++ + hw/xfree86/man/Xorg.man | 7 +++++++ + hw/xfree86/man/xorg.conf.man | 6 ++++++ + randr/randrstr.h | 3 +++ + randr/rrprovider.c | 22 ++++++++++++++++++++++ + 10 files changed, 85 insertions(+) + +diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c +index 2c1d335..d7d7c2e 100644 +--- a/hw/xfree86/common/xf86Config.c ++++ b/hw/xfree86/common/xf86Config.c +@@ -643,6 +643,7 @@ typedef enum { + FLAG_DRI2, + FLAG_USE_SIGIO, + FLAG_AUTO_ADD_GPU, ++ FLAG_AUTO_BIND_GPU, + FLAG_MAX_CLIENTS, + FLAG_IGLX, + FLAG_DEBUG, +@@ -699,6 +700,8 @@ static OptionInfoRec FlagOptions[] = { + {0}, FALSE}, + {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, + {0}, FALSE}, ++ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN, ++ {0}, FALSE}, + {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, + {0}, FALSE }, + {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, +@@ -779,6 +782,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) + } + xf86Msg(from, "%sutomatically adding GPU devices\n", + xf86Info.autoAddGPU ? "A" : "Not a"); ++ ++ if (xf86AutoBindGPUDisabled) { ++ xf86Info.autoBindGPU = FALSE; ++ from = X_CMDLINE; ++ } ++ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) { ++ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU, ++ &xf86Info.autoBindGPU); ++ from = X_CONFIG; ++ } ++ else { ++ from = X_DEFAULT; ++ } ++ xf86Msg(from, "%sutomatically binding GPU devices\n", ++ xf86Info.autoBindGPU ? "A" : "Not a"); ++ + /* + * Set things up based on the config file information. Some of these + * settings may be overridden later when the command line options are +diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c +index e890f05..7b27b4c 100644 +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c +@@ -131,6 +131,7 @@ xf86InfoRec xf86Info = { + #else + .autoAddGPU = FALSE, + #endif ++ .autoBindGPU = TRUE, + }; + + const char *xf86ConfigFile = NULL; +@@ -191,6 +192,7 @@ Bool xf86FlipPixels = FALSE; + Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; + + Bool xf86AllowMouseOpenFail = FALSE; ++Bool xf86AutoBindGPUDisabled = FALSE; + + #ifdef XF86VIDMODE + Bool xf86VidModeDisabled = FALSE; +diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c +index ea42ec9..ec255b6 100644 +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c +@@ -76,6 +76,7 @@ + #include "xf86DDC.h" + #include "xf86Xinput.h" + #include "xf86InPriv.h" ++#include "xf86Crtc.h" + #include "picturestr.h" + #include "randrstr.h" + #include "glxvndabi.h" +@@ -237,6 +238,19 @@ xf86PrivsElevated(void) + return PrivsElevated(); + } + ++static void ++xf86AutoConfigOutputDevices(void) ++{ ++ int i; ++ ++ if (!xf86Info.autoBindGPU) ++ return; ++ ++ for (i = 0; i < xf86NumGPUScreens; i++) ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); ++} ++ + static void + TrapSignals(void) + { +@@ -770,6 +784,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) + for (i = 0; i < xf86NumGPUScreens; i++) + AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); + ++ xf86AutoConfigOutputDevices(); ++ + xf86VGAarbiterWrapFunctions(); + if (sigio_blocked) + input_unlock(); +@@ -1278,6 +1294,10 @@ ddxProcessArgument(int argc, char **argv, int i) + xf86Info.iglxFrom = X_CMDLINE; + return 0; + } ++ if (!strcmp(argv[i], "-noautoBindGPU")) { ++ xf86AutoBindGPUDisabled = TRUE; ++ return 1; ++ } + + /* OS-specific processing */ + return xf86ProcessArgument(argc, argv, i); +diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h +index 4fe2b5f..6566622 100644 +--- a/hw/xfree86/common/xf86Priv.h ++++ b/hw/xfree86/common/xf86Priv.h +@@ -46,6 +46,7 @@ + extern _X_EXPORT const char *xf86ConfigFile; + extern _X_EXPORT const char *xf86ConfigDir; + extern _X_EXPORT Bool xf86AllowMouseOpenFail; ++extern _X_EXPORT Bool xf86AutoBindGPUDisabled; + + #ifdef XF86VIDMODE + extern _X_EXPORT Bool xf86VidModeDisabled; +diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h +index 21c2e1f..6c71863 100644 +--- a/hw/xfree86/common/xf86Privstr.h ++++ b/hw/xfree86/common/xf86Privstr.h +@@ -98,6 +98,7 @@ typedef struct { + + Bool autoAddGPU; + const char *debug; ++ Bool autoBindGPU; + } xf86InfoRec, *xf86InfoPtr; + + /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index cef47da..913a324 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -49,6 +49,7 @@ + #include "Pci.h" + #include "xf86platformBus.h" + #include "xf86Config.h" ++#include "xf86Crtc.h" + + #include "randrstr.h" + int platformSlotClaimed; +@@ -665,6 +666,9 @@ xf86platformAddDevice(int index) + } + /* attach unbound to 0 protocol screen */ + AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); ++ if (xf86Info.autoBindGPU) ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); + + RRResourcesChanged(xf86Screens[0]->pScreen); + RRTellChanged(xf86Screens[0]->pScreen); +diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man +index 13a9dc3..745f986 100644 +--- a/hw/xfree86/man/Xorg.man ++++ b/hw/xfree86/man/Xorg.man +@@ -283,6 +283,13 @@ is a comma separated list of directories to search for + server modules. This option is only available when the server is run + as root (i.e, with real-uid 0). + .TP 8 ++.B \-noautoBindGPU ++Disable automatically setting secondary GPUs up as output sinks and offload ++sources. This is equivalent to setting the ++.B AutoBindGPU ++xorg.conf(__filemansuffix__) file option. To ++.B false. ++.TP 8 + .B \-nosilk + Disable Silken Mouse support. + .TP 8 +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 9589262..8d51e06 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -672,6 +672,12 @@ Enabled by default. + If this option is disabled, then no GPU devices will be added from the udev + backend. Enabled by default. (May need to be disabled to setup Xinerama). + .TP 7 ++.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q ++If enabled then secondary GPUs will be automatically set up as output-sinks and ++offload-sources. Making e.g. laptop outputs connected only to the secondary ++GPU directly available for use without needing to run ++"xrandr --setprovideroutputsource". Enabled by default. ++.TP 7 + .BI "Option \*qLog\*q \*q" string \*q + This option controls whether the log is flushed and/or synced to disk after + each message. +diff --git a/randr/randrstr.h b/randr/randrstr.h +index f94174b..092d726 100644 +--- a/randr/randrstr.h ++++ b/randr/randrstr.h +@@ -1039,6 +1039,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); + extern _X_EXPORT void + RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); + ++extern _X_EXPORT void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen); ++ + /* rrproviderproperty.c */ + + extern _X_EXPORT void +diff --git a/randr/rrprovider.c b/randr/rrprovider.c +index e4bc2bf..e04c18f 100644 +--- a/randr/rrprovider.c ++++ b/randr/rrprovider.c +@@ -485,3 +485,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) + + WriteEventsToClient(client, 1, (xEvent *) &pe); + } ++ ++void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) ++{ ++ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); ++ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); ++ RRProviderPtr provider = pScrPriv->provider; ++ RRProviderPtr master_provider = masterPriv->provider; ++ ++ if (!provider || !master_provider) ++ return; ++ ++ if ((provider->capabilities & RR_Capability_SinkOutput) && ++ (master_provider->capabilities & RR_Capability_SourceOutput)) { ++ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider); ++ RRInitPrimeSyncProps(pScreen); ++ } ++ ++ if ((provider->capabilities & RR_Capability_SourceOffload) && ++ (master_provider->capabilities & RR_Capability_SinkOffload)) ++ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); ++} +-- +2.16.2 + |