← Back to team overview

ubuntu-multiseat team mailing list archive

[Merge] lp:~ubuntu-multiseat/xorg-server/trusty-matchseat into lp:ubuntu/trusty/xorg-server

 

Laércio de Sousa has proposed merging lp:~ubuntu-multiseat/xorg-server/trusty-matchseat into lp:ubuntu/trusty/xorg-server.

Requested reviews:
  Ubuntu branches (ubuntu-branches)

For more details, see:
https://code.launchpad.net/~ubuntu-multiseat/xorg-server/trusty-matchseat/+merge/234316

Please backport these patches from upstream release 1.16 to trusty "xorg-server" package. These ones are really needed to make logind-based multiseat setups work properly with non-KMS video drivers (line NVIDIA/AMD proprietary ones) and are a "must have" for a LTS release like 14.04.

Thanks in advance!
-- 
https://code.launchpad.net/~ubuntu-multiseat/xorg-server/trusty-matchseat/+merge/234316
Your team Ubuntu Multiseat is subscribed to branch lp:~ubuntu-multiseat/xorg-server/trusty-matchseat.
=== modified file 'debian/patches/series'
--- debian/patches/series	2013-08-14 10:52:17 +0000
+++ debian/patches/series	2014-09-11 14:14:10 +0000
@@ -56,3 +56,7 @@
 
 aarch64.patch
 xmir.patch
+xfree86_allow_fallback_to_pci_bus_probe_for_non_seat0.patch
+xfree86_keep_non_seat0_from_touching_vts.patch
+xfree86_add_matchseat_key_to_xorg_conf.patch
+xfree86_add_matchseat_key_description_to_xorg_conf_man.patch

=== added file 'debian/patches/xfree86_add_matchseat_key_description_to_xorg_conf_man.patch'
--- debian/patches/xfree86_add_matchseat_key_description_to_xorg_conf_man.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/xfree86_add_matchseat_key_description_to_xorg_conf_man.patch	2014-09-11 14:14:10 +0000
@@ -0,0 +1,68 @@
+From a6f5ffd5879e7fb052d343592951cc476b699bb4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?= <lbsousajr@xxxxxxxxx>
+Date: Thu, 3 Apr 2014 11:19:15 -0300
+Subject: [PATCH] xfree86: add short description about MatchSeat key in
+ xorg.conf man page
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Laércio de Sousa <lbsousajr@xxxxxxxxx>
+Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx>
+Signed-off-by: Peter Hutterer <peter.hutterer@xxxxxxxxx>
+---
+ hw/xfree86/man/xorg.conf.man | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
+index 6d2652e..cadd87b 100644
+--- a/hw/xfree86/man/xorg.conf.man
++++ b/hw/xfree86/man/xorg.conf.man
+@@ -1378,6 +1378,14 @@ for the regular text mode.
+ The frequency is specified in MHz.
+ This is rarely used.
+ .TP 7
++.BI "MatchSeat  " "seat\-id"
++Only apply this
++.B Device
++section if X server was started with
++.B -seat
++.I seat\-id
++option.
++.TP 7
+ .BI "Option \*qModeDebug\*q \*q" boolean \*q
+ Enable printing of additional debugging information about modesetting to
+ the server log.
+@@ -1900,6 +1908,14 @@ The only case where there is even a choice in this value is for depth 24,
+ where some hardware supports both a packed 24 bit framebuffer layout and a
+ sparse 32 bit framebuffer layout.
+ .TP 7
++.BI "MatchSeat  " "seat\-id"
++Only apply this
++.B Screen
++section if X server was started with
++.B -seat
++.I seat\-id
++option.
++.TP 7
+ .B Options
+ Various
+ .B Option
+@@ -2295,6 +2311,14 @@ and the first two should normally be used to indicate the core pointer
+ and core keyboard devices respectively.
+ .RE
+ .TP 7
++.BI "MatchSeat  " "seat\-id"
++Only apply this
++.B ServerLayout
++section if X server was started with
++.B -seat
++.I seat\-id
++option.
++.TP 7
+ .B Options
+ In addition to the following, any option permitted in the
+ .B ServerFlags
+-- 
+2.0.4
+

=== added file 'debian/patches/xfree86_add_matchseat_key_to_xorg_conf.patch'
--- debian/patches/xfree86_add_matchseat_key_to_xorg_conf.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/xfree86_add_matchseat_key_to_xorg_conf.patch	2014-09-11 14:14:10 +0000
@@ -0,0 +1,248 @@
+From 7070ebeebaca1b51f8a2801989120784a1c374ae Mon Sep 17 00:00:00 2001
+From: Oleg Samarin <osamarin68@xxxxxxxxx>
+Date: Thu, 3 Apr 2014 11:19:14 -0300
+Subject: [PATCH] xfree86: add new key MatchSeat to xorg.conf sections
+ "Device", "Screen", and "ServerLayout"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch introduces a new key MatchSeat in xorg.conf (also applies to
+any .conf file in xorg.conf.d). It will allow targeting a given
+"Device", "Screen", and/or "ServerLayout" section to a particular
+seat only (specified by option "-seat" in X server command line),
+so that other seats won't be affected.
+
+Without this patch, one needs to write a separate xorg.conf.custom
+file and pass it to X server via "-config" option, if one wants that
+these settings only apply for the right seat. However, in some cases,
+this solution is undesirable or even impossible (e.g. when using GDM,
+which doesn't allow X server command line customization).
+
+Example file (/etc/X11/xorg.conf.d/seat1.conf), which would be ignored
+by X server unless it was started with "-seat seat1" option:
+
+Section "Device"
+    Identifier "card0"
+    Driver "nvidia"
+    Option "NoLogo" "True"
+    MatchSeat "seat1"
+EndSection
+
+Signed-off-by: Oleg Samarin <osamarin68@xxxxxxxxx>
+Signed-off-by: Laércio de Sousa <lbsousajr@xxxxxxxxx>
+Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx>
+Signed-off-by: Peter Hutterer <peter.hutterer@xxxxxxxxx>
+---
+ hw/xfree86/common/xf86Config.c | 34 +++++++++++++++++++++++++---------
+ hw/xfree86/parser/Device.c     |  6 ++++++
+ hw/xfree86/parser/Layout.c     |  6 ++++++
+ hw/xfree86/parser/Screen.c     |  6 ++++++
+ hw/xfree86/parser/xf86Parser.h |  3 +++
+ hw/xfree86/parser/xf86tokens.h |  1 +
+ 6 files changed, 47 insertions(+), 9 deletions(-)
+
+Index: xorg-server-trusty-matchseat/hw/xfree86/common/xf86Config.c
+===================================================================
+--- xorg-server-trusty-matchseat.orig/hw/xfree86/common/xf86Config.c	2014-09-11 10:50:39.823851011 -0300
++++ xorg-server-trusty-matchseat/hw/xfree86/common/xf86Config.c	2014-09-11 10:55:16.098992439 -0300
+@@ -232,6 +232,18 @@
+     return tmp_path;
+ }
+ 
++#define FIND_SUITABLE(pointertype, listhead, ptr)                                            \
++    do {                                                                                     \
++        pointertype _l, _p;                                                                  \
++                                                                                             \
++        for (_l = (listhead), _p = NULL; !_p && _l; _l = (pointertype)_l->list.next) {       \
++            if (!_l->match_seat || (SeatId && xf86nameCompare(_l->match_seat, SeatId) == 0)) \
++                _p = _l;                                                                     \
++        }                                                                                    \
++                                                                                             \
++        (ptr) = _p;                                                                          \
++    } while(0)
++
+ /*
+  * use the datastructure that the parser provides and pick out the parts
+  * that we need at this point
+@@ -1600,8 +1612,11 @@
+      * config file, or - if it is NULL - configScreen autogenerates one for
+      * us */
+     if (!count) {
++        XF86ConfScreenPtr screen;
++
++        FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen);
+         slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
+-        if (!configScreen(slp[0].screen, xf86configptr->conf_screen_lst,
++        if (!configScreen(slp[0].screen, screen,
+                           0, X_CONFIG)) {
+             free(slp[0].screen);
+             free(slp);
+@@ -1841,7 +1856,7 @@
+      * set it to NULL so that the section can be autoconfigured later */
+     screenp->device = xnfcalloc(1, sizeof(GDevRec));
+     if ((!conf_screen->scrn_device) && (xf86configptr->conf_device_lst)) {
+-        conf_screen->scrn_device = xf86configptr->conf_device_lst;
++        FIND_SUITABLE (XF86ConfDevicePtr, xf86configptr->conf_device_lst, conf_screen->scrn_device);
+         xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n"
+                 "\tUsing the first device section listed.\n", screenp->id);
+     }
+@@ -2374,6 +2389,7 @@
+     char *scanptr;
+     Bool singlecard = 0;
+     Bool implicit_layout = FALSE;
++    XF86ConfLayoutPtr layout;
+ 
+     if (!autoconfig) {
+         char *filename, *dirname, *sysdirname;
+@@ -2449,14 +2465,17 @@
+      */
+ 
+     /* First check if a layout section is present, and if it is valid. */
++    FIND_SUITABLE(XF86ConfLayoutPtr, xf86configptr->conf_layout_lst, layout);
++    if (layout == NULL || xf86ScreenName != NULL) {
++        XF86ConfScreenPtr screen;
+ 
+-    if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) {
+         if (xf86ScreenName == NULL) {
+             xf86Msg(X_DEFAULT,
+                     "No Layout section.  Using the first Screen section.\n");
+         }
++        FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen);
+         if (!configImpliedLayout(&xf86ConfigLayout,
+-                                 xf86configptr->conf_screen_lst,
++                                 screen,
+                                  xf86configptr)) {
+             xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
+             return CONFIG_PARSE_ERROR;
+@@ -2471,16 +2490,13 @@
+             if (optlist && xf86FindOption(optlist, "defaultserverlayout"))
+                 dfltlayout =
+                     xf86SetStrOption(optlist, "defaultserverlayout", NULL);
+-            if (!configLayout
+-                (&xf86ConfigLayout, xf86configptr->conf_layout_lst,
+-                 dfltlayout)) {
++            if (!configLayout(&xf86ConfigLayout, layout, dfltlayout)) {
+                 xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
+                 return CONFIG_PARSE_ERROR;
+             }
+         }
+         else {
+-            if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
+-                              NULL)) {
++            if (!configLayout(&xf86ConfigLayout, layout, NULL)) {
+                 xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
+                 return CONFIG_PARSE_ERROR;
+             }
+Index: xorg-server-trusty-matchseat/hw/xfree86/parser/Device.c
+===================================================================
+--- xorg-server-trusty-matchseat.orig/hw/xfree86/parser/Device.c	2014-09-11 10:48:54.272129993 -0300
++++ xorg-server-trusty-matchseat/hw/xfree86/parser/Device.c	2014-09-11 10:55:16.094992284 -0300
+@@ -72,6 +72,7 @@
+     {RAMDAC, "ramdac"},
+     {DACSPEED, "dacspeed"},
+     {CLOCKS, "clocks"},
++    {MATCHSEAT, "matchseat"},
+     {OPTION, "option"},
+     {VIDEORAM, "videoram"},
+     {BIOSBASE, "biosbase"},
+@@ -217,6 +218,11 @@
+                 Error(NUMBER_MSG, "TextClockFreq");
+             ptr->dev_textclockfreq = (int) (val.realnum * 1000.0 + 0.5);
+             break;
++        case MATCHSEAT:
++            if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
++                Error(QUOTE_MSG, "MatchSeat");
++            ptr->match_seat = val.str;
++            break;
+         case OPTION:
+             ptr->dev_option_lst = xf86parseOption(ptr->dev_option_lst);
+             break;
+Index: xorg-server-trusty-matchseat/hw/xfree86/parser/Layout.c
+===================================================================
+--- xorg-server-trusty-matchseat.orig/hw/xfree86/parser/Layout.c	2014-09-11 10:48:54.272129993 -0300
++++ xorg-server-trusty-matchseat/hw/xfree86/parser/Layout.c	2014-09-11 10:55:16.094992284 -0300
+@@ -71,6 +71,7 @@
+     {ENDSECTION, "endsection"},
+     {SCREEN, "screen"},
+     {IDENTIFIER, "identifier"},
++    {MATCHSEAT, "matchseat"},
+     {INACTIVE, "inactive"},
+     {INPUTDEVICE, "inputdevice"},
+     {OPTION, "option"},
+@@ -110,6 +111,11 @@
+             ptr->lay_identifier = val.str;
+             has_ident = TRUE;
+             break;
++        case MATCHSEAT:
++            if (xf86getSubToken(&(ptr->lay_comment)) != STRING)
++                Error(QUOTE_MSG, "MatchSeat");
++            ptr->match_seat = val.str;
++            break;
+         case INACTIVE:
+         {
+             XF86ConfInactivePtr iptr;
+Index: xorg-server-trusty-matchseat/hw/xfree86/parser/Screen.c
+===================================================================
+--- xorg-server-trusty-matchseat.orig/hw/xfree86/parser/Screen.c	2014-09-11 10:48:54.272129993 -0300
++++ xorg-server-trusty-matchseat/hw/xfree86/parser/Screen.c	2014-09-11 10:55:16.094992284 -0300
+@@ -199,6 +199,7 @@
+ static xf86ConfigSymTabRec ScreenTab[] = {
+     {ENDSECTION, "endsection"},
+     {IDENTIFIER, "identifier"},
++    {MATCHSEAT, "matchseat"},
+     {OBSDRIVER, "driver"},
+     {MDEVICE, "device"},
+     {MONITOR, "monitor"},
+@@ -237,6 +238,11 @@
+                 Error(ONLY_ONE_MSG, "Identifier or Driver");
+             has_ident = TRUE;
+             break;
++        case MATCHSEAT:
++            if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
++                Error(QUOTE_MSG, "MatchSeat");
++            ptr->match_seat = val.str;
++            break;
+         case OBSDRIVER:
+             if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
+                 Error(QUOTE_MSG, "Driver");
+Index: xorg-server-trusty-matchseat/hw/xfree86/parser/xf86Parser.h
+===================================================================
+--- xorg-server-trusty-matchseat.orig/hw/xfree86/parser/xf86Parser.h	2014-09-11 10:48:54.272129993 -0300
++++ xorg-server-trusty-matchseat/hw/xfree86/parser/xf86Parser.h	2014-09-11 10:55:16.094992284 -0300
+@@ -224,6 +224,7 @@
+     int dev_screen;
+     XF86OptionPtr dev_option_lst;
+     char *dev_comment;
++    char *match_seat;
+ } XF86ConfDeviceRec, *XF86ConfDevicePtr;
+ 
+ typedef struct {
+@@ -275,6 +276,7 @@
+     XF86OptionPtr scrn_option_lst;
+     char *scrn_comment;
+     int scrn_virtualX, scrn_virtualY;
++    char *match_seat;
+ } XF86ConfScreenRec, *XF86ConfScreenPtr;
+ 
+ typedef struct {
+@@ -366,6 +368,7 @@
+     XF86ConfInactivePtr lay_inactive_lst;
+     XF86ConfInputrefPtr lay_input_lst;
+     XF86OptionPtr lay_option_lst;
++    char *match_seat;
+     char *lay_comment;
+ } XF86ConfLayoutRec, *XF86ConfLayoutPtr;
+ 
+Index: xorg-server-trusty-matchseat/hw/xfree86/parser/xf86tokens.h
+===================================================================
+--- xorg-server-trusty-matchseat.orig/hw/xfree86/parser/xf86tokens.h	2014-09-11 10:48:54.272129993 -0300
++++ xorg-server-trusty-matchseat/hw/xfree86/parser/xf86tokens.h	2014-09-11 10:55:16.094992284 -0300
+@@ -87,6 +87,7 @@
+     VENDOR,
+     DASH,
+     COMMA,
++    MATCHSEAT,
+     OPTION,
+     COMMENT,
+ 

=== added file 'debian/patches/xfree86_allow_fallback_to_pci_bus_probe_for_non_seat0.patch'
--- debian/patches/xfree86_allow_fallback_to_pci_bus_probe_for_non_seat0.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/xfree86_allow_fallback_to_pci_bus_probe_for_non_seat0.patch	2014-09-11 14:14:10 +0000
@@ -0,0 +1,52 @@
+From 29b1484bb9555e45067669cbfe68a3c40596f4ff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?= <lbsousajr@xxxxxxxxx>
+Date: Thu, 3 Apr 2014 11:19:13 -0300
+Subject: [PATCH] xfree86: allow fallback to PCI bus probe for graphics devices
+ on non-seat0 X servers (#66851)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Currently non-seat0 X servers only probe platform bus for graphics devices,
+which is OK for most KMS-compliant drivers. However, for non-KMS drivers
+(like NVIDIA proprietary ones), graphics devices can't be reached
+by platform bus probe, resulting in a "No devices detected" error.
+
+This patch allows a fallback to PCI bus probe for non-seat0 X servers
+in case no platform bus graphics device is found.
+
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66851
+
+Signed-off-by: Laércio de Sousa <lbsousajr@xxxxxxxxx>
+Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
+Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx>
+Signed-off-by: Peter Hutterer <peter.hutterer@xxxxxxxxx>
+---
+ hw/xfree86/common/xf86Bus.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
+index 507c57d..b3b3f8c 100644
+--- a/hw/xfree86/common/xf86Bus.c
++++ b/hw/xfree86/common/xf86Bus.c
+@@ -81,7 +81,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
+     if (drv->platformProbe != NULL) {
+         foundScreen = xf86platformProbeDev(drv);
+     }
+-    if (ServerIsNotSeat0())
++    if (ServerIsNotSeat0() && foundScreen)
+         return foundScreen;
+ #endif
+ 
+@@ -201,7 +201,7 @@ xf86BusProbe(void)
+ {
+ #ifdef XSERVER_PLATFORM_BUS
+     xf86platformProbe();
+-    if (ServerIsNotSeat0())
++    if (ServerIsNotSeat0() && xf86_num_platform_devices > 0)
+         return;
+ #endif
+ #ifdef XSERVER_LIBPCIACCESS
+-- 
+2.0.4
+

=== added file 'debian/patches/xfree86_keep_non_seat0_from_touching_vts.patch'
--- debian/patches/xfree86_keep_non_seat0_from_touching_vts.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/xfree86_keep_non_seat0_from_touching_vts.patch	2014-09-11 14:14:10 +0000
@@ -0,0 +1,50 @@
+From 46cf2a60934076bf568062eb83121ce90b6ff596 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?= <lbsousajr@xxxxxxxxx>
+Date: Thu, 12 Dec 2013 14:22:48 -0200
+Subject: [PATCH] xfree86: Keep a non-seat0 X server from touching VTs (#71258)
+
+Updated patch following Hans de Goede's advice.
+
+If -seat option is passed with a value different from seat0,
+X server won't call xf86OpenConsole().
+
+This is needed to avoid any race condition between seat0 and
+non-seat0 X servers. If a non-seat0 X server opens a given VT
+before a seat0 one which expects to open the same VT, one can
+get an inactive systemd-logind graphical session for seat0.
+
+This patch was first tested in a multiseat setup with multiple
+video cards and works quite well.
+
+I suppose it can also make things like DontVTSwitch and -sharevts
+meaningless for non-seat0 seats, so it may fix bug #69477, too.
+
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71258
+       https://bugs.freedesktop.org/show_bug.cgi?id=69477 (maybe)
+
+See also: http://lists.x.org/archives/xorg-devel/2013-October/038391.html
+          https://bugzilla.redhat.com/show_bug.cgi?id=1018196
+
+Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
+Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
+---
+ hw/xfree86/common/xf86Init.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
+index 9c8a86a..952bf37 100644
+--- a/hw/xfree86/common/xf86Init.c
++++ b/hw/xfree86/common/xf86Init.c
+@@ -544,7 +544,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
+             if (NEED_IO_ENABLED(flags))
+                 want_hw_access = TRUE;
+ 
+-            if (!(flags & HW_SKIP_CONSOLE))
++            /* Non-seat0 X servers should not open console */
++            if (!(flags & HW_SKIP_CONSOLE) && !ServerIsNotSeat0())
+                 xorgHWOpenConsole = TRUE;
+         }
+ 
+-- 
+2.0.4
+


Follow ups