diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile index b608dfa..2ddbb33 100644 --- a/x11-servers/xorg-server/Makefile +++ b/x11-servers/xorg-server/Makefile @@ -2,8 +2,8 @@ # $FreeBSD$ PORTNAME?= xorg-server -PORTVERSION= ${XORG_VERSION} -PORTREVISION?= ${XORG_REVISION} +PORTVERSION= 1.14.5 +PORTREVISION?= 0 PORTEPOCH?= 1 CATEGORIES= x11-servers MASTER_SITES= XORG @@ -13,6 +13,8 @@ DISTNAME= xorg-server-${PORTVERSION} MAINTAINER= x11@FreeBSD.org COMMENT?= X.Org X server and related programs +LICENSE= MIT + LIB_DEPENDS= libdrm.so:${PORTSDIR}/graphics/libdrm RUN_DEPENDS= xkeyboard-config>=2.5:${PORTSDIR}/x11/xkeyboard-config \ xkbcomp:${PORTSDIR}/x11/xkbcomp @@ -26,35 +28,14 @@ OPTIONS_RADIO_CONF= HAL DEVD AIGLX_DESC= Compile with Accelerated Indirect GLX support SUID_DESC= Install the Xorg server with setuid bit set HAL_DESC= Compile with HAL config support -DEVD_DESC= Use devd for autoconfiguration of input devices (experimental) -OPTIONS_DEFAULT=AIGLX SUID HAL +DEVD_DESC= Use devd for autoconfiguration of input devices +OPTIONS_DEFAULT=AIGLX SUID DEVD OPTIONS_EXCLUDE_sparc64= HAL .include -.if defined(WITH_NEW_XORG) -XORG_VERSION= 1.12.4 -XORG_REVISION= 9 -PLIST_SUB+= OLD="@comment " NEW="" -EXTRA_PATCHES+= ${FILESDIR}/extra-clang \ - ${FILESDIR}/extra-configure \ - ${FILESDIR}/extra-new-bad-impl \ - ${FILESDIR}/extra-new-dix_dixfonts.c -.else -XORG_VERSION= 1.7.7 -XORG_REVISION= 14 -PLIST_SUB+= OLD="" NEW="@comment " -EXTRA_PATCHES+= ${FILESDIR}/extra-Xext-xace.c \ - ${FILESDIR}/extra-Xserver-os-xprintf.c \ - ${FILESDIR}/extra-include_eventstr.h \ - ${FILESDIR}/extra-os-utils.c \ - ${FILESDIR}/extra-dix_events.c \ - ${FILESDIR}/extra-Xserver-hw-xfree86-common-xf86Config.c \ - ${FILESDIR}/extra-old-dix_dixfonts.c -.endif - -USES= gmake libtool:keepla perl5 tar:bzip2 +USES= gmake libtool perl5 tar:bzip2 USE_PERL5= build USE_GL= gl USE_XORG?= xf86driproto glproto xdmcp x11 xkbfile xxf86misc xxf86vm xaw7 \ @@ -96,17 +77,13 @@ CONFIGURE_ARGS+= --enable-config-hal=yes CONFIGURE_ARGS+= --enable-config-hal=no .endif -.if ${PORT_OPTIONS:MDEVD} -EXTRA_PATCHES+= ${FILESDIR}/extra-config_devd.c -.endif - .if ${PORT_OPTIONS:MAIGLX} CONFIGURE_ARGS+= --enable-aiglx=yes .else CONFIGURE_ARGS+= --enable-aiglx=no .endif -# We handle Xorg setuid in the plist. This allows to build xorg-server as a user +# We handle Xorg setuid in the plist. This allows to build xorg-server as a user. CONFIGURE_ARGS+=--enable-install-setuid=no .if ${PORT_OPTIONS:MSUID} PLIST_SUB+= SUID="" @@ -115,34 +92,24 @@ PLIST_SUB+= SUID="@comment " .endif .if ${ARCH} == armv6 -.if defined(WITH_NEW_XORG) EXTRA_PATCHES+= ${FILESDIR}/extra-arm-patch-hw__xfree86__os-support__bsd__Makefile.in EXTRA_PATCHES+= ${FILESDIR}/extra-arm-patch-include__servermd.h .endif -.endif .if ${ARCH} == i386 -.if defined(WITH_NEW_XORG) -EXTRA_PATCHES+= ${FILESDIR}/extra-new-arch-i386 -.else -EXTRA_PATCHES+= ${FILESDIR}/extra-old-arch-i386 -.endif +EXTRA_PATCHES+= ${FILESDIR}/extra-arch-i386 .endif .if ${ARCH} == ia64 PLIST_SUB+= IA64_NA="@comment " -EXTRA_PATCHES+= ${.CURDIR}/files/extra-arch-ia64 +EXTRA_PATCHES+= ${FILESDIR}/extra-arch-ia64 .else PLIST_SUB+= IA64_NA="" .endif .if ${ARCH} == powerpc || ${ARCH} == powerpc64 PLIST_SUB+= PPC_NA="@comment " -.if defined(WITH_NEW_XORG) -EXTRA_PATCHES+= ${.CURDIR}/files/extra-new-arch-powerpc -.else -EXTRA_PATCHES+= ${.CURDIR}/files/extra-old-arch-powerpc -.endif +EXTRA_PATCHES+= ${FILESDIR}/extra-arch-powerpc .else PLIST_SUB+= PPC_NA="" .endif @@ -150,11 +117,7 @@ PLIST_SUB+= PPC_NA="" .if ${ARCH} == sparc64 PLIST_SUB+= SPARC64="" PLIST_SUB+= SPARC64_NA="@comment " -.if defined(WITH_NEW_XORG) -EXTRA_PATCHES+= ${FILESDIR}/extra-new-arch-sparc64 -.else -EXTRA_PATCHES+= ${FILESDIR}/extra-old-arch-sparc64 -.endif +EXTRA_PATCHES+= ${FILESDIR}/extra-arch-sparc64 .else PLIST_SUB+= SPARC64="@comment " PLIST_SUB+= SPARC64_NA="" @@ -183,29 +146,24 @@ post-patch: @${REINPLACE_CMD} -e 's|@GLX_TRUE@GLXMODS =|@GLX_BOGUS@GLXMODS =|g' \ -e 's|^LTLIBRARIES = |LTLIBRARIES = libglx.la |g' \ ${WRKSRC}/hw/xfree86/dixmods/Makefile.in -.if ${PORT_OPTIONS:MDEVD} - @${ECHO_CMD} -e "\nint config_devd_init(void);\nvoid config_devd_fini(void);" \ - >> ${WRKSRC}/config/config-backends.h -.endif - + post-configure: .if ${PORT_OPTIONS:MDEVD} @${REINPLACE_CMD} -e 's|config\.c|config.c devd.c|g' \ -e 's|config\.lo|config.lo devd.lo|g' \ ${WRKSRC}/config/Makefile + @${REINPLACE_CMD} -e 's|^/\* #undef CONFIG_UDEV \*/|#define CONFIG_DEVD 1|' \ + ${WRKSRC}/include/dix-config.h .endif .if ${SLAVE_PORT} == "no" post-install: -# The .xorg dir because else the xorg-server might not load the correct +# The .xorg dir because else the xorg-server might not load the correct # libglx module. - ${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg + @${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg ${INSTALL_LIB} ${WRKSRC}/hw/xfree86/dixmods/.libs/libglx.so \ ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/ - -.if defined(WITH_NEW_XORG) @${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d -.endif .endif # ! SLAVE_PORT .include diff --git a/x11-servers/xorg-server/distinfo b/x11-servers/xorg-server/distinfo index 7f1ac51..38dc666 100644 --- a/x11-servers/xorg-server/distinfo +++ b/x11-servers/xorg-server/distinfo @@ -1,4 +1,4 @@ SHA256 (xorg/xserver/xorg-server-1.7.7.tar.bz2) = 54c4d32bfeb8852adbea3ddae6981f3bc2eadb330124d9b35226c617c01926ff SIZE (xorg/xserver/xorg-server-1.7.7.tar.bz2) = 4939257 -SHA256 (xorg/xserver/xorg-server-1.12.4.tar.bz2) = 8ac07c35306ba3fb3c0972722dd4e919303039eca1d40ac7862560e0b2c94cf7 -SIZE (xorg/xserver/xorg-server-1.12.4.tar.bz2) = 5444761 +SHA256 (xorg/xserver/xorg-server-1.14.5.tar.bz2) = 8d0f06bf1416487a5170318477088826a8d737d4a201e996b2dc1ecff47461d1 +SIZE (xorg/xserver/xorg-server-1.14.5.tar.bz2) = 5503638 diff --git a/x11-servers/xorg-server/files/extra-Xext-xace.c b/x11-servers/xorg-server/files/extra-Xext-xace.c deleted file mode 100644 index 25bd425..0000000 --- a/x11-servers/xorg-server/files/extra-Xext-xace.c +++ /dev/null @@ -1,229 +0,0 @@ -From 6dae7f3792611aace1df0cca63bf50c50d93de43 Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Tue, 10 Aug 2010 18:30:20 +0000 -Subject: xace: Invalid reference to out-of-scope data. - -The callback data passed by reference to the hook was allocated on stack -within the scope of the case statement. The compiler is free to reuse -any of that stack space whilst making the function call so we may end up -passing garbage into the callback. - -References: - - Bug 18451 - Xorg server 1.5.2 SEGV during XFixesGetCursorImage() - https://bugs.freedesktop.org/show_bug.cgi?id=18451 - -v2: Drop the unrelated hunk that snuck in when ammending the commit -message. - -Signed-off-by: Chris Wilson -Reviewed-by: Alan Coopersmith -Signed-off-by: Keith Packard ---- -diff --git a/Xext/xace.c b/Xext/xace.c -index e10d837..c757cad 100644 ---- Xext/xace.c -+++ Xext/xace.c -@@ -87,7 +87,18 @@ void XaceHookAuditEnd(ClientPtr ptr, int result) - */ - int XaceHook(int hook, ...) - { -- pointer calldata; /* data passed to callback */ -+ union { -+ XaceResourceAccessRec res; -+ XaceDeviceAccessRec dev; -+ XaceSendAccessRec send; -+ XaceReceiveAccessRec recv; -+ XaceClientAccessRec client; -+ XaceExtAccessRec ext; -+ XaceServerAccessRec server; -+ XaceScreenAccessRec screen; -+ XaceAuthAvailRec auth; -+ XaceKeyAvailRec key; -+ } u; - int *prv = NULL; /* points to return value from callback */ - va_list ap; /* argument list */ - va_start(ap, hook); -@@ -99,117 +110,86 @@ int XaceHook(int hook, ...) - */ - switch (hook) - { -- case XACE_RESOURCE_ACCESS: { -- XaceResourceAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.id = va_arg(ap, XID); -- rec.rtype = va_arg(ap, RESTYPE); -- rec.res = va_arg(ap, pointer); -- rec.ptype = va_arg(ap, RESTYPE); -- rec.parent = va_arg(ap, pointer); -- rec.access_mode = va_arg(ap, Mask); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_RESOURCE_ACCESS: -+ u.res.client = va_arg(ap, ClientPtr); -+ u.res.id = va_arg(ap, XID); -+ u.res.rtype = va_arg(ap, RESTYPE); -+ u.res.res = va_arg(ap, pointer); -+ u.res.ptype = va_arg(ap, RESTYPE); -+ u.res.parent = va_arg(ap, pointer); -+ u.res.access_mode = va_arg(ap, Mask); -+ u.res.status = Success; /* default allow */ -+ prv = &u.res.status; - break; -- } -- case XACE_DEVICE_ACCESS: { -- XaceDeviceAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.dev = va_arg(ap, DeviceIntPtr); -- rec.access_mode = va_arg(ap, Mask); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_DEVICE_ACCESS: -+ u.dev.client = va_arg(ap, ClientPtr); -+ u.dev.dev = va_arg(ap, DeviceIntPtr); -+ u.dev.access_mode = va_arg(ap, Mask); -+ u.dev.status = Success; /* default allow */ -+ prv = &u.dev.status; - break; -- } -- case XACE_SEND_ACCESS: { -- XaceSendAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.dev = va_arg(ap, DeviceIntPtr); -- rec.pWin = va_arg(ap, WindowPtr); -- rec.events = va_arg(ap, xEventPtr); -- rec.count = va_arg(ap, int); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_SEND_ACCESS: -+ u.send.client = va_arg(ap, ClientPtr); -+ u.send.dev = va_arg(ap, DeviceIntPtr); -+ u.send.pWin = va_arg(ap, WindowPtr); -+ u.send.events = va_arg(ap, xEventPtr); -+ u.send.count = va_arg(ap, int); -+ u.send.status = Success; /* default allow */ -+ prv = &u.send.status; - break; -- } -- case XACE_RECEIVE_ACCESS: { -- XaceReceiveAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.pWin = va_arg(ap, WindowPtr); -- rec.events = va_arg(ap, xEventPtr); -- rec.count = va_arg(ap, int); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_RECEIVE_ACCESS: -+ u.recv.client = va_arg(ap, ClientPtr); -+ u.recv.pWin = va_arg(ap, WindowPtr); -+ u.recv.events = va_arg(ap, xEventPtr); -+ u.recv.count = va_arg(ap, int); -+ u.recv.status = Success; /* default allow */ -+ prv = &u.recv.status; - break; -- } -- case XACE_CLIENT_ACCESS: { -- XaceClientAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.target = va_arg(ap, ClientPtr); -- rec.access_mode = va_arg(ap, Mask); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_CLIENT_ACCESS: -+ u.client.client = va_arg(ap, ClientPtr); -+ u.client.target = va_arg(ap, ClientPtr); -+ u.client.access_mode = va_arg(ap, Mask); -+ u.client.status = Success; /* default allow */ -+ prv = &u.client.status; - break; -- } -- case XACE_EXT_ACCESS: { -- XaceExtAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.ext = va_arg(ap, ExtensionEntry*); -- rec.access_mode = DixGetAttrAccess; -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_EXT_ACCESS: -+ u.ext.client = va_arg(ap, ClientPtr); -+ u.ext.ext = va_arg(ap, ExtensionEntry*); -+ u.ext.access_mode = DixGetAttrAccess; -+ u.ext.status = Success; /* default allow */ -+ prv = &u.ext.status; - break; -- } -- case XACE_SERVER_ACCESS: { -- XaceServerAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.access_mode = va_arg(ap, Mask); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_SERVER_ACCESS: -+ u.server.client = va_arg(ap, ClientPtr); -+ u.server.access_mode = va_arg(ap, Mask); -+ u.server.status = Success; /* default allow */ -+ prv = &u.server.status; - break; -- } - case XACE_SCREEN_ACCESS: -- case XACE_SCREENSAVER_ACCESS: { -- XaceScreenAccessRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.screen = va_arg(ap, ScreenPtr); -- rec.access_mode = va_arg(ap, Mask); -- rec.status = Success; /* default allow */ -- calldata = &rec; -- prv = &rec.status; -+ case XACE_SCREENSAVER_ACCESS: -+ u.screen.client = va_arg(ap, ClientPtr); -+ u.screen.screen = va_arg(ap, ScreenPtr); -+ u.screen.access_mode = va_arg(ap, Mask); -+ u.screen.status = Success; /* default allow */ -+ prv = &u.screen.status; - break; -- } -- case XACE_AUTH_AVAIL: { -- XaceAuthAvailRec rec; -- rec.client = va_arg(ap, ClientPtr); -- rec.authId = va_arg(ap, XID); -- calldata = &rec; -+ case XACE_AUTH_AVAIL: -+ u.auth.client = va_arg(ap, ClientPtr); -+ u.auth.authId = va_arg(ap, XID); - break; -- } -- case XACE_KEY_AVAIL: { -- XaceKeyAvailRec rec; -- rec.event = va_arg(ap, xEventPtr); -- rec.keybd = va_arg(ap, DeviceIntPtr); -- rec.count = va_arg(ap, int); -- calldata = &rec; -+ case XACE_KEY_AVAIL: -+ u.key.event = va_arg(ap, xEventPtr); -+ u.key.keybd = va_arg(ap, DeviceIntPtr); -+ u.key.count = va_arg(ap, int); - break; -- } -- default: { -+ default: - va_end(ap); - return 0; /* unimplemented hook number */ -- } - } - va_end(ap); - - /* call callbacks and return result, if any. */ -- CallCallbacks(&XaceHooks[hook], calldata); -+ CallCallbacks(&XaceHooks[hook], &u); - return prv ? *prv : Success; - } - --- -cgit v0.9.0.2-2-gbebe diff --git a/x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c b/x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c deleted file mode 100644 index 59aad37..0000000 --- a/x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c +++ /dev/null @@ -1,11 +0,0 @@ ---- hw/xfree86/common/xf86Config.c.orig Fri Jun 23 12:32:32 2006 -+++ hw/xfree86/common/xf86Config.c Fri Jun 23 12:32:46 2006 -@@ -1042,7 +1042,7 @@ - else - xf86Info.estimateSizesAggressively = 0; - -- xf86Info.aiglx = TRUE; -+ xf86Info.aiglx = FALSE; - xf86Info.aiglxFrom = X_DEFAULT; - if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { - xf86Info.aiglx = value; diff --git a/x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c b/x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c deleted file mode 100644 index e9fb876..0000000 --- a/x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -p programs/Xserver/os/xprintf.c.orig programs/Xserver/os/xprintf.c ---- os/xprintf.c.orig Sun Jul 3 17:53:52 2005 -+++ os/xprintf.c Thu Jan 26 12:47:37 2006 -@@ -39,7 +39,7 @@ - # ifdef __va_copy - # define va_copy __va_copy - # else --# error "no working va_copy was found" -+# define va_copy(dest, src) ((dest) = (src)) - # endif - #endif - diff --git a/x11-servers/xorg-server/files/extra-arch-i386 b/x11-servers/xorg-server/files/extra-arch-i386 new file mode 100644 index 0000000..1a0bdee --- /dev/null +++ b/x11-servers/xorg-server/files/extra-arch-i386 @@ -0,0 +1,11 @@ +--- hw/xfree86/common/compiler.h.orig 2012-05-17 19:09:03.000000000 +0200 ++++ hw/xfree86/common/compiler.h 2013-01-18 13:59:18.366436857 +0100 +@@ -1335,7 +1335,7 @@ + + #if !defined(__SUNPRO_C) + #if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) +-#ifdef GCCUSESGAS ++#if defined(GCCUSESGAS) || defined(__clang__) + + /* + * If gcc uses gas rather than the native assembler, the syntax of these diff --git a/x11-servers/xorg-server/files/extra-arch-powerpc b/x11-servers/xorg-server/files/extra-arch-powerpc new file mode 100644 index 0000000..389fc87 --- /dev/null +++ b/x11-servers/xorg-server/files/extra-arch-powerpc @@ -0,0 +1,70 @@ +--- hw/xfree86/os-support/bsd/ppc_video.c.orig 2014-07-22 07:52:58.000000000 -0700 ++++ hw/xfree86/os-support/bsd/ppc_video.c 2014-07-22 08:00:21.000000000 -0700 +@@ -44,6 +44,8 @@ + #define DEV_MEM "/dev/xf86" + #endif + ++static int kmem = -1; ++ + static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); + static void ppcUnmapVidMem(int, pointer, unsigned long); + +@@ -68,6 +70,17 @@ + int fd = xf86Info.consoleFd; + pointer base; + ++#ifdef __FreeBSD__ ++ if (kmem == -1) { ++ kmem = open(DEV_MEM, 2); ++ if (kmem == -1) { ++ FatalError("mapVidMem: open %s", DEV_MEM); ++ } ++ } ++ ++ fd = kmem; ++#endif ++ + #ifdef DEBUG + xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); + #endif +@@ -93,7 +106,6 @@ + int Len) + { + int rv; +- static int kmem = -1; + + if (kmem == -1) { + kmem = open(DEV_MEM, 2); +@@ -118,6 +130,8 @@ + int fd = xf86Info.consoleFd; + + xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); ++ ++#ifndef __FreeBSD__ + if (ioBase == MAP_FAILED) { + ioBase = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0xf2000000); +@@ -127,6 +141,12 @@ + return FALSE; + } + } ++#endif ++ /* ++ * Note that outl() etc. check for ioBase == MAP_FAILED, so leaving it that ++ * way (e.g. on FreeBSD) is non-fatal. ++ */ ++ + return TRUE; + } + +@@ -134,8 +154,10 @@ + xf86DisableIO() + { + ++#ifndef __FreeBSD__ + if (ioBase != MAP_FAILED) { + munmap(__UNVOLATILE(ioBase), 0x10000); + ioBase = MAP_FAILED; + } ++#endif + } diff --git a/x11-servers/xorg-server/files/extra-arch-sparc64 b/x11-servers/xorg-server/files/extra-arch-sparc64 new file mode 100644 index 0000000..45d4005 --- /dev/null +++ b/x11-servers/xorg-server/files/extra-arch-sparc64 @@ -0,0 +1,12 @@ +--- hw/xfree86/os-support/bsd/bsd_init.c.orig 2012-05-17 19:09:03.000000000 +0200 ++++ hw/xfree86/os-support/bsd/bsd_init.c 2013-09-01 20:45:36.000000000 +0200 +@@ -230,6 +230,9 @@ + * Add cases for other *BSD that behave the same. + */ + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++#if defined(__sparc64__) ++ pci_system_init_dev_mem(fd); ++#endif + uname(&uts); + i = atof(uts.release) * 100; + if (i >= 310) diff --git a/x11-servers/xorg-server/files/extra-clang b/x11-servers/xorg-server/files/extra-clang deleted file mode 100644 index 7f22a52..0000000 --- a/x11-servers/xorg-server/files/extra-clang +++ /dev/null @@ -1,98 +0,0 @@ ---- dix/events.c.orig 2012-07-09 02:32:59.000000000 +0200 -+++ dix/events.c 2012-07-22 14:34:46.000000000 +0200 -@@ -5189,7 +5189,8 @@ - InitEvents(void) - { - int i; -- QdEventPtr qe, tmp; -+ QdEventPtr qe = NULL; -+ QdEventPtr tmp; - - inputInfo.numDevices = 0; - inputInfo.devices = (DeviceIntPtr) NULL; ---- hw/xfree86/common/xf86Xinput.c.orig 2012-06-26 08:24:18.000000000 +0200 -+++ hw/xfree86/common/xf86Xinput.c 2012-07-22 14:34:46.000000000 +0200 -@@ -524,7 +524,7 @@ - MatchAttrToken(const char *attr, struct xorg_list *patterns, - int (*compare) (const char *attr, const char *pattern)) - { -- const xf86MatchGroup *group; -+ const xf86MatchGroup *group = NULL; - - /* If there are no patterns, accept the match */ - if (xorg_list_is_empty(patterns)) ---- hw/xfree86/dri2/dri2.c.orig 2012-07-09 02:32:59.000000000 +0200 -+++ hw/xfree86/dri2/dri2.c 2012-07-22 14:38:42.000000000 +0200 -@@ -239,7 +239,7 @@ - static DRI2DrawableRefPtr - DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id) - { -- DRI2DrawableRefPtr ref; -+ DRI2DrawableRefPtr ref = NULL; - - xorg_list_for_each_entry(ref, &pPriv->reference_list, link) { - if (ref->id == id) -@@ -306,7 +306,8 @@ - { - DRI2DrawablePtr pPriv = p; - DRI2ScreenPtr ds = pPriv->dri2_screen; -- DRI2DrawableRefPtr ref, next; -+ DRI2DrawableRefPtr ref = NULL; -+ DRI2DrawableRefPtr next; - WindowPtr pWin; - PixmapPtr pPixmap; - DrawablePtr pDraw; -@@ -587,7 +588,7 @@ - DRI2InvalidateDrawable(DrawablePtr pDraw) - { - DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); -- DRI2DrawableRefPtr ref; -+ DRI2DrawableRefPtr ref = NULL; - - if (!pPriv || !pPriv->needInvalidate) - return; ---- test/list.c.orig 2012-06-26 06:12:51.000000000 +0200 -+++ test/list.c 2012-07-22 14:34:46.000000000 +0200 -@@ -187,7 +187,7 @@ - { - struct parent parent = { 0 }; - struct child child[3]; -- struct child *c; -+ struct child *c = NULL; - int i = 0; - - xorg_list_init(&parent.children); ---- xfixes/cursor.c.orig 2012-07-06 07:17:19.000000000 +0200 -+++ xfixes/cursor.c 2012-07-22 14:34:46.000000000 +0200 -@@ -1143,7 +1143,7 @@ - barrier_find_nearest(CursorScreenPtr cs, int dir, - int x1, int y1, int x2, int y2) - { -- struct PointerBarrierClient *c; -+ struct PointerBarrierClient *c = NULL; - struct PointerBarrier *nearest = NULL; - double min_distance = INT_MAX; /* can't get higher than that in X anyway */ - ---- hw/xfree86/parser/InputClass.c.orig 2013-07-04 11:45:42.139818164 +0200 -+++ hw/xfree86/parser/InputClass.c 2013-07-04 11:46:29.034806839 +0200 -@@ -362,7 +362,8 @@ - XF86ConfInputClassPtr prev; - - while (ptr) { -- xf86MatchGroup *group, *next; -+ xf86MatchGroup *group = NULL; -+ xf86MatchGroup *next; - char **list; - - TestFree(ptr->identifier); ---- hw/xfree86/loader/loadmod.c.orig 2013-07-04 11:48:11.160800614 +0200 -+++ hw/xfree86/loader/loadmod.c 2013-07-04 11:48:32.000800157 +0200 -@@ -472,7 +472,7 @@ - char **elem; - const char **subdirs; - const char **s; -- PatternPtr patterns; -+ PatternPtr patterns = NULL; - PatternPtr p; - DIR *d; - struct dirent *dp; diff --git a/x11-servers/xorg-server/files/extra-config_devd.c b/x11-servers/xorg-server/files/extra-config_devd.c deleted file mode 100644 index f6d66a3..0000000 --- a/x11-servers/xorg-server/files/extra-config_devd.c +++ /dev/null @@ -1,481 +0,0 @@ ---- /dev/null 2013-08-03 00:44:23.000000000 +0200 -+++ config/devd.c 2013-08-03 00:45:15.162836806 +0200 -@@ -0,0 +1,478 @@ -+/* -+ * Copyright © 2012 Baptiste Daroussin -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Author: Baptiste Daroussin -+ */ -+ -+#ifdef HAVE_DIX_CONFIG_H -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "input.h" -+#include "inputstr.h" -+#include "hotplug.h" -+#include "config-backends.h" -+#include "os.h" -+ -+#define DEVD_SOCK_PATH "/var/run/devd.pipe" -+ -+#define DEVD_EVENT_ADD '+' -+#define DEVD_EVENT_REMOVE '-' -+ -+static int sock_devd = -1; -+ -+#if XORG_VERSION_CURRENT < 10800000 -+enum { -+ ATTR_KEYBOARD, -+ ATTR_POINTER, -+ ATTR_JOYSTICK, -+ ATTR_TOUCHPAD, -+ ATTR_TOUCHSCREEN, -+}; -+#endif -+ -+struct hw_type { -+ const char *driver; -+ int flag; -+ const char *xdriver; -+}; -+ -+static struct hw_type hw_types[] = { -+ { "ukbd", ATTR_KEYBOARD, "kdb" }, -+ { "atkbd", ATTR_KEYBOARD, "kdb" }, -+ { "ums", ATTR_POINTER, "mouse" }, -+ { "psm", ATTR_POINTER, "mouse" }, -+ { "uhid", ATTR_POINTER, "mouse" }, -+ { "joy", ATTR_JOYSTICK, NULL }, -+ { "atp", ATTR_TOUCHPAD, NULL }, -+ { "uep", ATTR_TOUCHSCREEN, NULL }, -+ { NULL, -1, NULL }, -+}; -+ -+#if XORG_VERSION_CURRENT < 10800000 -+static void -+add_option(InputOption **options, const char *key, const char *value) -+{ -+ if (!value || *value == '\0') -+ return; -+ -+ for (; *options; options = &(*options)->next) -+ ; -+ *options = calloc(sizeof(**options), 1); -+ if (!*options) /* Yeesh. */ -+ return; -+ (*options)->key = xstrdup(key); -+ (*options)->value = xstrdup(value); -+ (*options)->next = NULL; -+} -+ -+static void -+remove_device(DeviceIntPtr dev) -+{ -+ /* this only gets called for devices that have already been added */ -+ LogMessage(X_INFO, "config/devd: removing device %s\n", dev->name); -+ -+ /* Call PIE here so we don't try to dereference a device that's -+ * already been removed. */ -+ OsBlockSignals(); -+ ProcessInputEvents(); -+ DeleteInputDeviceRequest(dev); -+ OsReleaseSignals(); -+} -+ -+static bool -+device_is_duplicate(char *config_info) -+{ -+ DeviceIntPtr dev; -+ -+ for (dev = inputInfo.devices; dev; dev = dev->next) -+ if (dev->config_info && (strcmp(dev->config_info, config_info) == 0)) -+ return true; -+ -+ for (dev = inputInfo.off_devices; dev; dev = dev->next) -+ if (dev->config_info && (strcmp(dev->config_info, config_info) == 0)) -+ return true; -+ -+ return false; -+} -+ -+#endif -+ -+static bool -+sysctl_exists(const char *format, ...) -+{ -+ va_list args; -+ char *name = NULL; -+ size_t len; -+ int ret; -+ -+ if (format == NULL) -+ return false; -+ -+ va_start(args, format); -+ vasprintf(&name, format, args); -+ va_end(args); -+ -+ ret = sysctlbyname(name, NULL, &len, NULL, 0); -+ -+ if (ret == -1) -+ len = 0; -+ -+ free(name); -+ return (len > 0); -+} -+ -+static char * -+sysctl_get_str(const char *format, ...) -+{ -+ va_list args; -+ char *name = NULL; -+ char *dest = NULL; -+ size_t len; -+ -+ if (format == NULL) -+ return NULL; -+ -+ va_start(args, format); -+ vasprintf(&name, format, args); -+ va_end(args); -+ -+ if (sysctlbyname(name, NULL, &len, NULL, 0) == 0) { -+ dest = malloc(len + 1); -+ if (sysctlbyname(name, dest, &len, NULL, 0) == 0) -+ dest[len] = '\0'; -+ else { -+ free(dest); -+ dest = NULL; -+ } -+ } -+ -+ free(name); -+ return dest; -+} -+ -+static void -+device_added(char *line) -+{ -+ char *walk; -+ char *path; -+ char *vendor; -+ char *product = NULL; -+ char *config_info = NULL; -+ InputOption *options = NULL; -+#if XORG_VERSION_CURRENT > 10800000 -+ InputAttributes attrs = {}; -+#else -+ InputOption *tmpo; -+#endif -+ DeviceIntPtr dev = NULL; -+ int i, rc; -+ -+ walk = strchr(line, ' '); -+ if (walk != NULL) -+ walk[0] = '\0'; -+ -+ for (i = 0; hw_types[i].driver != NULL; i++) { -+ if (strncmp(line, hw_types[i].driver, -+ strlen(hw_types[i].driver)) == 0 && -+ isnumber(*(line + strlen(hw_types[i].driver)))) { -+#if XORG_VERSION_CURRENT > 10800000 -+ attrs.flags |= hw_types[i].flag; -+#endif -+ break; -+ } -+ } -+ if (hw_types[i].driver == NULL) { -+ LogMessageVerb(X_INFO, 10, "config/devd: ignoring device %s\n", line); -+ return; -+ } -+ -+#if XORG_VERSION_CURRENT < 10800000 -+ if (hw_types[i].xdriver == NULL) { -+ LogMessageVerb(X_INFO, 10, "config/devd: ignoring device %s\n", line); -+ return; -+ } -+#endif -+ if (asprintf(&path, "/dev/%s", line) == -1) -+ return; -+ -+#if XORG_VERSION_CURRENT < 10800000 -+ options = calloc(sizeof(*options), 1); -+ if (!options) -+ return; -+ -+ add_option(&options, "_source", "server/devd"); -+#else -+ options = input_option_new(NULL, "_source", "server/devd"); -+ if (!options) -+ return; -+#endif -+ -+ vendor = sysctl_get_str("dev.%s.%s.%%desc", hw_types[i].driver, line + strlen(hw_types[i].driver)); -+ if (vendor == NULL) { -+#if XORG_VERSION_CURRENT > 10800000 -+ attrs.vendor = strdup("(unnamed)"); -+#endif -+ } else { -+ if ((product = strchr(vendor, ' ')) != NULL) { -+ product[0] = '\0'; -+ product++; -+ } -+#if XORG_VERSION_CURRENT > 10800000 -+ attrs.vendor = strdup(vendor); -+#endif -+ if (product != NULL && (walk = strchr(product, ',')) != NULL) -+ walk[0] = '\0'; -+#if XORG_VERSION_CURRENT > 10800000 -+ attrs.product = strdup(product != NULL ? product : "(unnamed)"); -+ options = input_option_new(options, "name", product != NULL ? product : "(unnamed)"); -+#else -+ add_option(&options, "name", product != NULL ? product : "(unnamed)"); -+#endif -+ } -+#if XORG_VERSION_CURRENT > 10800000 -+ attrs.usb_id = NULL; -+ options = input_option_new(options, "path", path); -+ options = input_option_new(options, "device", path); -+#else -+ add_option(&options, "path", path); -+ add_option(&options, "device", path); -+#endif -+ -+#if XORG_VERSION_CURRENT < 10800000 -+ add_option(&options, "driver", hw_types[i].xdriver); -+#endif -+ -+ if (asprintf(&config_info, "devd:%s", line) == -1) { -+ config_info = NULL; -+ goto unwind; -+ } -+ -+ if (device_is_duplicate(config_info)) { -+ LogMessage(X_WARNING, "config/devd: device %s already added. " -+ "Ignoring.\n", product != NULL ? product : "(unnamed)"); -+ goto unwind; -+ } -+ -+#if XORG_VERSION_CURRENT < 10800000 -+ add_option(&options, "config_info", config_info); -+#else -+ options = input_option_new(options, "config_info", config_info); -+#endif -+ LogMessage(X_INFO, "config/devd: Adding input device %s (%s)\n", -+ product != NULL ? product : "(unnamed)", path); -+ -+#if XORG_VERSION_CURRENT > 10800000 -+ rc = NewInputDeviceRequest(options, &attrs, &dev); -+#else -+ rc = NewInputDeviceRequest(options, &dev); -+#endif -+ -+ if (rc != Success) -+ goto unwind; -+ -+ unwind: -+ free(config_info); -+#if XORG_VERSION_CURRENT < 10800000 -+ while ((tmpo = options)) { -+ options = tmpo->next; -+ free(tmpo->key); /* NULL if dev != NULL */ -+ free(tmpo->value); /* NULL if dev != NULL */ -+ free(tmpo); -+ } -+#else -+ input_option_free_list(&options); -+#endif -+ -+#if XORG_VERSION_CURRENT > 10800000 -+ free(attrs.usb_id); -+ free(attrs.product); -+ free(attrs.device); -+ free(attrs.vendor); -+#endif -+ -+ return; -+} -+ -+static void -+device_removed(char *line) -+{ -+ char *walk; -+ char *value; -+#if XORG_VERSION_CURRENT < 10800000 -+ DeviceIntPtr dev, next; -+#endif -+ -+ walk = strchr(line, ' '); -+ if (walk != NULL) -+ walk[0] = '\0'; -+ -+ if (asprintf(&value, "devd:%s", line) == -1) -+ return; -+ -+#if XORG_VERSION_CURRENT > 10800000 -+ remove_devices("dev", value); -+#else -+ for (dev = inputInfo.devices; dev; dev = next) { -+ next = dev->next; -+ if (dev->config_info && strcmp(dev->config_info, value) == 0) -+ remove_device(dev); -+ } -+ for (dev = inputInfo.off_devices; dev; dev = next) { -+ next = dev->next; -+ if (dev->config_info && strcmp(dev->config_info, value) == 0) -+ remove_device(dev); -+ } -+#endif -+ -+ free(value); -+} -+ -+static ssize_t -+socket_getline(int fd, char **out) -+{ -+ char *buf; -+ ssize_t ret, cap, sz = 0; -+ char c; -+ -+ cap = 1024; -+ buf = malloc(cap * sizeof(char)); -+ if (!buf) -+ return -1; -+ -+ for (;;) { -+ ret = read(sock_devd, &c, 1); -+ if (ret < 1) { -+ free(buf); -+ return -1; -+ } -+ -+ if (c == '\n') -+ break; -+ -+ if (sz + 1 >= cap) { -+ cap *= 2; -+ buf = realloc(buf, cap *sizeof(char)); -+ } -+ buf[sz] = c; -+ sz++; -+ } -+ -+ buf[sz] = '\0'; -+ if (sz > 0) -+ *out = buf; -+ else -+ free(buf); -+ -+ return sz; /* number of bytes in the line, not counting the line break*/ -+} -+ -+static void -+wakeup_handler(pointer data, int err, pointer read_mask) -+{ -+ char *line = NULL; -+ -+ if (err < 0) -+ return; -+ -+ if (FD_ISSET(sock_devd, (fd_set *)read_mask)) { -+ if (socket_getline(sock_devd, &line) < 0) -+ return; -+ -+ switch(*line) { -+ case DEVD_EVENT_ADD: -+ device_added(line++); -+ break; -+ case DEVD_EVENT_REMOVE: -+ device_removed(line++); -+ break; -+ default: -+ break; -+ } -+ free(line); -+ } -+} -+ -+static void -+block_handler(pointer data, struct timeval **tv, pointer read_mask) -+{ -+} -+ -+int -+config_devd_init(void) -+{ -+ struct sockaddr_un devd; -+ char devicename[1024]; -+ int i, j; -+ -+ /* first scan the sysctl to determine the hardware if needed */ -+ -+ for (i = 0; hw_types[i].driver != NULL; i++) { -+ for (j = 0; sysctl_exists("dev.%s.%i.%%desc", hw_types[i].driver, j); j++) { -+ snprintf(devicename, 1024, "%s%i", hw_types[i].driver, j); -+ device_added(devicename); -+ } -+ -+ } -+ sock_devd = socket(AF_UNIX, SOCK_STREAM, 0); -+ if (sock_devd < 0) { -+ ErrorF("config/devd: Fail opening stream socket"); -+ return 0; -+ } -+ -+ devd.sun_family = AF_UNIX; -+ strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path)); -+ -+ if (connect(sock_devd, (struct sockaddr *) &devd, sizeof(struct sockaddr_un)) < 0) { -+ close(sock_devd); -+ ErrorF("config/devd: Fail to connect to devd"); -+ return 0; -+ } -+ -+ RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); -+ AddGeneralSocket(sock_devd); -+ -+ return 1; -+} -+ -+void -+config_devd_fini(void) -+{ -+ if (sock_devd < 0) -+ return; -+ -+ RemoveGeneralSocket(sock_devd); -+ RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); -+ close(sock_devd); -+} diff --git a/x11-servers/xorg-server/files/extra-configure b/x11-servers/xorg-server/files/extra-configure deleted file mode 100644 index cede35b..0000000 --- a/x11-servers/xorg-server/files/extra-configure +++ /dev/null @@ -1,11 +0,0 @@ ---- configure.orig 2013-09-07 22:11:27.210621324 +0200 -+++ configure 2013-09-07 22:11:52.912624338 +0200 -@@ -22839,7 +22839,7 @@ - } - _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : -- ac_cv_tls=$kw -+ ac_cv_tls=$kw; break ; - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done diff --git a/x11-servers/xorg-server/files/extra-dix_events.c b/x11-servers/xorg-server/files/extra-dix_events.c deleted file mode 100644 index caa7a99..0000000 --- a/x11-servers/xorg-server/files/extra-dix_events.c +++ /dev/null @@ -1,89 +0,0 @@ ---- dix/events.c.orig 2010-05-04 02:47:57.000000000 +0200 -+++ dix/events.c 2012-04-24 12:59:22.000000000 +0200 -@@ -3440,7 +3440,6 @@ CheckPassiveGrabsOnWindow( - { - DeviceIntPtr gdev; - XkbSrvInfoPtr xkbi = NULL; -- Mask mask = 0; - - gdev= grab->modifierDevice; - if (grab->grabtype == GRABTYPE_CORE) -@@ -3555,9 +3554,6 @@ CheckPassiveGrabsOnWindow( - } - xE = &core; - count = 1; -- mask = grab->eventMask; -- if (grab->ownerEvents) -- mask |= pWin->eventMask; - } else if (match & XI2_MATCH) - { - rc = EventToXI2((InternalEvent*)event, &xE); -@@ -3569,34 +3565,6 @@ CheckPassiveGrabsOnWindow( - continue; - } - count = 1; -- -- /* FIXME: EventToXI2 returns NULL for enter events, so -- * dereferencing the event is bad. Internal event types are -- * aligned with core events, so the else clause is valid. -- * long-term we should use internal events for enter/focus -- * as well */ -- if (xE) -- mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8]; -- else if (event->type == XI_Enter || event->type == XI_FocusIn) -- mask = grab->xi2mask[device->id][event->type/8]; -- -- if (grab->ownerEvents && wOtherInputMasks(grab->window)) -- { -- InputClientsPtr icp = -- wOtherInputMasks(grab->window)->inputClients; -- -- while(icp) -- { -- if (rClient(icp) == rClient(grab)) -- { -- int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type; -- mask |= icp->xi2mask[device->id][evtype/8]; -- break; -- } -- -- icp = icp->next; -- } -- } - } else - { - rc = EventToXI((InternalEvent*)event, &xE, &count); -@@ -3607,23 +3575,6 @@ CheckPassiveGrabsOnWindow( - "(%d, %d).\n", device->name, event->type, rc); - continue; - } -- mask = grab->eventMask; -- if (grab->ownerEvents && wOtherInputMasks(grab->window)) -- { -- InputClientsPtr icp = -- wOtherInputMasks(grab->window)->inputClients; -- -- while(icp) -- { -- if (rClient(icp) == rClient(grab)) -- { -- mask |= icp->mask[device->id]; -- break; -- } -- -- icp = icp->next; -- } -- } - } - - (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE); -@@ -3632,7 +3583,8 @@ CheckPassiveGrabsOnWindow( - { - FixUpEventFromWindow(device, xE, grab->window, None, TRUE); - -- TryClientEvents(rClient(grab), device, xE, count, mask, -+ TryClientEvents(rClient(grab), device, xE, count, -+ GetEventFilter(device, xE), - GetEventFilter(device, xE), grab); - } - diff --git a/x11-servers/xorg-server/files/extra-include_eventstr.h b/x11-servers/xorg-server/files/extra-include_eventstr.h deleted file mode 100644 index e39aadd..0000000 --- a/x11-servers/xorg-server/files/extra-include_eventstr.h +++ /dev/null @@ -1,14 +0,0 @@ ---- include/eventstr.h.orig 2012-02-05 19:23:06.000000000 +0100 -+++ include/eventstr.h 2012-02-05 19:23:35.000000000 +0100 -@@ -91,9 +91,9 @@ - uint32_t button; /**< Button number */ - uint32_t key; /**< Key code */ - } detail; -- uint16_t root_x; /**< Pos relative to root window in integral data */ -+ int16_t root_x; /**< Pos relative to root window in integral data */ - float root_x_frac; /**< Pos relative to root window in frac part */ -- uint16_t root_y; /**< Pos relative to root window in integral part */ -+ int16_t root_y; /**< Pos relative to root window in integral part */ - float root_y_frac; /**< Pos relative to root window in frac part */ - uint8_t buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */ - struct { diff --git a/x11-servers/xorg-server/files/extra-new-arch-i386 b/x11-servers/xorg-server/files/extra-new-arch-i386 deleted file mode 100644 index 1a0bdee..0000000 --- a/x11-servers/xorg-server/files/extra-new-arch-i386 +++ /dev/null @@ -1,11 +0,0 @@ ---- hw/xfree86/common/compiler.h.orig 2012-05-17 19:09:03.000000000 +0200 -+++ hw/xfree86/common/compiler.h 2013-01-18 13:59:18.366436857 +0100 -@@ -1335,7 +1335,7 @@ - - #if !defined(__SUNPRO_C) - #if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) --#ifdef GCCUSESGAS -+#if defined(GCCUSESGAS) || defined(__clang__) - - /* - * If gcc uses gas rather than the native assembler, the syntax of these diff --git a/x11-servers/xorg-server/files/extra-new-arch-powerpc b/x11-servers/xorg-server/files/extra-new-arch-powerpc deleted file mode 100644 index 389fc87..0000000 --- a/x11-servers/xorg-server/files/extra-new-arch-powerpc +++ /dev/null @@ -1,70 +0,0 @@ ---- hw/xfree86/os-support/bsd/ppc_video.c.orig 2014-07-22 07:52:58.000000000 -0700 -+++ hw/xfree86/os-support/bsd/ppc_video.c 2014-07-22 08:00:21.000000000 -0700 -@@ -44,6 +44,8 @@ - #define DEV_MEM "/dev/xf86" - #endif - -+static int kmem = -1; -+ - static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); - static void ppcUnmapVidMem(int, pointer, unsigned long); - -@@ -68,6 +70,17 @@ - int fd = xf86Info.consoleFd; - pointer base; - -+#ifdef __FreeBSD__ -+ if (kmem == -1) { -+ kmem = open(DEV_MEM, 2); -+ if (kmem == -1) { -+ FatalError("mapVidMem: open %s", DEV_MEM); -+ } -+ } -+ -+ fd = kmem; -+#endif -+ - #ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); - #endif -@@ -93,7 +106,6 @@ - int Len) - { - int rv; -- static int kmem = -1; - - if (kmem == -1) { - kmem = open(DEV_MEM, 2); -@@ -118,6 +130,8 @@ - int fd = xf86Info.consoleFd; - - xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); -+ -+#ifndef __FreeBSD__ - if (ioBase == MAP_FAILED) { - ioBase = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0xf2000000); -@@ -127,6 +141,12 @@ - return FALSE; - } - } -+#endif -+ /* -+ * Note that outl() etc. check for ioBase == MAP_FAILED, so leaving it that -+ * way (e.g. on FreeBSD) is non-fatal. -+ */ -+ - return TRUE; - } - -@@ -134,8 +154,10 @@ - xf86DisableIO() - { - -+#ifndef __FreeBSD__ - if (ioBase != MAP_FAILED) { - munmap(__UNVOLATILE(ioBase), 0x10000); - ioBase = MAP_FAILED; - } -+#endif - } diff --git a/x11-servers/xorg-server/files/extra-new-arch-sparc64 b/x11-servers/xorg-server/files/extra-new-arch-sparc64 deleted file mode 100644 index 45d4005..0000000 --- a/x11-servers/xorg-server/files/extra-new-arch-sparc64 +++ /dev/null @@ -1,12 +0,0 @@ ---- hw/xfree86/os-support/bsd/bsd_init.c.orig 2012-05-17 19:09:03.000000000 +0200 -+++ hw/xfree86/os-support/bsd/bsd_init.c 2013-09-01 20:45:36.000000000 +0200 -@@ -230,6 +230,9 @@ - * Add cases for other *BSD that behave the same. - */ - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -+#if defined(__sparc64__) -+ pci_system_init_dev_mem(fd); -+#endif - uname(&uts); - i = atof(uts.release) * 100; - if (i >= 310) diff --git a/x11-servers/xorg-server/files/extra-new-bad-impl b/x11-servers/xorg-server/files/extra-new-bad-impl deleted file mode 100644 index d15ee84..0000000 --- a/x11-servers/xorg-server/files/extra-new-bad-impl +++ /dev/null @@ -1,38 +0,0 @@ -Fix BadImplemented triggered in GDK 3 - -Lead: -https://bbs.archlinux.org/viewtopic.php?id=162012 -Debian bug: -http://lists.debian.org/debian-x/2012/12/msg00133.html - ---- Xi/xiselectev.c.orig 2012-05-17 19:09:01.000000000 +0200 -+++ Xi/xiselectev.c 2012-12-18 10:29:38.804469850 +0100 -@@ -175,17 +175,24 @@ - if (inputMasks) - iclient = inputMasks->inputClients; - for (; iclient; iclient = iclient->next) { -- DeviceIntPtr dummy; -+ DeviceIntPtr devTest; -+ DeviceIntRec dummyTest; - - if (CLIENT_ID(iclient->resource) == client->index) - continue; - -- dixLookupDevice(&dummy, evmask->deviceid, serverClient, -+ if (evmask->deviceid == XIAllDevices || -+ evmask->deviceid == XIAllMasterDevices) { -+ dummyTest.id = evmask->deviceid; -+ devTest = &dummyTest; -+ } -+ else -+ dixLookupDevice(&devTest, evmask->deviceid, serverClient, - DixReadAccess); -- if (!dummy) -+ if (!devTest) - return BadImplementation; /* this shouldn't happen */ - -- if (xi2mask_isset(iclient->xi2mask, dummy, XI_TouchBegin)) -+ if (xi2mask_isset(iclient->xi2mask, devTest, XI_TouchBegin)) - return BadAccess; - } - } diff --git a/x11-servers/xorg-server/files/extra-new-dix_dixfonts.c b/x11-servers/xorg-server/files/extra-new-dix_dixfonts.c deleted file mode 100644 index d1f5674..0000000 --- a/x11-servers/xorg-server/files/extra-new-dix_dixfonts.c +++ /dev/null @@ -1,41 +0,0 @@ ---- dix/dixfonts.c.orig 2012-05-17 19:09:01.000000000 +0200 -+++ dix/dixfonts.c 2013-10-09 10:49:38.158284440 +0200 -@@ -1414,6 +1414,7 @@ - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; -+ ITclosurePtr old_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled -@@ -1425,12 +1426,14 @@ - err = BadAlloc; - goto bail; - } -+ old_closure = c; - *new_closure = *c; - c = new_closure; - - data = malloc(c->nChars * itemSize); - if (!data) { - free(c); -+ c = old_closure; - err = BadAlloc; - goto bail; - } -@@ -1441,6 +1444,7 @@ - if (!pGC) { - free(c->data); - free(c); -+ c = old_closure; - err = BadAlloc; - goto bail; - } -@@ -1453,6 +1457,7 @@ - FreeScratchGC(pGC); - free(c->data); - free(c); -+ c = old_closure; - err = BadAlloc; - goto bail; - } diff --git a/x11-servers/xorg-server/files/extra-old-arch-i386 b/x11-servers/xorg-server/files/extra-old-arch-i386 deleted file mode 100644 index c5e558c..0000000 --- a/x11-servers/xorg-server/files/extra-old-arch-i386 +++ /dev/null @@ -1,11 +0,0 @@ ---- hw/xfree86/common/compiler.h.orig 2010-05-04 02:47:58.000000000 +0200 -+++ hw/xfree86/common/compiler.h 2013-01-18 13:07:35.785442739 +0100 -@@ -1021,7 +1021,7 @@ - - # if !defined(__SUNPRO_C) - # if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) --# ifdef GCCUSESGAS -+# if defined(GCCUSESGAS) || defined(__clang__) - - /* - * If gcc uses gas rather than the native assembler, the syntax of these diff --git a/x11-servers/xorg-server/files/extra-old-arch-powerpc b/x11-servers/xorg-server/files/extra-old-arch-powerpc deleted file mode 100644 index 6fa9178..0000000 --- a/x11-servers/xorg-server/files/extra-old-arch-powerpc +++ /dev/null @@ -1,14 +0,0 @@ ---- hw/xfree86/os-support/bsd/ppc_video.c.orig 2008-01-02 12:29:21.000000000 +0000 -+++ hw/xfree86/os-support/bsd/ppc_video.c 2008-01-02 12:29:00.000000000 +0000 -@@ -164,7 +164,11 @@ - - if (ioBase != MAP_FAILED) - { -+#if defined(__FreeBSD__) -+ munmap(__DEVOLATILE(unsigned char *, ioBase), 0x10000); -+#else - munmap(__UNVOLATILE(ioBase), 0x10000); -+#endif - ioBase = MAP_FAILED; - } - } diff --git a/x11-servers/xorg-server/files/extra-old-arch-sparc64 b/x11-servers/xorg-server/files/extra-old-arch-sparc64 deleted file mode 100644 index 651be80..0000000 --- a/x11-servers/xorg-server/files/extra-old-arch-sparc64 +++ /dev/null @@ -1,13 +0,0 @@ ---- hw/xfree86/os-support/bsd/sparc64_video.c.orig 2008-10-02 21:01:25.000000000 +0000 -+++ hw/xfree86/os-support/bsd/sparc64_video.c 2009-03-29 19:55:40.000000000 +0000 -@@ -52,6 +52,10 @@ - pVidMem->mapMem = sparc64MapVidMem; - pVidMem->unmapMem = sparc64UnmapVidMem; - pVidMem->initialised = TRUE; -+ -+#if defined(__FreeBSD__) -+ pci_system_init_dev_mem(xf86Info.screenFd); -+#endif - } - - static pointer diff --git a/x11-servers/xorg-server/files/extra-old-dix_dixfonts.c b/x11-servers/xorg-server/files/extra-old-dix_dixfonts.c deleted file mode 100644 index 163a4ef..0000000 --- a/x11-servers/xorg-server/files/extra-old-dix_dixfonts.c +++ /dev/null @@ -1,42 +0,0 @@ ---- dix/dixfonts.c.orig 2010-05-04 02:47:57.000000000 +0200 -+++ dix/dixfonts.c 2013-10-09 10:54:40.488267646 +0200 -@@ -1508,6 +1508,7 @@ - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; -+ ITclosurePtr old_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled -@@ -1520,6 +1521,7 @@ - err = BadAlloc; - goto bail; - } -+ old_closure = c; - *new_closure = *c; - c = new_closure; - -@@ -1527,6 +1529,7 @@ - if (!data) - { - xfree(c); -+ c = old_closure; - err = BadAlloc; - goto bail; - } -@@ -1538,6 +1541,7 @@ - { - xfree(c->data); - xfree(c); -+ c = old_closure; - err = BadAlloc; - goto bail; - } -@@ -1551,6 +1555,7 @@ - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); -+ c = old_closure; - err = BadAlloc; - goto bail; - } diff --git a/x11-servers/xorg-server/files/extra-os-utils.c b/x11-servers/xorg-server/files/extra-os-utils.c deleted file mode 100644 index 2980ded..0000000 --- a/x11-servers/xorg-server/files/extra-os-utils.c +++ /dev/null @@ -1,20 +0,0 @@ ---- os/utils.c.orig 2010-05-04 02:48:00.000000000 +0200 -+++ os/utils.c 2011-10-18 20:08:10.000000000 +0200 -@@ -315,7 +315,7 @@ - FatalError("Could not create lock file in %s\n", tmp); - (void) sprintf(pid_str, "%10ld\n", (long)getpid()); - (void) write(lfd, pid_str, 11); -- (void) chmod(tmp, 0444); -+ (void) fchmod(tmp, 0444); - (void) close(lfd); - - /* -@@ -336,7 +336,7 @@ - /* - * Read the pid from the existing file - */ -- lfd = open(LockFile, O_RDONLY); -+ lfd = open(LockFile, O_RDONLY|O_NOFOLLOW); - if (lfd < 0) { - unlink(tmp); - FatalError("Can't read lock file %s\n", LockFile); diff --git a/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c b/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c index 933742b..d0bbe3d 100644 --- a/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c +++ b/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c @@ -1,8 +1,5 @@ -Index: programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c -diff -u -p programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c.orig programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c ---- hw/xfree86/os-support/bsd/i386_video.c.orig Tue Oct 4 01:46:14 2005 -+++ hw/xfree86/os-support/bsd/i386_video.c Thu Jan 26 14:57:56 2006 -@@ -35,6 +35,7 @@ +Index: hw/xfree86/os-support/bsd/i386_video.c +@@ -32,6 +32,7 @@ #include "xf86Priv.h" #include diff --git a/x11-servers/xorg-server/files/patch-config_config-backends.h b/x11-servers/xorg-server/files/patch-config_config-backends.h new file mode 100644 index 0000000..ca5ed9f --- /dev/null +++ b/x11-servers/xorg-server/files/patch-config_config-backends.h @@ -0,0 +1,11 @@ +Index: config/config-backends.h +@@ -73,3 +73,8 @@ + int config_wscons_init(void); + void config_wscons_fini(void); + #endif ++ ++#ifdef CONFIG_DEVD ++int config_devd_init(void); ++void config_devd_fini(void); ++#endif + diff --git a/x11-servers/xorg-server/files/patch-config_config.c b/x11-servers/xorg-server/files/patch-config_config.c new file mode 100644 index 0000000..0d0f167 --- /dev/null +++ b/x11-servers/xorg-server/files/patch-config_config.c @@ -0,0 +1,20 @@ +Index: config/config.c +@@ -55,6 +55,9 @@ + #elif defined(CONFIG_WSCONS) + if (!config_wscons_init()) + ErrorF("[config] failed to initialise wscons\n"); ++#elif defined(CONFIG_DEVD) ++ if (!config_devd_init()) ++ ErrorF("[config] failed to initialise devd\n"); + #endif + } + +@@ -73,6 +76,8 @@ + config_dbus_core_fini(); + #elif defined(CONFIG_WSCONS) + config_wscons_fini(); ++#elif defined(CONFIG_DEVD) ++ config_devd_fini(); + #endif + } + diff --git a/x11-servers/xorg-server/files/patch-config_devd.c b/x11-servers/xorg-server/files/patch-config_devd.c new file mode 100644 index 0000000..4a4d2be --- /dev/null +++ b/x11-servers/xorg-server/files/patch-config_devd.c @@ -0,0 +1,475 @@ +--- config/devd.c.orig 2014-10-30 22:58:01.116847441 +0100 ++++ config/devd.c 2014-10-31 10:01:12.200208323 +0100 +@@ -0,0 +1,472 @@ ++/* ++ * Copyright (c) 2012 Baptiste Daroussin ++ * Copyright (c) 2013, 2014 Alex Kozlov ++ * Copyright (c) 2014 Robert Millan ++ * Copyright (c) 2014 Jean-Sebastien Pedron ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ * ++ * Author: Baptiste Daroussin ++ */ ++ ++#ifdef HAVE_DIX_CONFIG_H ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "input.h" ++#include "inputstr.h" ++#include "hotplug.h" ++#include "config-backends.h" ++#include "os.h" ++ ++#define DEVD_SOCK_PATH "/var/run/devd.pipe" ++ ++#define DEVD_EVENT_ADD '+' ++#define DEVD_EVENT_REMOVE '-' ++ ++#define RECONNECT_DELAY 5 * 1000 ++ ++static int sock_devd; ++OsTimerPtr rtimer; ++ ++struct hw_type { ++ const char *driver; ++ int flag; ++ const char *xdriver; ++}; ++ ++static struct hw_type hw_types[] = { ++ { "ukbd", ATTR_KEYBOARD, "kbd" }, ++ { "atkbd", ATTR_KEYBOARD, "kbd" }, ++ { "sysmouse", ATTR_POINTER, "mouse" }, ++ { "ums", ATTR_POINTER, "mouse" }, ++ { "psm", ATTR_POINTER, "mouse" }, ++ { "uhid", ATTR_POINTER, "mouse" }, ++ { "joy", ATTR_JOYSTICK, NULL }, ++ { "atp", ATTR_TOUCHPAD, NULL }, ++ { "uep", ATTR_TOUCHSCREEN, NULL }, ++ { NULL, -1, NULL }, ++}; ++ ++static bool ++sysctl_exists(const struct hw_type *device, int unit, ++ char *devname, size_t devname_len) ++{ ++ char *sysctlname; ++ size_t len; ++ int ret; ++ ++ if (device == NULL || device->driver == NULL) ++ return false; ++ ++ /* Check if a sysctl exists. */ ++ asprintf(&sysctlname, "dev.%s.%i.%%desc", device->driver, unit); ++ if (sysctlname == NULL) ++ return false; ++ ++ ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0); ++ free(sysctlname); ++ ++ if (ret == 0 && len > 0) { ++ snprintf(devname, devname_len, "%s%i", device->driver, unit); ++ return true; ++ } ++ ++ return false; ++} ++ ++static bool ++devpath_exists(const struct hw_type *device, ++ char *devname, size_t devname_len) ++{ ++ char *devpath; ++ struct stat st; ++ int ret; ++ ++ if (device == NULL || device->driver == NULL) ++ return false; ++ ++ /* Check if /dev/$driver exists. */ ++ asprintf(&devpath, "/dev/%s", device->driver); ++ if (devpath == NULL) ++ return false; ++ ++ ret = stat(devpath, &st); ++ free(devpath); ++ ++ if (ret == 0) { ++ strncpy(devname, device->driver, devname_len); ++ return true; ++ } ++ ++ return false; ++} ++ ++static char * ++sysctl_get_str(const char *format, ...) ++{ ++ va_list args; ++ char *name = NULL; ++ char *dest = NULL; ++ size_t len; ++ ++ if (format == NULL) ++ return NULL; ++ ++ va_start(args, format); ++ vasprintf(&name, format, args); ++ va_end(args); ++ ++ if (sysctlbyname(name, NULL, &len, NULL, 0) == 0) { ++ dest = malloc(len + 1); ++ if (dest) { ++ if (sysctlbyname(name, dest, &len, NULL, 0) == 0) ++ dest[len] = '\0'; ++ else { ++ free(dest); ++ dest = NULL; ++ } ++ } ++ } ++ ++ free(name); ++ return dest; ++} ++ ++static void ++device_added(char *devname) ++{ ++ char path[PATH_MAX]; ++ char *vendor; ++ char *product = NULL; ++ char *config_info = NULL; ++ char *walk; ++ InputOption *options = NULL; ++ InputAttributes attrs = { }; ++ DeviceIntPtr dev = NULL; ++ int i; ++ int fd; ++ ++ for (i = 0; hw_types[i].driver != NULL; i++) { ++ size_t len; ++ ++ len = strlen(hw_types[i].driver); ++ if (strcmp(devname, hw_types[i].driver) == 0 || ++ (strncmp(devname, hw_types[i].driver, len) == 0 && ++ isnumber(*(devname + len)))) { ++ attrs.flags |= hw_types[i].flag; ++ break; ++ } ++ } ++ ++ if (hw_types[i].driver == NULL || hw_types[i].xdriver == NULL) { ++ LogMessage(X_INFO, "config/devd: ignoring device %s\n", ++ devname); ++ return; ++ } ++ ++ snprintf(path, sizeof(path), "/dev/%s", devname); ++ ++ options = input_option_new(NULL, "_source", "server/devd"); ++ if (!options) ++ return; ++ ++ vendor = sysctl_get_str("dev.%s.%s.%%desc", hw_types[i].driver, ++ devname + strlen(hw_types[i].driver)); ++ if (vendor == NULL) { ++ attrs.vendor = strdup("(unnamed)"); ++ attrs.product = strdup("(unnamed)"); ++ options = input_option_new(options, "name", devname); ++ } ++ else { ++ if ((walk = strchr(vendor, ' ')) != NULL) { ++ walk[0] = '\0'; ++ walk++; ++ product = walk; ++ if ((walk = strchr(product, ',')) != NULL) ++ walk[0] = '\0'; ++ } ++ ++ attrs.vendor = strdup(vendor); ++ if (product) ++ attrs.product = strdup(product); ++ else ++ attrs.product = strdup("(unnamed)"); ++ ++ options = input_option_new(options, "name", xstrdup(attrs.product)); ++ ++ free(vendor); ++ } ++ ++ /* XXX implement usb_id */ ++ attrs.usb_id = NULL; ++ attrs.device = strdup(path); ++ options = input_option_new(options, "driver", hw_types[i].xdriver); ++ ++ fd = open(path, O_RDONLY | O_NONBLOCK | O_EXCL); ++ if (fd > 0) { ++ close(fd); ++ options = input_option_new(options, "device", xstrdup(path)); ++ } ++ else { ++ /* ++ * Don't pass "device" option if the device is a keyboard and is ++ * already attached to the console (ie. open() fails). ++ * This would activate a special logic in xf86-input-keyboard. ++ */ ++ if (attrs.flags & ~ATTR_KEYBOARD) { ++ options = input_option_new(options, "device", xstrdup(path)); ++ } ++ LogMessage(X_WARNING, "config/devd: device %s already opened\n", ++ path); ++ } ++ ++ if (asprintf(&config_info, "devd:%s", devname) == -1) { ++ config_info = NULL; ++ goto unwind; ++ } ++ ++ if (device_is_duplicate(config_info)) { ++ LogMessage(X_WARNING, "config/devd: device %s (%s) already added. " ++ "Ignoring\n", attrs.product, path); ++ goto unwind; ++ } ++ ++ options = input_option_new(options, "config_info", config_info); ++ LogMessage(X_INFO, "config/devd: adding input device %s (%s)\n", ++ attrs.product, path); ++ ++ NewInputDeviceRequest(options, &attrs, &dev); ++ ++unwind: ++ free(config_info); ++ input_option_free_list(&options); ++ free(attrs.usb_id); ++ free(attrs.product); ++ free(attrs.device); ++ free(attrs.vendor); ++} ++ ++static void ++device_removed(char *devname) ++{ ++ char *value; ++ ++ if (asprintf(&value, "devd:%s", devname) == -1) ++ return; ++ ++ remove_devices("devd", value); ++ ++ free(value); ++} ++ ++static void ++disconnect_devd(int sock) ++{ ++ if (sock >= 0) { ++ RemoveGeneralSocket(sock); ++ close(sock); ++ } ++} ++ ++static int ++connect_devd(void) ++{ ++ struct sockaddr_un devd; ++ int sock; ++ ++ sock = socket(AF_UNIX, SOCK_STREAM, 0); ++ if (sock < 0) { ++ LogMessage(X_ERROR, "config/devd: fail opening stream socket\n"); ++ return -1; ++ } ++ ++ devd.sun_family = AF_UNIX; ++ strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path)); ++ ++ if (connect(sock, (struct sockaddr *) &devd, sizeof(devd)) < 0) { ++ close(sock); ++ LogMessage(X_ERROR, "config/devd: fail to connect to devd\n"); ++ return -1; ++ } ++ ++ AddGeneralSocket(sock); ++ ++ return sock; ++} ++ ++static CARD32 ++reconnect_handler(OsTimerPtr timer, CARD32 time, pointer arg) ++{ ++ int newsock; ++ ++ if ((newsock = connect_devd()) > 0) { ++ sock_devd = newsock; ++ TimerFree(rtimer); ++ rtimer = NULL; ++ LogMessage(X_INFO, "config/devd: reopening devd socket\n"); ++ return 0; ++ } ++ ++ /* try again after RECONNECT_DELAY */ ++ return RECONNECT_DELAY; ++} ++ ++static ssize_t ++socket_getline(int fd, char **out) ++{ ++ char *buf, *newbuf; ++ ssize_t ret, cap, sz = 0; ++ char c; ++ ++ cap = 1024; ++ buf = malloc(cap * sizeof(char)); ++ if (!buf) ++ return -1; ++ ++ for (;;) { ++ ret = read(sock_devd, &c, 1); ++ if (ret < 0) { ++ if (errno == EINTR) ++ continue; ++ free(buf); ++ return -1; ++ /* EOF - devd socket is lost */ ++ } else if (ret == 0) { ++ disconnect_devd(sock_devd); ++ rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL); ++ LogMessage(X_WARNING, "config/devd: devd socket is lost\n"); ++ return -1; ++ } ++ if (c == '\n') ++ break; ++ ++ if (sz + 1 >= cap) { ++ cap *= 2; ++ newbuf = realloc(buf, cap * sizeof(char)); ++ if (!newbuf) { ++ free(buf); ++ return -1; ++ } ++ buf = newbuf; ++ } ++ buf[sz] = c; ++ sz++; ++ } ++ ++ buf[sz] = '\0'; ++ if (sz >= 0) ++ *out = buf; ++ else ++ free(buf); ++ ++ /* number of bytes in the line, not counting the line break */ ++ return sz; ++} ++ ++static void ++wakeup_handler(void *data, int err, void *read_mask) ++{ ++ char *line = NULL; ++ char *walk; ++ ++ if (err < 0) ++ return; ++ ++ if (FD_ISSET(sock_devd, (fd_set *) read_mask)) { ++ if (socket_getline(sock_devd, &line) < 0) ++ return; ++ ++ walk = strchr(line + 1, ' '); ++ if (walk != NULL) ++ walk[0] = '\0'; ++ ++ switch (*line) { ++ case DEVD_EVENT_ADD: ++ device_added(line + 1); ++ break; ++ case DEVD_EVENT_REMOVE: ++ device_removed(line + 1); ++ break; ++ default: ++ break; ++ } ++ free(line); ++ } ++} ++ ++static void ++block_handler(void *data, struct timeval **tv, void *read_mask) ++{ ++} ++ ++int ++config_devd_init(void) ++{ ++ char devicename[1024]; ++ int i, j; ++ ++ for (i = 0; hw_types[i].driver != NULL; i++) { ++ /* first scan the sysctl to determine the hardware */ ++ for (j = 0; j < 16; j++) { ++ if (sysctl_exists(&hw_types[i], j, ++ devicename, sizeof(devicename)) != 0) ++ device_added(devicename); ++ } ++ ++ if (devpath_exists(&hw_types[i], devicename, sizeof(devicename)) != 0) ++ device_added(devicename); ++ } ++ ++ if ((sock_devd = connect_devd()) < 0) ++ return 0; ++ ++ RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); ++ ++ return 1; ++} ++ ++void ++config_devd_fini(void) ++{ ++ if (rtimer) { ++ TimerFree(rtimer); ++ rtimer = NULL; ++ } ++ ++ disconnect_devd(sock_devd); ++ ++ RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); ++} diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c new file mode 100644 index 0000000..b31e81d --- /dev/null +++ b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c @@ -0,0 +1,19 @@ +Index: hw/xfree86/common/xf86Config.c +@@ -1371,13 +1371,16 @@ + } + + if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) { +-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) ++#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \ ++ defined(CONFIG_DEVD) + const char *config_backend; + + #if defined(CONFIG_HAL) + config_backend = "HAL"; + #elif defined(CONFIG_UDEV) + config_backend = "udev"; ++#elif defined(CONFIG_DEVD) ++ config_backend = "devd"; + #else + config_backend = "wscons"; + #endif diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c new file mode 100644 index 0000000..a632daf --- /dev/null +++ b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c @@ -0,0 +1,11 @@ +Index: hw/xfree86/common/xf86Globals.c +@@ -122,7 +122,8 @@ + .log = LogNone, + .disableRandR = FALSE, + .randRFrom = X_DEFAULT, +-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) ++#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \ ++ defined(CONFIG_DEVD) + .forceInputDevices = FALSE, + .autoAddDevices = TRUE, + .autoEnableDevices = TRUE diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c b/x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c new file mode 100644 index 0000000..1d769f2 --- /dev/null +++ b/x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c @@ -0,0 +1,11 @@ +--- hw/xfree86/loader/loadmod.c.orig 2013-06-21 15:54:25.000000000 +0200 ++++ hw/xfree86/loader/loadmod.c 2013-06-21 15:55:09.000000000 +0200 +@@ -490,7 +490,7 @@ + char **elem; + const char **subdirs; + const char **s; +- PatternPtr patterns; ++ PatternPtr patterns = NULL; + PatternPtr p; + DIR *d; + struct dirent *dp; diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c b/x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c new file mode 100644 index 0000000..de9de4a --- /dev/null +++ b/x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c @@ -0,0 +1,29 @@ +From d1440783a7367ff0d0c47d256bbca3b3cf8a5034 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Tue, 29 Oct 2013 12:09:26 -0400 +Subject: xfree86: return NULL for compat output if no outputs. + +With outputless GPUs showing up we crash here if there are not outputs +try and recover with a bit of grace. + +Reviewed-by: Adam Jackson +Signed-off-by: Dave Airlie +Signed-off-by: Keith Packard + +diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c +index 2a02c85..a441fd1 100644 +--- hw/xfree86/modes/xf86Crtc.c ++++ hw/xfree86/modes/xf86Crtc.c +@@ -1863,6 +1863,9 @@ SetCompatOutput(xf86CrtcConfigPtr config) + DisplayModePtr maxmode = NULL, testmode, mode; + int o, compat = -1, count, mincount = 0; + ++ if (config->num_output == 0) ++ return NULL; ++ + /* Look for one that's definitely connected */ + for (o = 0; o < config->num_output; o++) { + test = config->output[o]; +-- +cgit v0.10.2 + diff --git a/x11-servers/xorg-server/files/patch-xkb_Makefile.in b/x11-servers/xorg-server/files/patch-xkb_Makefile.in index 934bef0..dc40e99 100644 --- a/x11-servers/xorg-server/files/patch-xkb_Makefile.in +++ b/x11-servers/xorg-server/files/patch-xkb_Makefile.in @@ -1,6 +1,5 @@ ---- xkb/Makefile.in.orig 2013-06-16 11:16:48.000000000 +0000 -+++ xkb/Makefile.in 2013-06-16 11:17:08.000000000 +0000 -@@ -816,7 +816,7 @@ +Index: xkb/Makefile.in +@@ -787,7 +787,7 @@ info-am: diff --git a/x11-servers/xorg-server/files/patch-xorgconf.cpp b/x11-servers/xorg-server/files/patch-xorgconf.cpp deleted file mode 100644 index 04e217b..0000000 --- a/x11-servers/xorg-server/files/patch-xorgconf.cpp +++ /dev/null @@ -1,14 +0,0 @@ ---- hw/xfree86/xorgconf.cpp.orig Fri Dec 31 14:40:27 2004 -+++ hw/xfree86/xorgconf.cpp Fri Dec 31 14:40:28 2004 -@@ -624,3 +624,11 @@ - InputDevice "Keyboard1" "CoreKeyboard" - EndSection - -+ -+XCOMM Two experimental extensions are available -- Composite and XEVIE. Uncomment -+XCOMM the section below to enable Composite. Many extensions can also be disabled -+XCOMM in this manner. -+ -+XCOMM Section "Extensions" -+XCOMM Option "Composite" "Enable" -+XCOMM EndSection diff --git a/x11-servers/xorg-server/pkg-plist b/x11-servers/xorg-server/pkg-plist index b893360..62612ed 100644 --- a/x11-servers/xorg-server/pkg-plist +++ b/x11-servers/xorg-server/pkg-plist @@ -12,13 +12,10 @@ include/xorg/BT.h include/xorg/IBM.h include/xorg/TI.h include/xorg/XIstubs.h -%%NEW%%include/xorg/Xprintf.h +include/xorg/Xprintf.h include/xorg/bt829.h -%%OLD%%include/xorg/bstore.h -%%OLD%%include/xorg/bstorestr.h -%%NEW%%include/xorg/callback.h -%%OLD%%include/xorg/cfb8_16.h -%%NEW%%include/xorg/client.h +include/xorg/callback.h +include/xorg/client.h include/xorg/closestr.h include/xorg/closure.h include/xorg/colormap.h @@ -61,14 +58,13 @@ include/xorg/geext.h include/xorg/geint.h include/xorg/globals.h include/xorg/glyphstr.h +include/xorg/glx_extinit.h include/xorg/hotplug.h include/xorg/i2c_def.h include/xorg/input.h include/xorg/inputstr.h -%%NEW%%include/xorg/list.h +include/xorg/list.h include/xorg/mi.h -%%OLD%%include/xorg/mibank.h -include/xorg/mibstore.h include/xorg/micmap.h include/xorg/micoord.h include/xorg/mifillarc.h @@ -82,15 +78,15 @@ include/xorg/misc.h include/xorg/miscstruct.h include/xorg/mispans.h include/xorg/mistruct.h -%%NEW%%include/xorg/misync.h -%%NEW%%include/xorg/misyncstr.h +include/xorg/misync.h +include/xorg/misyncstr.h include/xorg/miwideline.h include/xorg/mizerarc.h include/xorg/mioverlay.h include/xorg/msp3430.h include/xorg/opaque.h include/xorg/os.h -%%NEW%%include/xorg/optionstr.h +include/xorg/optionstr.h include/xorg/panoramiXsrv.h include/xorg/panoramiX.h include/xorg/picture.h @@ -102,7 +98,6 @@ include/xorg/property.h include/xorg/propertyst.h include/xorg/ptrveloc.h include/xorg/randrstr.h -%%OLD%%include/xorg/renderedge.h include/xorg/region.h include/xorg/regionstr.h include/xorg/registry.h @@ -120,7 +115,7 @@ include/xorg/shmint.h include/xorg/site.h include/xorg/swaprep.h include/xorg/swapreq.h -%%NEW%%include/xorg/syncsdk.h +include/xorg/syncsdk.h include/xorg/tda8425.h include/xorg/tda9850.h include/xorg/tda9885.h @@ -133,9 +128,6 @@ include/xorg/vidmodeproc.h include/xorg/wfbrename.h include/xorg/window.h include/xorg/windowstr.h -include/xorg/xaa.h -%%OLD%%include/xorg/xaaWrapper.h -include/xorg/xaalocal.h include/xorg/xaarop.h include/xorg/xace.h include/xorg/xacestr.h @@ -146,7 +138,7 @@ include/xorg/xf86DDC.h include/xorg/xf86Modes.h include/xorg/xf86Module.h include/xorg/xf86Opt.h -%%NEW%%include/xorg/xf86Optionstr.h +include/xorg/xf86Optionstr.h include/xorg/xf86Optrec.h include/xorg/xf86Parser.h include/xorg/xf86Pci.h @@ -165,6 +157,7 @@ include/xorg/xf86cmap.h include/xorg/xf86fbman.h include/xorg/xf86i2c.h include/xorg/xf86int10.h +include/xorg/xf86platformBus.h include/xorg/xf86sbusBus.h include/xorg/xf86str.h include/xorg/xf86xv.h @@ -181,54 +174,22 @@ include/xorg/xorgVersion.h include/xorg/xserver-properties.h include/xorg/xvdix.h include/xorg/xvmcext.h -lib/xorg/modules/extensions/libdbe.la -lib/xorg/modules/extensions/libdbe.so -lib/xorg/modules/extensions/libdri.la -lib/xorg/modules/extensions/libdri.so -lib/xorg/modules/extensions/libdri2.la -lib/xorg/modules/extensions/libdri2.so -lib/xorg/modules/extensions/libextmod.la -lib/xorg/modules/extensions/libextmod.so -lib/xorg/modules/extensions/librecord.la -lib/xorg/modules/extensions/librecord.so lib/xorg/modules/extensions/.xorg/libglx.so -lib/xorg/modules/libexa.la lib/xorg/modules/libexa.so -lib/xorg/modules/libfb.la lib/xorg/modules/libfb.so -%%NEW%%lib/xorg/modules/libfbdevhw.so -%%NEW%%lib/xorg/modules/libfbdevhw.la -lib/xorg/modules/libint10.la +lib/xorg/modules/libfbdevhw.so lib/xorg/modules/libint10.so -lib/xorg/modules/libshadow.la lib/xorg/modules/libshadow.so -lib/xorg/modules/libshadowfb.la lib/xorg/modules/libshadowfb.so -lib/xorg/modules/libvbe.la lib/xorg/modules/libvbe.so -lib/xorg/modules/libvgahw.la lib/xorg/modules/libvgahw.so -lib/xorg/modules/libwfb.la lib/xorg/modules/libwfb.so -lib/xorg/modules/libxaa.la -lib/xorg/modules/libxaa.so -%%OLD%%lib/xorg/modules/libxf8_16bpp.la -%%OLD%%lib/xorg/modules/libxf8_16bpp.so -%%OLD%%lib/xorg/modules/linux/libfbdevhw.la -%%OLD%%lib/xorg/modules/linux/libfbdevhw.so -lib/xorg/modules/multimedia/bt829_drv.la lib/xorg/modules/multimedia/bt829_drv.so -lib/xorg/modules/multimedia/fi1236_drv.la lib/xorg/modules/multimedia/fi1236_drv.so -lib/xorg/modules/multimedia/msp3430_drv.la lib/xorg/modules/multimedia/msp3430_drv.so -lib/xorg/modules/multimedia/tda8425_drv.la lib/xorg/modules/multimedia/tda8425_drv.so -lib/xorg/modules/multimedia/tda9850_drv.la lib/xorg/modules/multimedia/tda9850_drv.so -lib/xorg/modules/multimedia/tda9885_drv.la lib/xorg/modules/multimedia/tda9885_drv.so -lib/xorg/modules/multimedia/uda1380_drv.la lib/xorg/modules/multimedia/uda1380_drv.so lib/xorg/protocol.txt libdata/pkgconfig/xorg-server.pc @@ -239,15 +200,6 @@ man/man1/gtf.1.gz man/man4/exa.4.gz man/man4/fbdevhw.4.gz man/man5/xorg.conf.5.gz -%%NEW%%man/man5/xorg.conf.d.5.gz +man/man5/xorg.conf.d.5.gz share/aclocal/xorg-server.m4 -@comment %%NEW%%@dirrm share/doc/xorg-server -@dirrm include/xorg -@dirrm lib/xorg/modules/extensions/.xorg -@dirrm lib/xorg/modules/extensions -@dirrm lib/xorg/modules/multimedia -%%OLD%%@dirrm lib/xorg/modules/linux -@dirrm lib/xorg/modules -@dirrm lib/xorg -%%NEW%%@dirrmtry etc/X11/xorg.conf.d -%%NEW%%@dirrmtry etc/X11 +@dir etc/X11/xorg.conf.d