From 5e4e2bcd69edd5e98adb052bf95b9afe3b64c9d5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Jun 04 2012 07:37:57 +0000 Subject: Merge branch 'master' into f17 Conflicts: xorg-x11-server.spec --- diff --git a/.gitignore b/.gitignore index 39afc54..0ef7a52 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ xorg-server-1.9.1.tar.bz2 /xorg-server-20120124.tar.xz /xorg-server-20120215.tar.xz /xorg-server-1.12.0.tar.bz2 +/xorg-server-1.12.1.tar.bz2 +/xorg-server-1.12.2.tar.bz2 diff --git a/sources b/sources index 6681ac7..7ad7c27 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3a3c4281f32c8702749e8f129372a355 xorg-server-1.12.0.tar.bz2 +791f0323b886abb7954de7f042bb7dc6 xorg-server-1.12.2.tar.bz2 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f9049f0..2179db3 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -47,8 +47,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.12.0 -Release: 5%{?gitdate:.%{gitdate}}%{dist} +Version: 1.12.2 +Release: 1%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -95,15 +95,14 @@ Patch6027: xserver-1.6.0-displayfd.patch Patch6030: xserver-1.6.99-right-of.patch #Patch6044: xserver-1.6.99-hush-prerelease-warning.patch -# tests require Xorg -Patch7007: xserver-1.10.99.1-test.patch - # Fix libselinux-triggered build error # RedHat/Fedora-specific patch Patch7013: xserver-1.12-Xext-fix-selinux-build-failure.patch -# 814869, fix from upstream 1.12 branch -Patch7014: xserver-1.12-os-make-timers-signal-safe.patch +# backport pci slot claiming fix for kms drivers +Patch7015: xserver-fix-pci-slot-claims.patch +# backport modesetting fallback driver +Patch7016: xserver-1.12-modesetting-fallback.patch %define moduledir %{_libdir}/xorg/modules %define drimoduledir %{_libdir}/dri @@ -192,6 +191,14 @@ Obsoletes: xorg-x11-drv-fpit <= 1.4.0-2.fc16 Obsoletes: xorg-x11-drv-hyperpen <= 1.4.1-2.fc16 Obsoletes: xorg-x11-drv-mutouch <= 1.3.0-2.fc16 Obsoletes: xorg-x11-drv-penmount <= 1.5.0-3.fc16 +%if 0%{?fedora} > 17 +# Dropped from F18, use a video card instead +Obsoletes: xorg-x11-drv-ark <= 0.7.3-15.fc17 +Obsoletes: xorg-x11-drv-chips <= 1.2.4-8.fc18 +Obsoletes: xorg-x11-drv-s3 <= 0.6.3-14.fc17 +Obsoletes: xorg-x11-drv-tseng <= 1.2.4-12.fc17 +%endif + Requires: xorg-x11-server-common >= %{version}-%{release} Requires: system-setup-keyboard @@ -361,7 +368,7 @@ test `getminor extension` == %{extension_minor} %endif # --with-pie ? -autoreconf -v --install || exit 1 +autoreconf -f -v --install || exit 1 # export CFLAGS="${RPM_OPT_FLAGS}" %configure --enable-maintainer-mode %{xservers} \ --disable-static \ @@ -566,12 +573,31 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog -* Mon May 14 2012 Peter Hutterer 1.12.0-5 +* Wed May 30 2012 Peter Hutterer 1.12.2-1 +- xserver 1.12.2 + +* Fri May 25 2012 Dave Airlie 1.12.1-2 +- xserver-fix-pci-slot-claims.patch: backport slot claiming fix from master +- xserver-1.12-modesetting-fallback.patch: add modesetting to fallback list + +* Mon May 14 2012 Peter Hutterer +- Drop xserver-1.10.99.1-test.patch: + cd89482088f71ed517c2e88ed437e4752070c3f4 fixed it + +* Mon May 14 2012 Peter Hutterer 1.12.1-1 +- server 1.12.1 +- force autoreconf to avoid libtool errors +- update patches for new indentation style. + +* Mon May 14 2012 Peter Hutterer 1.12.0-6 - Make timers signal-safe (#814869) -* Sun May 13 2012 Dennis Gilmore 1.12.0-4 +* Sun May 13 2012 Dennis Gilmore 1.12.0-5 - enable vbe on arm arches +* Thu Apr 26 2012 Adam Jackson 1.12.0-4 +- Obsolete some old video drivers in F18+ + * Wed Mar 21 2012 Adam Jackson 1.12.0-3 - Tweak arches for RHEL diff --git a/xserver-1.10.99.1-test.patch b/xserver-1.10.99.1-test.patch deleted file mode 100644 index 8d704c3..0000000 --- a/xserver-1.10.99.1-test.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 56a6a585918f1aa84da244dec803783cd90b92ac Mon Sep 17 00:00:00 2001 -From: Dan HorĂ¡k -Date: Wed, 29 Jun 2011 15:08:27 +0200 -Subject: [PATCH] test subdir requires xorg to be built - -Something changed between 20110418 and 20110510 and the test subdir is now -processed. But it needs some libraries that are built as part of xorg driver. ---- - Makefile.am | 5 +++-- - 1 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 62c8d95..bc4091d 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -38,8 +38,7 @@ SUBDIRS = \ - $(GLX_DIR) \ - exa \ - config \ -- hw \ -- test -+ hw - - if XORG - aclocaldir = $(datadir)/aclocal -@@ -47,6 +46,8 @@ aclocal_DATA = xorg-server.m4 - - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = xorg-server.pc -+ -+SUBDIRS += test - endif - - EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh --- -1.7.4.4 - diff --git a/xserver-1.12-Xext-fix-selinux-build-failure.patch b/xserver-1.12-Xext-fix-selinux-build-failure.patch index e92a462..a48a013 100644 --- a/xserver-1.12-Xext-fix-selinux-build-failure.patch +++ b/xserver-1.12-Xext-fix-selinux-build-failure.patch @@ -1,7 +1,7 @@ -From 080b3903ee57a682ac67306d7ff855bbf1dccda3 Mon Sep 17 00:00:00 2001 +From 5d16c39108c72b08478b6bd548494d6c675495ee Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 4 Jan 2012 09:31:51 +1000 -Subject: [PATCH] Xext: fix selinux build failure +Subject: [PATCH 6/7] Xext: fix selinux build failure The server builds with -Werror=missing-braces, causing @@ -22,31 +22,31 @@ Signed-off-by: Peter Hutterer 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c -index 0d4c9ab..943e5cc 100644 +index e9c7e93..0302f2f 100644 --- a/Xext/xselinux_hooks.c +++ b/Xext/xselinux_hooks.c -@@ -848,7 +848,7 @@ SELinuxFlaskReset(void) +@@ -851,7 +851,7 @@ SELinuxFlaskReset(void) void SELinuxFlaskInit(void) { -- struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *)0 }; -+ struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, { (char *)0 } }; +- struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 }; ++ struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, { (char *) 0 } }; security_context_t ctx; int ret = TRUE; diff --git a/Xext/xselinux_label.c b/Xext/xselinux_label.c -index e5929fa..de49f83 100644 +index 2c33d1c..81f2f36 100644 --- a/Xext/xselinux_label.c +++ b/Xext/xselinux_label.c -@@ -354,7 +354,7 @@ SELinuxDefaultClientLabel(void) +@@ -361,7 +361,7 @@ SELinuxDefaultClientLabel(void) void SELinuxLabelInit(void) { -- struct selinux_opt selabel_option = { SELABEL_OPT_VALIDATE, (char *)1 }; +- struct selinux_opt selabel_option = { SELABEL_OPT_VALIDATE, (char *) 1 }; + struct selinux_opt selabel_option = { SELABEL_OPT_VALIDATE, { (char *)1 } }; label_hnd = selabel_open(SELABEL_CTX_X, &selabel_option, 1); if (!label_hnd) -- -1.7.7.4 +1.7.10.1 diff --git a/xserver-1.12-modesetting-fallback.patch b/xserver-1.12-modesetting-fallback.patch new file mode 100644 index 0000000..2808d9f --- /dev/null +++ b/xserver-1.12-modesetting-fallback.patch @@ -0,0 +1,32 @@ +From a2a02882ab65133e6c0c69db1f38bc20b406236f Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Sun, 6 May 2012 17:35:34 +0100 +Subject: [PATCH] xfree86: add modesetting driver to fallback list on Linux + +Add the modesetting driver to the fallback list on Linux, after vesa +before fbdev. + +Acked-by: Peter Hutterer +Signed-off-by: Dave Airlie +--- + hw/xfree86/common/xf86AutoConfig.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c +index 43c746b..d0eb0af 100644 +--- a/hw/xfree86/common/xf86AutoConfig.c ++++ b/hw/xfree86/common/xf86AutoConfig.c +@@ -270,6 +270,10 @@ listPossibleVideoDrivers(char *matches[], int nmatches) + #endif + } + ++#if defined(__linux__) ++ matches[i++] = xnfstrdup("modesetting"); ++#endif ++ + #if !defined(sun) + /* Fallback to platform default frame buffer driver */ + if (i < (nmatches - 1)) { +-- +1.7.7.6 + diff --git a/xserver-1.4.99-ssh-isnt-local.patch b/xserver-1.4.99-ssh-isnt-local.patch index d0b95a0..2d33bed 100644 --- a/xserver-1.4.99-ssh-isnt-local.patch +++ b/xserver-1.4.99-ssh-isnt-local.patch @@ -1,22 +1,22 @@ -From a02009f81a8ee019b0642716eb68475c75eca5ec Mon Sep 17 00:00:00 2001 +From 66a3b14e118e90db80f96fcab52af4df35bc2377 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Dec 2007 11:26:57 -0500 Subject: [PATCH] Hack for proper MIT-SHM rejection for ssh-forwarded clients. --- Xext/shm.c | 16 ++++++++++++++++ - 1 files changed, 16 insertions(+), 0 deletions(-) + 1 file changed, 16 insertions(+) diff --git a/Xext/shm.c b/Xext/shm.c -index 23afe6b..1e2f9f5 100644 +index de48020..c011210 100644 --- a/Xext/shm.c +++ b/Xext/shm.c -@@ -325,8 +325,21 @@ shm_access(ClientPtr client, SHMPERM_TYPE *perm, int readonly) +@@ -321,8 +321,21 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly) mode_t mask; int uidset = 0, gidset = 0; LocalClientCredRec *lcc; + Bool is_ssh = FALSE; - + if (GetLocalClientCreds(client, &lcc) != -1) { +#ifdef linux + if (lcc->fieldsSet & LCC_PID_SET) { @@ -31,18 +31,18 @@ index 23afe6b..1e2f9f5 100644 + } +#endif - if (lcc->fieldsSet & LCC_UID_SET) { - uid = lcc->euid; -@@ -345,6 +358,9 @@ shm_access(ClientPtr client, SHMPERM_TYPE *perm, int readonly) - } + if (lcc->fieldsSet & LCC_UID_SET) { + uid = lcc->euid; +@@ -342,6 +355,9 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly) #endif - FreeLocalClientCreds(lcc); + FreeLocalClientCreds(lcc); + ++ if (is_ssh) ++ return -1; + -+ if (is_ssh) -+ return -1; - - if (uidset) { - /* User id 0 always gets access */ + if (uidset) { + /* User id 0 always gets access */ + if (uid == 0) { -- -1.7.3.2 +1.7.10.1 diff --git a/xserver-1.6.0-displayfd.patch b/xserver-1.6.0-displayfd.patch index 1eec93a..9e63767 100644 --- a/xserver-1.6.0-displayfd.patch +++ b/xserver-1.6.0-displayfd.patch @@ -1,20 +1,35 @@ -From 47d4a39c0c82d45b8e0eada36d14c233dbb1cff2 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 18 Jun 2009 16:56:41 +1000 -Subject: [PATCH] displayfd hack +From 247319fe3750671cd962df2c12548affb0351775 Mon Sep 17 00:00:00 2001 +From: Chase Douglas +Date: Wed, 4 Apr 2012 15:29:42 -0700 +Subject: [PATCH 3/7] os: Add -displayfd option +This option specifies a file descriptor in the launching process. X +will scan for an available display number and write that number back to +the launching process, at the same time as SIGUSR1 generation. This +means display managers don't need to guess at available display numbers. +As a consequence, if X fails to start when using -displayfd, it's not +because the display was in use, so there's no point in retrying the X +launch on a higher display number. + +Signed-off-by: Adam Jackson +Signed-off-by: Chase Douglas +Reviewed-by: Julien Cristau +Tested-by: Julien Cristau +Reviewed-by: Alan Coopersmith +Signed-off-by: Peter Hutterer --- dix/globals.c | 1 + include/opaque.h | 1 + - os/connection.c | 73 +++++++++++++++++++++++++++++++++++++----------------- - os/utils.c | 11 ++++++++ - 4 files changed, 63 insertions(+), 23 deletions(-) + man/Xserver.man | 7 ++++++ + os/connection.c | 68 ++++++++++++++++++++++++++++++++++++++---------------- + os/utils.c | 9 ++++++++ + 5 files changed, 66 insertions(+), 20 deletions(-) diff --git a/dix/globals.c b/dix/globals.c -index 0a6b170..0ee83c0 100644 +index c0cae15..db113ca 100644 --- a/dix/globals.c +++ b/dix/globals.c -@@ -126,6 +126,7 @@ int defaultColorVisualClass = -1; +@@ -128,6 +128,7 @@ int defaultColorVisualClass = -1; int monitorResolution = 0; char *display; @@ -23,7 +38,7 @@ index 0a6b170..0ee83c0 100644 CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; diff --git a/include/opaque.h b/include/opaque.h -index 5c70717..f23203f 100644 +index 9ca408a..b76ab6e 100644 --- a/include/opaque.h +++ b/include/opaque.h @@ -50,6 +50,7 @@ extern _X_EXPORT int ScreenSaverAllowExposures; @@ -34,27 +49,48 @@ index 5c70717..f23203f 100644 extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; +diff --git a/man/Xserver.man b/man/Xserver.man +index 0cd9b94..8d243d6 100644 +--- a/man/Xserver.man ++++ b/man/Xserver.man +@@ -127,6 +127,13 @@ Not obeyed by all servers. + .B \-core + causes the server to generate a core dump on fatal errors. + .TP 8 ++.B \-displayfd \fIfd\fP ++specifies a file descriptor in the launching process. Rather than specify ++a display number, the X server will attempt to listen on successively higher ++display numbers, and upon finding a free one, will write the port number back ++on this file descriptor as a newline-terminated string. The \-pn option is ++ignored when using \-displayfd. ++.TP 8 + .B \-deferglyphs \fIwhichfonts\fP + specifies the types of fonts for which the server should attempt to use + deferred glyph loading. \fIwhichfonts\fP can be all (all fonts), diff --git a/os/connection.c b/os/connection.c -index 8a677a7..fea227a 100644 +index 1099752..039942f 100644 --- a/os/connection.c +++ b/os/connection.c -@@ -145,6 +145,7 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ - static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ - Bool RunFromSigStopParent; /* send SIGSTOP to our own process; Upstart (or - equivalent) will send SIGCONT back. */ -+static char dynamic_display[7]; - Bool PartialNetwork; /* continue even if unable to bind all addrs */ +@@ -142,6 +142,7 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ + static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ + Bool RunFromSigStopParent; /* send SIGSTOP to our own process; Upstart (or + equivalent) will send SIGCONT back. */ ++static char dynamic_display[7]; /* display name */ + Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; -@@ -356,11 +357,26 @@ NotifyParentProcess(void) - kill (ParentProcess, SIGUSR1); - } - } -+ if (dynamic_display[0]) -+ write(displayfd, dynamic_display, strlen(dynamic_display)); -+ - if (RunFromSigStopParent) - raise (SIGSTOP); +@@ -350,6 +351,10 @@ void + NotifyParentProcess(void) + { + #if !defined(WIN32) ++ if (dynamic_display[0]) { ++ write(displayfd, dynamic_display, strlen(dynamic_display)); ++ close(displayfd); ++ } + if (RunFromSmartParent) { + if (ParentProcess > 1) { + kill(ParentProcess, SIGUSR1); +@@ -360,6 +365,18 @@ NotifyParentProcess(void) #endif } @@ -63,113 +99,105 @@ index 8a677a7..fea227a 100644 +{ + char port[20]; + -+ snprintf (port, sizeof(port), "%d", num); ++ snprintf(port, sizeof(port), "%d", num); + -+ return _XSERVTransMakeAllCOTSServerListeners(port, partial, -+ &ListenTransCount, -+ &ListenTransConns); ++ return (_XSERVTransMakeAllCOTSServerListeners(port, partial, ++ &ListenTransCount, ++ &ListenTransConns) >= 0); +} + /***************** * CreateWellKnownSockets * At initialization, create the sockets to listen on for new clients. -@@ -371,7 +387,6 @@ CreateWellKnownSockets(void) +@@ -370,7 +387,6 @@ CreateWellKnownSockets(void) { - int i; - int partial; -- char port[20]; + int i; + int partial; +- char port[20]; FD_ZERO(&AllSockets); FD_ZERO(&AllClients); -@@ -386,32 +401,44 @@ CreateWellKnownSockets(void) +@@ -386,29 +402,41 @@ CreateWellKnownSockets(void) - FD_ZERO (&WellKnownConnections); + FD_ZERO(&WellKnownConnections); -- snprintf (port, sizeof(port), "%d", atoi (display)); +- snprintf(port, sizeof(port), "%d", atoi(display)); - -- if ((_XSERVTransMakeAllCOTSServerListeners (port, &partial, -- &ListenTransCount, &ListenTransConns) >= 0) && -- (ListenTransCount >= 1)) -+ if (display) - { -- if (!PartialNetwork && partial) -- { -- FatalError ("Failed to establish all listening sockets"); -- } -- else -+ if (TryCreateSocket(atoi(display), &partial) && -+ (ListenTransCount >= 1)) -+ if (!PartialNetwork && partial) -+ FatalError ("Failed to establish all listening sockets"); +- if ((_XSERVTransMakeAllCOTSServerListeners(port, &partial, +- &ListenTransCount, +- &ListenTransConns) >= 0) && +- (ListenTransCount >= 1)) { +- if (!PartialNetwork && partial) { +- FatalError("Failed to establish all listening sockets"); ++ /* display is initialized to "0" by main(). It is then set to the display ++ * number if specified on the command line, or to NULL when the -displayfd ++ * option is used. */ ++ if (display) { ++ if (TryCreateSocket(atoi(display), &partial) && ++ ListenTransCount >= 1) ++ if (!PartialNetwork && partial) ++ FatalError ("Failed to establish all listening sockets"); + } -+ else /* -displayfd */ -+ { -+ Bool found = 0; -+ for (i = 0; i < 65535 - 1024; i++) - { -- ListenTransFds = malloc(ListenTransCount * sizeof (int)); -- -- for (i = 0; i < ListenTransCount; i++) -+ if (!TryCreateSocket(i, &partial) && !partial) - { -- int fd = _XSERVTransGetConnectionNumber (ListenTransConns[i]); -- -- ListenTransFds[i] = fd; -- FD_SET (fd, &WellKnownConnections); -- -- if (!_XSERVTransIsLocal (ListenTransConns[i])) -- { -- DefineSelf (fd); -- } -+ found = 1; -+ break; - } -+ else -+ CloseWellKnownConnections(); -+ } -+ if (!found) -+ FatalError("Failed to find a socket to listen on"); -+ sprintf(dynamic_display, "%d\n", i); -+ display = dynamic_display; ++ else { /* -displayfd */ ++ Bool found = 0; ++ for (i = 0; i < 65535 - X_TCP_PORT; i++) { ++ if (TryCreateSocket(i, &partial) && !partial) { ++ found = 1; ++ break; ++ } ++ else ++ CloseWellKnownConnections(); + } +- else { +- ListenTransFds = malloc(ListenTransCount * sizeof(int)); ++ if (!found) ++ FatalError("Failed to find a socket to listen on"); ++ snprintf(dynamic_display, sizeof(dynamic_display), "%d", i); ++ display = dynamic_display; + } + +- for (i = 0; i < ListenTransCount; i++) { +- int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); ++ ListenTransFds = malloc(ListenTransCount * sizeof (int)); + +- ListenTransFds[i] = fd; +- FD_SET(fd, &WellKnownConnections); ++ for (i = 0; i < ListenTransCount; i++) { ++ int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); + +- if (!_XSERVTransIsLocal(ListenTransConns[i])) { +- DefineSelf(fd); +- } +- } +- } ++ ListenTransFds[i] = fd; ++ FD_SET(fd, &WellKnownConnections); + -+ ListenTransFds = xalloc (ListenTransCount * sizeof (int)); -+ -+ for (i = 0; i < ListenTransCount; i++) -+ { -+ int fd = _XSERVTransGetConnectionNumber (ListenTransConns[i]); -+ -+ ListenTransFds[i] = fd; -+ FD_SET (fd, &WellKnownConnections); -+ -+ if (!_XSERVTransIsLocal (ListenTransConns[i])) -+ { -+ DefineSelf (fd); - } ++ if (!_XSERVTransIsLocal(ListenTransConns[i])) ++ DefineSelf (fd); } + if (!XFD_ANYSET(&WellKnownConnections)) diff --git a/os/utils.c b/os/utils.c -index 6461ed5..17860df 100644 +index 30592d2..3a1ef93 100644 --- a/os/utils.c +++ b/os/utils.c -@@ -661,6 +661,17 @@ ProcessCommandLine(int argc, char *argv[]) - else - UseMsg(); - } -+ else if (strcmp(argv[i], "-displayfd") == 0) -+ { -+ if (++i < argc) -+ { -+ displayfd = atoi(argv[i]); -+ display = NULL; -+ nolock = TRUE; -+ } -+ else -+ UseMsg(); -+ } +@@ -659,6 +659,15 @@ ProcessCommandLine(int argc, char *argv[]) + else + UseMsg(); + } ++ else if (strcmp(argv[i], "-displayfd") == 0) { ++ if (++i < argc) { ++ displayfd = atoi(argv[i]); ++ display = NULL; ++ nolock = TRUE; ++ } ++ else ++ UseMsg(); ++ } #ifdef DPMSExtension - else if ( strcmp( argv[i], "dpms") == 0) - /* ignored for compatibility */ ; + else if (strcmp(argv[i], "dpms") == 0) + /* ignored for compatibility */ ; -- -1.7.7.4 +1.7.10.1 diff --git a/xserver-1.6.0-less-acpi-brokenness.patch b/xserver-1.6.0-less-acpi-brokenness.patch index 41e6ff3..b42c2d7 100644 --- a/xserver-1.6.0-less-acpi-brokenness.patch +++ b/xserver-1.6.0-less-acpi-brokenness.patch @@ -1,18 +1,18 @@ -From 392ce7dc5062416a8cf1c9a66e0dce1677f46804 Mon Sep 17 00:00:00 2001 +From 0002cde5312e785529b2901d7f8a82d5623e4ca7 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 9 Nov 2011 11:52:06 +1000 -Subject: [PATCH] Don't build the ACPI code. +Subject: [PATCH 2/7] Don't build the ACPI code. No good can come of this. --- configure.ac | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) + 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 63d59f9..6683005 100644 +index a12783c..54f4464 100644 --- a/configure.ac +++ b/configure.ac -@@ -1624,7 +1624,6 @@ if test "x$XORG" = xyes; then +@@ -1620,7 +1620,6 @@ if test "x$XORG" = xyes; then linux_alpha=yes ;; i*86|amd64*|x86_64*|ia64*) @@ -21,5 +21,5 @@ index 63d59f9..6683005 100644 *) ;; -- -1.7.7 +1.7.10.1 diff --git a/xserver-1.6.99-right-of.patch b/xserver-1.6.99-right-of.patch index a0c9e7f..f6cd6e3 100644 --- a/xserver-1.6.99-right-of.patch +++ b/xserver-1.6.99-right-of.patch @@ -1,20 +1,20 @@ -From 12aa6574fd87ec28186a75256a5111e9703d932e Mon Sep 17 00:00:00 2001 +From d91c3a11db2657e33087464463c9aa44aaf5c8b8 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 28 Jul 2009 11:07:13 -0400 -Subject: [PATCH 4/9] RANDR: right-of placement by default +Subject: [PATCH 4/7] RANDR: right-of placement by default [Enhanced to add a new prefer clone option for drivers. This allows for servers like RN50 where two heads are disjoint. - airlied] --- - hw/xfree86/common/xf86str.h | 9 ++++- - hw/xfree86/modes/xf86Crtc.c | 74 ++++++++++++++++++++++++++++++++++++++---- - 2 files changed, 74 insertions(+), 9 deletions(-) + hw/xfree86/common/xf86str.h | 8 ++++- + hw/xfree86/modes/xf86Crtc.c | 76 ++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h -index 0493dc5..d66e373 100644 +index 6294845..7d1fbab 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h -@@ -496,10 +496,13 @@ typedef struct _confdrirec { +@@ -497,10 +497,13 @@ typedef struct _confdrirec { } confDRIRec, *confDRIPtr; /* These values should be adjusted when new fields are added to ScrnInfoRec */ @@ -26,20 +26,12 @@ index 0493dc5..d66e373 100644 +/* let clients know they can use this */ +#define XF86_SCRN_HAS_PREFER_CLONE 1 + - typedef pointer (*funcPointer)(void); + typedef pointer (*funcPointer) (void); /* flags for depth 24 pixmap options */ -@@ -659,7 +662,6 @@ typedef void xf86ModeSetProc (ScrnInfoPtr); - * are to be dependent on compile-time defines. - */ - -- - typedef struct _ScrnInfoRec { - int driverVersion; - char * driverName; /* canonical name used in */ -@@ -761,6 +763,9 @@ typedef struct _ScrnInfoRec { - ClockRangePtr clockRanges; - int adjustFlags; +@@ -758,6 +761,9 @@ typedef struct _ScrnInfoRec { + ClockRangePtr clockRanges; + int adjustFlags; + /* initial rightof support disable */ + int preferClone; @@ -48,26 +40,26 @@ index 0493dc5..d66e373 100644 * These can be used when the minor ABI version is incremented. * The NUM_* parameters must be reduced appropriately to keep the diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index c2814d4..b25876f 100644 +index 6d5e92f..7d560f4 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c -@@ -1139,6 +1139,15 @@ xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) - int o; - int min_x, min_y; - +@@ -1114,6 +1114,15 @@ xf86InitialOutputPositions(ScrnInfoPtr scrn, DisplayModePtr * modes) + int o; + int min_x, min_y; + + /* check for initial right-of heuristic */ + for (o = 0; o < config->num_output; o++) + { -+ xf86OutputPtr output = config->output[o]; ++ xf86OutputPtr output = config->output[o]; + -+ if (output->initial_x || output->initial_y) ++ if (output->initial_x || output->initial_y) + return TRUE; + } + - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; -@@ -2030,6 +2039,57 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) + for (o = 0; o < config->num_output; o++) { + xf86OutputPtr output = config->output[o]; + +@@ -1982,6 +1991,57 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) return match; } @@ -83,40 +75,40 @@ index c2814d4..b25876f 100644 + +static Bool +xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, -+ DisplayModePtr *modes, Bool *enabled, -+ int width, int height) ++ DisplayModePtr *modes, Bool *enabled, ++ int width, int height) +{ + int o; + int w = 0; + + if (scrn->preferClone) -+ return FALSE; ++ return FALSE; + + if (numEnabledOutputs(config, enabled) < 2) -+ return FALSE; ++ return FALSE; + + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { -+ DisplayModePtr mode = -+ xf86OutputHasPreferredMode(config->output[o], width, height); ++ DisplayModePtr mode = ++ xf86OutputHasPreferredMode(config->output[o], width, height); + -+ if (!mode) -+ return FALSE; ++ if (!mode) ++ return FALSE; + -+ w += mode->HDisplay; ++ w += mode->HDisplay; + } + + if (w > width) -+ return FALSE; ++ return FALSE; + + w = 0; + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { -+ DisplayModePtr mode = -+ xf86OutputHasPreferredMode(config->output[o], width, height); ++ DisplayModePtr mode = ++ xf86OutputHasPreferredMode(config->output[o], width, height); + -+ config->output[o]->initial_x = w; -+ w += mode->HDisplay; ++ config->output[o]->initial_x = w; ++ w += mode->HDisplay; + -+ modes[o] = mode; ++ modes[o] = mode; + } + + return TRUE; @@ -124,44 +116,46 @@ index c2814d4..b25876f 100644 + static Bool xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, -@@ -2087,13 +2147,9 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - * biggest mode for its aspect ratio, assuming one exists. + DisplayModePtr * modes, Bool *enabled, +@@ -2058,13 +2118,9 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, */ - if (!ret) do { -- int i = 0; - float aspect = 0.0; + if (!ret) + do { +- int i = 0; + float aspect = 0.0; -- /* count the number of enabled outputs */ -- for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ; +- /* count the number of enabled outputs */ +- for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++); - -- if (i != 1) -+ if (numEnabledOutputs(config, enabled) != 1) - break; +- if (i != 1) ++ if (numEnabledOutputs(config, enabled) != 1) + break; - p = -1; -@@ -2388,6 +2444,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) - } else { - if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); -+ else if (xf86TargetRightOf(scrn, config, modes, enabled, width, height)) -+ xf86DrvMsg(i, X_INFO, "Using spanning desktop for initial modes\n"); - else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); - else if (xf86TargetAspect(scrn, config, modes, enabled, width, height)) -@@ -2405,8 +2463,10 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) - config->output[o]->name); - else - xf86DrvMsg (scrn->scrnIndex, X_INFO, -- "Output %s using initial mode %s\n", -- config->output[o]->name, modes[o]->name); -+ "Output %s using initial mode %s +%d+%d\n", -+ config->output[o]->name, modes[o]->name, + p = -1; +@@ -2365,6 +2421,8 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) + else { + if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) + xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); ++ else if (xf86TargetRightOf(scrn, config, modes, enabled, width, height)) ++ xf86DrvMsg(i, X_INFO, "Using spanning desktop for initial modes\n"); + else if (xf86TargetPreferred + (scrn, config, modes, enabled, width, height)) + xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); +@@ -2384,9 +2442,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) + "Output %s enabled but has no modes\n", + config->output[o]->name); + else +- xf86DrvMsg(scrn->scrnIndex, X_INFO, +- "Output %s using initial mode %s\n", +- config->output[o]->name, modes[o]->name); ++ xf86DrvMsg (scrn->scrnIndex, X_INFO, ++ "Output %s using initial mode %s +%d+%d\n", ++ config->output[o]->name, modes[o]->name, + config->output[o]->initial_x, + config->output[o]->initial_y); } /* -- -1.7.4.4 +1.7.10.1 diff --git a/xserver-fix-pci-slot-claims.patch b/xserver-fix-pci-slot-claims.patch new file mode 100644 index 0000000..cac27f2 --- /dev/null +++ b/xserver-fix-pci-slot-claims.patch @@ -0,0 +1,143 @@ +From 39f73e813f7d404498629f6104a9003d092af28d Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Tue, 8 May 2012 13:01:12 +0100 +Subject: [PATCH] xf86/pci: fix slot claiming counting. + +Currently if we claim a slot for a PCI driver, we never let it go properly, +this prevents the fallback probe from reusing the slot, even though it +isn't claimed for that pci slot. + +So if you set the modesetting driver to point at a specific kms device, +that isn't a PCI device (i.e. USB dongle), then the modesetting driver +loads, the pci probe tries to bind the config slot to the primary PCI +device, however we then check the kms device bus id to discover it +isn't valid. However we don't remove the claim on the slot. Next the +old probe function is called and there is no slots to claim. + +This patch fixes that and converts the pciSlotClaimed boolean into +a counter, and changes the unclaim api to take a device pointer +to remove from the entity. + +Reviewed-by: Adam Jackson +Signed-off-by: Dave Airlie +--- + hw/xfree86/common/xf86.h | 4 ++-- + hw/xfree86/common/xf86Bus.c | 20 ++++++++++++++++++++ + hw/xfree86/common/xf86Priv.h | 1 + + hw/xfree86/common/xf86pciBus.c | 10 ++++++---- + 4 files changed, 29 insertions(+), 6 deletions(-) + +diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h +index fc4c34e..e6d41d6 100644 +--- a/hw/xfree86/common/xf86.h ++++ b/hw/xfree86/common/xf86.h +@@ -97,12 +97,12 @@ extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ + /* PCI related */ + #ifdef XSERVER_LIBPCIACCESS + #include +-extern _X_EXPORT Bool pciSlotClaimed; ++extern _X_EXPORT int pciSlotClaimed; + + extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *); + extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp, + int chipset, GDevPtr dev, Bool active); +-extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *); ++extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev); + extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus, + int *device, int *func); + extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus, +diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +index b176e8c..b876434 100644 +--- a/hw/xfree86/common/xf86Bus.c ++++ b/hw/xfree86/common/xf86Bus.c +@@ -420,6 +420,26 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev) + dev->claimed = TRUE; + } + ++ ++void ++xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev) ++{ ++ EntityPtr pEnt; ++ int i, j; ++ if (entityIndex >= xf86NumEntities) ++ return; ++ ++ pEnt = xf86Entities[entityIndex]; ++ for (i = 0; i < pEnt->numInstances; i++) { ++ if (pEnt->devices[i] == dev) { ++ for (j = i; j < pEnt->numInstances - 1; j++) ++ pEnt->devices[j] = pEnt->devices[j + 1]; ++ break; ++ } ++ } ++ pEnt->numInstances--; ++ dev->claimed = FALSE; ++} + /* + * xf86GetEntityInfo() -- This function hands information from the + * EntityRec struct to the drivers. The EntityRec structure itself +diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h +index 8d9cb55..6c5efea 100644 +--- a/hw/xfree86/common/xf86Priv.h ++++ b/hw/xfree86/common/xf86Priv.h +@@ -116,6 +116,7 @@ extern _X_EXPORT void xf86AccessLeave(void); + extern _X_EXPORT void xf86PostProbe(void); + extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex); + extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); ++extern _X_EXPORT void xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev); + + /* xf86Config.c */ + +diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c +index e52f1da..d758260 100644 +--- a/hw/xfree86/common/xf86pciBus.c ++++ b/hw/xfree86/common/xf86pciBus.c +@@ -52,7 +52,7 @@ + #define PCI_VENDOR_GENERIC 0x00FF + + /* Bus-specific globals */ +-Bool pciSlotClaimed = FALSE; ++int pciSlotClaimed = 0; + + #define PCIINFOCLASSES(c) \ + ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \ +@@ -223,7 +223,7 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp, + p->inUse = FALSE; + if (dev) + xf86AddDevToEntity(num, dev); +- pciSlotClaimed = TRUE; ++ pciSlotClaimed++; + + return num; + } +@@ -235,7 +235,7 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp, + * Unclaim PCI slot, e.g. if probing failed, so that a different driver can claim. + */ + void +-xf86UnclaimPciSlot(struct pci_device *d) ++xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev) + { + int i; + +@@ -244,6 +244,8 @@ xf86UnclaimPciSlot(struct pci_device *d) + + if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) { + /* Probably the slot should be deallocated? */ ++ xf86RemoveDevFromEntity(i, dev); ++ pciSlotClaimed--; + p->bus.type = BUS_NONE; + return; + } +@@ -537,7 +539,7 @@ xf86PciProbeDev(DriverPtr drvp) + foundScreen = TRUE; + } + else +- xf86UnclaimPciSlot(pPci); ++ xf86UnclaimPciSlot(pPci, devList[i]); + } + + break; +-- +1.7.7.6 +