initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

View File

@@ -0,0 +1,200 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
# Based on xorg-server package
_realpkgbase=xenocara-server
pkgbase=$_realpkgbase-debug
pkgname=("${pkgbase}" "${_realpkgbase}-xephyr-debug" "${_realpkgbase}-xdmx-debug"
"${_realpkgbase}-xvfb-debug" "${_realpkgbase}-xnest-debug")
_openbsdver=6.9
pkgver=1.20.10
pkgrel=7
arch=('i686' 'x86_64')
license=('X11')
groups=('xenocara-debug' 'xorg-debug')
url="https://www.xenocara.org"
makedepends=('xenocara-proto' 'pixman' 'libx11' 'mesa' 'mesa-libgl' 'libxtrans'
'libxkbfile' 'libxfont2' 'libpciaccess' 'libxv'
'libxmu' 'libxrender' 'libxi' 'libxaw' 'libdmx' 'libxtst' 'libxres'
'xenocara-xkbcomp' 'xenocara-util-macros' 'xenocara-font-util' 'libgcrypt' 'libepoxy'
'xcb-util' 'xcb-util-image' 'xcb-util-renderutil' 'xcb-util-wm' 'xcb-util-keysyms'
'libxshmfence' 'libunwind' 'eudev')
options=(!strip) # It's required for debug packages
source=(https://repo.hyperbola.info:50000/sources/xenocara-libre/$_openbsdver/xserver-$pkgver.tar.lz{,.sig}
xserver-autobind-hotplug.patch
remove-forced-openbsd-getdtablecount-function-support.patch
remove-forced-openbsd-mmap-flag-support.patch
remove-forced-mno-sse-support.patch
remove-forced-bison-yyparse-function-support.patch
xvfb-run
xvfb-run.1
10-xorg.conf.example)
sha512sums=('a544cebe022891f65e91d1c49f146e0dad5de75018c6261a0f68152c9db9c2f346afefb5a4d97c17c5fb385308d44766380aad77904f7a893cae174777caae61'
'SKIP'
'd84f4d63a502b7af76ea49944d1b21e2030dfd250ac1e82878935cf631973310ac9ba1f0dfedf10980ec6c7431d61b7daa4b7bbaae9ee477b2c19812c1661a22'
'ffefe558d7ab64b4d066872964fbcf474b4b8c454da072d7f65475d44d1d72d6cd879805db3bb72eb27c3ec123d094e5f64fe4cb6af80c0205c1ffa45df568ea'
'51e37248d1a4967e055219d52957bcc9702dd243da1f937f76524019d4b2c00604e451b50420239ff7e2c51ce523eb5b61d643c8b2c797667672053abd5489eb'
'a101d5be7c2e774fb1aba9087d7a4583c6ae8900d40ba079fc7ce8592846c20ce24e5834f4c398dca6008f7ada6099c299ab6982c7f036667bc07b17fcf25708'
'dae6fa8635f8156aa79ce1d8385651eba3f61990ed2fb2c67493fe9d5079e80aaa0f272e31cc587e10eef15dc3be9ad97b862b5ea0897396e05a04068e2c94ac'
'73c8ead9fba6815dabfec0a55b3a53f01169f6f2d14ac4a431e53b2d96028672dbd6b50a3314568847b37b1e54ea4fc02bdf677feabb3b2697af55e2e5331810'
'de5e2cb3c6825e6cf1f07ca0d52423e17f34d70ec7935e9dd24be5fb9883bf1e03b50ff584931bd3b41095c510ab2aa44d2573fd5feaebdcb59363b65607ff22'
'47a60f37f6cb77c588537db750fd340d50d6cb998ab6d4ff3383a5871989a7c18c836c3e4fa1400659006cae4923763b7348d55ea1d28789432fdd693f2a98e2')
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
prepare() {
cd "xenocara-$_openbsdver/xserver"
# Patch from Fedora, not yet merged
patch -Np1 -i "$srcdir/xserver-autobind-hotplug.patch"
# Remove forced OpenBSD getdtablecount function support
patch -Np1 -i "$srcdir/remove-forced-openbsd-getdtablecount-function-support.patch"
# Remove forced OpenBSD mmap flag (__MAP_NOFAULT) support
patch -Np1 -i "$srcdir/remove-forced-openbsd-mmap-flag-support.patch"
# Remove forced -mno-sse (SSE extensions disabling) support
patch -Np1 -i "$srcdir/remove-forced-mno-sse-support.patch"
# Remove forced Bison yyparse function support
patch -Np1 -i "$srcdir/remove-forced-bison-yyparse-function-support.patch"
autoreconf -vfi
}
build() {
# Since pacman 5.0.2-2, hardened flags are now enabled in makepkg.conf
# With them, module fail to load with undefined symbol.
# See https://bugs.archlinux.org/task/55102 / https://bugs.archlinux.org/task/54845
export CFLAGS=${CFLAGS/-fno-plt}
export CXXFLAGS=${CXXFLAGS/-fno-plt}
export LDFLAGS=${LDFLAGS/,-z,now}
# It's required for debug packages
export CFLAGS=${CFLAGS/-O2/-O0 -g3}
export CXXFLAGS=${CXXFLAGS/-O2/-O0 -g3}
cd "xenocara-$_openbsdver/xserver"
./configure --prefix=/usr \
--enable-ipv6 \
--enable-dri \
--enable-dmx \
--enable-xvfb \
--enable-xnest \
--enable-composite \
--enable-xcsecurity \
--enable-libunwind \
--enable-xorg \
--enable-xephyr \
--enable-glamor \
--enable-debug \
--disable-xwayland \
--enable-kdrive \
--enable-config-udev \
--disable-systemd-logind \
--disable-suid-wrapper \
--enable-install-setuid \
--enable-record \
--disable-static \
--libexecdir=/usr/libexec/xorg \
--sysconfdir=/etc \
--localstatedir=/var \
--with-xkb-path=/usr/share/X11/xkb \
--with-xkb-output=/var/lib/xkb \
--with-fontrootdir=/usr/share/fonts \
--with-sha1=libgcrypt \
--without-systemd-daemon
make
# Disable subdirs for make install rule to make splitting easier
sed -e 's/^DMX_SUBDIRS =.*/DMX_SUBDIRS =/' \
-e 's/^XVFB_SUBDIRS =.*/XVFB_SUBDIRS =/' \
-e 's/^XNEST_SUBDIRS =.*/XNEST_SUBDIRS = /' \
-e 's/^KDRIVE_SUBDIRS =.*/KDRIVE_SUBDIRS =/' \
-i hw/Makefile
}
package_xenocara-server-debug() {
pkgdesc="Xenocara X server"
depends=(libepoxy libxfont2 libbsd pixman xenocara-server-common libunwind mesa-libgl xorg-input-evdev
libpciaccess libdrm libxshmfence) # FS#52949
# see xenocara/hw/xfree86/common/xf86Module.h for ABI versions - we provide major numbers that drivers can depend on
# and /usr/lib/pkgconfig/xorg-server.pc in xenocara-server-devel pkg
provides=('xenocara-server' 'xorg-server' 'X-ABI-VIDEODRV_VERSION=24.0' 'X-ABI-XINPUT_VERSION=24.1' 'X-ABI-EXTENSION_VERSION=10.0' 'x-server')
conflicts=('xenocara-server' 'xorg-server' 'nvidia-utils<=331.20' 'glamor-egl' 'xf86-video-modesetting')
replaces=('xorg-server' 'glamor-egl' 'xf86-video-modesetting' 'xf86-video-amdgpu')
install=$_realpkgbase.install
cd "xenocara-$_openbsdver/xserver"
make DESTDIR="$pkgdir" install
# distro specific files must be installed in /usr/share/X11/xorg.conf.d
install -m755 -d "$pkgdir/etc/X11/xorg.conf.d"
cp $srcdir/10-xorg.conf.example "$pkgdir/etc/X11/xorg.conf.d"
rm -rf "$pkgdir/var"
# remove files, these files are part of "-common" package
rm -f "$pkgdir/usr/share/man/man1/Xserver.1"
rm -f "$pkgdir/usr/lib/xorg/protocol.txt"
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
# remove files, these files are part of "-devel" package
rm -rf "$pkgdir/usr/lib/pkgconfig"
rm -rf "$pkgdir/usr/include"
rm -rf "$pkgdir/usr/share/aclocal"
}
package_xenocara-server-xephyr-debug() {
pkgdesc="A nested X server that runs as an X application, provided by Xenocara"
depends=(libxfont2 mesa-libgl libepoxy libunwind libeudev libxv pixman xenocara-server-common xcb-util-image
xcb-util-renderutil xcb-util-wm xcb-util-keysyms)
provides=('xenocara-server-xephyr' 'xorg-server-xephyr')
conflicts=('xenocara-server-xephyr' 'xorg-server-xephyr')
replaces=('xorg-server-xephyr')
cd "xenocara-$_openbsdver/xserver/hw/kdrive"
make DESTDIR="$pkgdir" install
install -Dm644 ../../COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
package_xenocara-server-xvfb-debug() {
pkgdesc="Virtual framebuffer X server, provided by Xenocara"
depends=(libxfont2 libunwind libeudev pixman xenocara-server-common xenocara-xauth mesa-libgl)
provides=('xenocara-server-xvfb' 'xorg-server-xvfb')
conflicts=('xenocara-server-xvfb' 'xorg-server-xvfb')
replaces=('xorg-server-xvfb')
cd "xenocara-$_openbsdver/xserver/hw/vfb"
make DESTDIR="$pkgdir" install
install -m755 "$srcdir/xvfb-run" "$pkgdir/usr/bin/"
install -m644 "$srcdir/xvfb-run.1" "$pkgdir/usr/share/man/man1/"
install -Dm644 ../../COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
package_xenocara-server-xnest-debug() {
pkgdesc="A nested X server that runs as an X application, provided by Xenocara"
depends=(libxfont2 libxext libunwind pixman xenocara-server-common libeudev)
provides=('xenocara-server-xnest' 'xorg-server-xnest')
conflicts=('xenocara-server-xnest' 'xorg-server-xnest')
replaces=('xorg-server-xnest')
cd "xenocara-$_openbsdver/xserver/hw/xnest"
make DESTDIR="$pkgdir" install
install -Dm644 ../../COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
package_xenocara-server-xdmx-debug() {
pkgdesc="Distributed Multihead X Server and utilities, provided by Xenocara"
depends=(libxfont2 libxi libxaw libxrender libdmx libxfixes libunwind pixman xenocara-server-common)
provides=('xenocara-server-xdmx' 'xorg-server-xdmx')
conflicts=('xenocara-server-xdmx' 'xorg-server-xdmx')
replaces=('xorg-server-xdmx')
cd "xenocara-$_openbsdver/xserver/hw/dmx"
make DESTDIR="$pkgdir" install
install -Dm644 ../../COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

View File

@@ -0,0 +1,52 @@
diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c
index 85bc0db..6cf5901 100644
--- a/hw/dmx/config/dmxconfig.c
+++ b/hw/dmx/config/dmxconfig.c
@@ -171,7 +171,6 @@ dmxConfigReadFile(const char *filename, int debug)
dmxLog(dmxInfo, "Reading configuration file \"%s\"\n", filename);
yyin = str;
yydebug = debug;
- yyparse();
fclose(str);
return 0;
}
diff --git a/hw/dmx/config/dmxtodmx.c b/hw/dmx/config/dmxtodmx.c
index 5a1a0b4..03c51c4 100644
--- a/hw/dmx/config/dmxtodmx.c
+++ b/hw/dmx/config/dmxtodmx.c
@@ -37,7 +37,6 @@
#include "dmxprint.h"
#include "dmxcompat.h"
-extern int yyparse(void);
extern int yydebug;
extern FILE *yyin;
@@ -45,7 +44,6 @@ int
main(int argc, char **argv)
{
yydebug = 0;
- yyparse();
dmxConfigPrint(stdout, dmxConfigEntry);
return 0;
}
diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index 05d8396..8d6a753 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -52,7 +52,6 @@
#include "dmxprint.h"
#include "dmxlog.h"
-extern int yyparse(void);
extern int yydebug;
extern FILE *yyin;
@@ -448,7 +447,6 @@ dmxConfigReadFile(void)
}
yyin = str;
yydebug = 0;
- yyparse();
fclose(str);
dmxLog(dmxInfo, "Read configuration file %s\n", dmxConfigFilename);

View File

@@ -0,0 +1,31 @@
diff --git a/hw/xfree86/os-support/misc/Makefile.am b/hw/xfree86/os-support/misc/Makefile.am
index 98e962f..0265aec 100644
--- a/hw/xfree86/os-support/misc/Makefile.am
+++ b/hw/xfree86/os-support/misc/Makefile.am
@@ -7,11 +7,6 @@ libmisc_la_SOURCES = SlowBcopy.c
AM_CPPFLAGS = $(XORG_INCS)
-if I386_VIDEO
-NOSSE_CFLAGS = -mno-sse
-endif
-
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(NOSSE_CFLAGS)
-
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS)
diff --git a/hw/xfree86/os-support/misc/Makefile.in b/hw/xfree86/os-support/misc/Makefile.in
index bb80b92..eb7680b 100644
--- a/hw/xfree86/os-support/misc/Makefile.in
+++ b/hw/xfree86/os-support/misc/Makefile.in
@@ -483,8 +483,7 @@ libmisc_la_SOURCES = SlowBcopy.c
#AM_LDFLAGS = -r
AM_CPPFLAGS = $(XORG_INCS)
-@I386_VIDEO_TRUE@NOSSE_CFLAGS = -mno-sse
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(NOSSE_CFLAGS)
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS)
all: all-am

View File

@@ -0,0 +1,16 @@
diff --git a/os/connection.c b/os/connection.c
index 4153930a..3c6d619c 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -692,9 +692,11 @@ EstablishNewConnections(ClientPtr clientUnused, void *closure)
if ((trans_conn = lookup_trans_conn(curconn)) == NULL)
return TRUE;
+#ifdef __OpenBSD__
if ((getdtablecount() + FdReserve) >= getdtablesize())
Backoff = TRUE;
else
+#endif
Backoff = FALSE;
if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL)

View File

@@ -0,0 +1,22 @@
diff --git a/Xext/shm.c b/Xext/shm.c
index a95c91c..fe42a66 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -1161,7 +1161,7 @@ ProcShmAttachFd(ClientPtr client)
shmdesc->is_fd = TRUE;
shmdesc->addr = mmap(NULL, statb.st_size,
stuff->readOnly ? PROT_READ : PROT_READ|PROT_WRITE,
- MAP_SHARED|__MAP_NOFAULT,
+ MAP_SHARED,
fd, 0);
close(fd);
@@ -1254,7 +1254,7 @@ ProcShmCreateSegment(ClientPtr client)
shmdesc->is_fd = TRUE;
shmdesc->addr = mmap(NULL, stuff->size,
stuff->readOnly ? PROT_READ : PROT_READ|PROT_WRITE,
- MAP_SHARED|__MAP_NOFAULT,
+ MAP_SHARED,
fd, 0);
if (shmdesc->addr == ((char *) -1)) {

View File

@@ -0,0 +1,35 @@
#!/bin/sh
post_install() {
echo '>>> !!!ATTENTION!!!'
echo '>>> ================================================================================='
echo '>>> For AMD/ATI Radeon R600 series and newer,'
echo '>>> please configure "/etc/X11/xorg.conf.d/00-device.conf" as it is written bellow:'
echo '>>> ---------------------------------------------------------------------------------'
echo '>>> Section "Device"'
echo '>>> Identifier "devname"'
echo '>>> Driver "modesetting"'
echo '>>> Option "AccelMethod" "none"'
echo '>>> EndSection'
echo '>>> ---------------------------------------------------------------------------------'
echo '>>> For unsupported GPU (non-UEFI machines), please install "xenocara-video-vesa" and'
echo '>>> configure "/etc/X11/xorg.conf.d/00-device.conf" as it is written bellow:'
echo '>>> ---------------------------------------------------------------------------------'
echo '>>> Section "Device"'
echo '>>> Identifier "devname"'
echo '>>> Driver "vesa"'
echo '>>> EndSection'
echo '>>> ---------------------------------------------------------------------------------'
echo '>>> Or install "xenocara-video-fbdev" package and'
echo '>>> configure "/etc/X11/xorg.conf.d/00-device.conf" as it is written bellow:'
echo '>>> ---------------------------------------------------------------------------------'
echo '>>> Section "Device"'
echo '>>> Identifier "devname"'
echo '>>> Driver "fbdev"'
echo '>>> EndSection'
echo '>>> ---------------------------------------------------------------------------------'
}
post_upgrade() {
post_install
}

View File

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

View File

@@ -0,0 +1,200 @@
#!/bin/sh
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../xorg-server/xvfb-run.sh
# Copyright (C) 2005 The T2 SDE Project
# Copyright (C) XXXX - 2005 Debian
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---
# $Id$
# from: http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/xvfb-run
# This script starts an instance of Xvfb, the "fake" X server, runs a command
# with that server available, and kills the X server when done. The return
# value of the command becomes the return value of this script.
#
# If anyone is using this to build a Debian package, make sure the package
# Build-Depends on xvfb, xbase-clients, and xfonts-base.
set -e
PROGNAME=xvfb-run
SERVERNUM=99
AUTHFILE=
ERRORFILE=/dev/null
STARTWAIT=3
XVFBARGS="-screen 0 640x480x24"
LISTENTCP="-nolisten tcp"
XAUTHPROTO=.
# Query the terminal to establish a default number of columns to use for
# displaying messages to the user. This is used only as a fallback in the event
# the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the
# script is running, and this cannot, only being calculated once.)
DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true
if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
DEFCOLUMNS=80
fi
# Display a message, wrapping lines at the terminal width.
message () {
echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
}
# Display an error message.
error () {
message "error: $*" >&2
}
# Display a usage message.
usage () {
if [ -n "$*" ]; then
message "usage error: $*"
fi
cat <<EOF
Usage: $PROGNAME [OPTION ...] COMMAND
Run COMMAND (usually an X client) in a virtual X server environment.
Options:
-a --auto-servernum try to get a free server number, starting at
--server-num (deprecated, use --auto-display
instead)
-d --auto-display use the X server to find a display number
automatically
-e FILE --error-file=FILE file used to store xauth errors and Xvfb
output (default: $ERRORFILE)
-f FILE --auth-file=FILE file used to store auth cookie
(default: ./.Xauthority)
-h --help display this usage message and exit
-n NUM --server-num=NUM server number to use (default: $SERVERNUM)
-l --listen-tcp enable TCP port listening in the X server
-p PROTO --xauth-protocol=PROTO X authority protocol name to use
(default: xauth command's default)
-s ARGS --server-args=ARGS arguments (other than server number and
"-nolisten tcp") to pass to the Xvfb server
(default: "$XVFBARGS")
-w DELAY --wait=DELAY delay in seconds to wait for Xvfb to start
before running COMMAND (default: $STARTWAIT)
EOF
}
# Find a free server number by looking at .X*-lock files in /tmp.
find_free_servernum() {
# Sadly, the "local" keyword is not POSIX. Leave the next line commented in
# the hope Debian Policy eventually changes to allow it in /bin/sh scripts
# anyway.
#local i
i=$SERVERNUM
while [ -f /tmp/.X$i-lock ]; do
i=$(($i + 1))
done
echo $i
}
# Parse the command line.
ARGS=$(getopt --options +ade:f:hn:lp:s:w: \
--long auto-servernum,auto-display,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
--name "$PROGNAME" -- "$@")
GETOPT_STATUS=$?
if [ $GETOPT_STATUS -ne 0 ]; then
error "internal error; getopt exited with status $GETOPT_STATUS"
exit 6
fi
eval set -- "$ARGS"
while :; do
case "$1" in
-a|--auto-servernum) SERVERNUM=$(find_free_servernum) ;;
-d|--auto-display) AUTO_DISPLAY=1 ;;
-e|--error-file) ERRORFILE="$2"; shift ;;
-f|--auth-file) AUTHFILE="$2"; shift ;;
-h|--help) SHOWHELP="yes" ;;
-n|--server-num) SERVERNUM="$2"; shift ;;
-l|--listen-tcp) LISTENTCP="" ;;
-p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
-s|--server-args) XVFBARGS="$2"; shift ;;
-w|--wait) STARTWAIT="$2"; shift ;;
--) shift; break ;;
*) error "internal error; getopt permitted \"$1\" unexpectedly"
exit 6
;;
esac
shift
done
if [ "$SHOWHELP" ]; then
usage
exit 0
fi
if [ -z "$*" ]; then
usage "need a command to run" >&2
exit 2
fi
if ! type xauth >/dev/null; then
error "xauth command not found"
exit 3
fi
# Set up the temp dir for the pid and X authorization file
XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)"
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
if [ -z "$AUTHFILE" ]; then
AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXX)
fi
# Start Xvfb.
MCOOKIE=$(mcookie)
if [ -z "$AUTO_DISPLAY" ]; then
# Old style using a pre-computed SERVERNUM
XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \
2>&1 &
XVFBPID=$!
else
# New style using Xvfb to provide a free display
PIDFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" pid.XXXXXX)
SERVERNUM=$(XAUTHORITY=$AUTHFILE Xvfb -displayfd 1 $XVFBARGS $LISTENTCP \
2>"$ERRORFILE" & echo $! > $PIDFILE)
XVFBPID=$(cat $PIDFILE)
fi
sleep "$STARTWAIT"
XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
add :$SERVERNUM $XAUTHPROTO $MCOOKIE
EOF
# Start the command and save its exit status.
set +e
DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
RETVAL=$?
set -e
# Kill Xvfb now that the command has exited.
kill $XVFBPID
# Clean up.
XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1
if [ -n "$XVFB_RUN_TMPDIR" ]; then
if ! rm -r "$XVFB_RUN_TMPDIR"; then
error "problem while cleaning up temporary directory"
exit 5
fi
fi
# Return the executed command's exit status.
exit $RETVAL
# vim:set ai et sts=4 sw=4 tw=80: