xserver: Branch 'master' - 8 commits

Keith Packard keithp at kemper.freedesktop.org
Mon May 12 14:13:38 PDT 2014


 Xi/exevents.c                                |   16 ++++++------
 config/config.c                              |    6 +---
 glamor/glamor_priv.h                         |    3 --
 hw/xfree86/common/xf86Bus.c                  |    4 +--
 hw/xfree86/common/xf86Config.c               |   34 +++++++++++++++++++--------
 hw/xfree86/common/xf86Xinput.c               |    9 ++-----
 hw/xfree86/common/xf86platformBus.c          |    3 --
 hw/xfree86/man/xorg.conf.man                 |   24 +++++++++++++++++++
 hw/xfree86/os-support/linux/lnx_platform.c   |    2 -
 hw/xfree86/os-support/linux/systemd-logind.c |    7 +++--
 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 
 include/systemd-logind.h                     |    4 +--
 mi/miwindow.c                                |    2 -
 17 files changed, 96 insertions(+), 40 deletions(-)

New commits:
commit bbfed454b2a0fd5e2723524d145cb7c6e5aa9193
Author: Eric Anholt <eric at anholt.net>
Date:   Thu May 8 08:45:22 2014 -0700

    glamor: Stop disabling asserts by default.
    
    Disabling asserts is something the user gets to manage.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 96635be..c56c559 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -30,9 +30,6 @@
 #include "dix-config.h"
 
 #include <xorg-server.h>
-#ifndef DEBUG
-#define NDEBUG
-#endif
 #include "glamor.h"
 
 #include <epoxy/gl.h>
commit 8e2fefe3ef247f8b5d74e32e8d37c619b06fc60c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Apr 29 16:52:01 2014 +1000

    Xi: don't copy a DeviceEvent into an InternalEvent
    
    ==26141== Invalid read of size 8
    ==26141==    at 0x58FAEA: DeliverEmulatedMotionEvent (exevents.c:1484)
    
    An InternalEvent is bigger than a DeviceEvent, thus copying one to the other
    reads past the allocated boundary. Shouldn't have any real effect since we
    shouldn't access anything past the DeviceEvent boundary if the event type is
    correct.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 9c207eb..02530bd 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1469,7 +1469,7 @@ static void
 DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
                            InternalEvent *ev)
 {
-    InternalEvent motion;
+    DeviceEvent motion;
 
     if (ti->num_listeners) {
         ClientPtr client;
@@ -1481,11 +1481,11 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
             ti->listeners[0].type != LISTENER_POINTER_GRAB)
             return;
 
-        motion = *ev;
-        motion.any.type = ET_TouchUpdate;
-        motion.device_event.detail.button = 0;
+        motion = ev->device_event;
+        motion.type = ET_TouchUpdate;
+        motion.detail.button = 0;
 
-        if (!RetrieveTouchDeliveryData(dev, ti, &motion,
+        if (!RetrieveTouchDeliveryData(dev, ti, (InternalEvent*)&motion,
                                        &ti->listeners[0], &client, &win, &grab,
                                        &mask))
             return;
@@ -1500,18 +1500,18 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
             }
         }
 
-        DeliverTouchEmulatedEvent(dev, ti, &motion, &ti->listeners[0], client,
+        DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
                                   win, grab, mask);
     }
     else {
         InternalEvent button;
         int converted;
 
-        converted = TouchConvertToPointerEvent(ev, &motion, &button);
+        converted = TouchConvertToPointerEvent(ev, (InternalEvent*)&motion, &button);
 
         BUG_WARN(converted == 0);
         if (converted)
-            ProcessOtherEvent(&motion, dev);
+            ProcessOtherEvent((InternalEvent*)&motion, dev);
     }
 }
 
commit d7ac9aff061f2961e6b76557dda97b57988ce362
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Apr 30 10:55:26 2014 +1000

    mi: start calculating the sprite trace from the first child of root
    
    Introduced in
    73698d41e41ce76bef2d9a90b46ac0c24ae148dd "Make XYToWindow a screen function"
    
    Moving the code into miwindow.c changed the start of the loop from
    RootWindow()->firstChild to DeepestSpriteWindow(). This function is only
    supposed to be called from miXYToWindow which resets spriteTraceGood to 1,
    thus DeepestSpriteWindow() is always the root window anyway.
    What got dropped was the firstChild as the first window to handle, so we may
    end up with the root window twice in the sprite trace.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/miwindow.c b/mi/miwindow.c
index 951b8c5..57de91b 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -766,7 +766,7 @@ miSpriteTrace(SpritePtr pSprite, int x, int y)
     WindowPtr pWin;
     BoxRec box;
 
-    pWin = DeepestSpriteWin(pSprite);
+    pWin = DeepestSpriteWin(pSprite)->firstChild;
     while (pWin) {
         if ((pWin->mapped) &&
             (x >= pWin->drawable.x - wBorderWidth(pWin)) &&
commit d60724b752613ce2ad11c6ae102bf4513f9768ff
Merge: a5b9757 15460ea
Author: Keith Packard <keithp at keithp.com>
Date:   Thu May 8 12:58:41 2014 -0700

    Merge commit 'who/for-keith'
    
    Skipping two unreviewed patches; will mark them reviewed and cherry pick

commit 15460eaed28b5353a94a17091d7795cfaeda9146
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri May 2 14:14:58 2014 +1000

    systemd-logind: let the logind code decided whether to close an fd
    
    We can only request one fd per device from systemd-logind. If a fd is re-used
    by the same device, releasing the fd from one device doesn't mean we can close
    it. The systemd code knows when it's really released, so let it close the fd.
    
    Test case: xorg.conf section for an input device with hotplugging enabled.
    evdev detects the duplicate and closes the hotplugged device, which closes the
    fd. The other instance of evdev thinks the fd is still valid so now you're
    playing a double lottery. First, which client(s) will get the evdev fd?
    Second, which requests will be picked up by evdev and which ones will be
    picked up by the client? You'll never know, but the fun is in finding out.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/config/config.c b/config/config.c
index def7f16..5514516 100644
--- a/config/config.c
+++ b/config/config.c
@@ -250,8 +250,6 @@ config_odev_free_attributes(struct OdevAttributes *attribs)
         free(iter);
     }
 
-    if (fd != -1) {
-        systemd_logind_release_fd(major, minor);
-        close(fd);
-    }
+    if (fd != -1)
+        systemd_logind_release_fd(major, minor, fd);
 }
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index bc6b73f..4e8060b 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -770,10 +770,8 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
 
     FreeInputAttributes(pInp->attrs);
 
-    if (pInp->flags & XI86_SERVER_FD) {
-        systemd_logind_release_fd(pInp->major, pInp->minor);
-        close(pInp->fd);
-    }
+    if (pInp->flags & XI86_SERVER_FD)
+        systemd_logind_release_fd(pInp->major, pInp->minor, pInp->fd);
 
     /* Remove the entry from the list. */
     if (pInp == xf86InputDevs)
@@ -873,8 +871,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
                             sizeof(pInfo) * (new_input_devices_count + 1));
                 new_input_devices[new_input_devices_count] = pInfo;
                 new_input_devices_count++;
-                systemd_logind_release_fd(pInfo->major, pInfo->minor);
-                close(fd);
+                systemd_logind_release_fd(pInfo->major, pInfo->minor, fd);
                 return BadMatch;
             }
             pInfo->fd = fd;
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 4e80f9e..dd118a2 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -340,8 +340,7 @@ static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp,
             fd = xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_FD, -1);
             major = xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_MAJOR, 0);
             minor = xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_MINOR, 0);
-            systemd_logind_release_fd(major, minor);
-            close(fd);
+            systemd_logind_release_fd(major, minor, fd);
             config_odev_add_int_attribute(dev->attribs, ODEV_ATTRIB_FD, -1);
             dev->flags &= ~XF86_PDEV_SERVER_FD;
         }
diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index dbd7aa0..308275a 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -37,7 +37,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
         if (paused) {
             LogMessage(X_ERROR,
                     "Error systemd-logind returned paused fd for drm node\n");
-            systemd_logind_release_fd(major, minor);
+            systemd_logind_release_fd(major, minor, -1);
             return FALSE;
         }
         config_odev_add_int_attribute(attribs, ODEV_ATTRIB_FD, fd);
diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
index ed670a8..73a8d55 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -162,7 +162,7 @@ cleanup:
 }
 
 void
-systemd_logind_release_fd(int _major, int _minor)
+systemd_logind_release_fd(int _major, int _minor, int fd)
 {
     struct systemd_logind_info *info = &logind_info;
     InputInfoPtr pInfo;
@@ -174,7 +174,7 @@ systemd_logind_release_fd(int _major, int _minor)
     int matches = 0;
 
     if (!info->session || major == 0)
-        return;
+        goto close;
 
     /* Only release the fd if there is only 1 InputInfo left for this major
      * and minor, otherwise other InputInfo's are still referencing the fd. */
@@ -218,6 +218,9 @@ cleanup:
     if (reply)
         dbus_message_unref(reply);
     dbus_error_free(&error);
+close:
+    if (fd != -1)
+        close(fd);
 }
 
 int
diff --git a/include/systemd-logind.h b/include/systemd-logind.h
index 06dd031..a4067d0 100644
--- a/include/systemd-logind.h
+++ b/include/systemd-logind.h
@@ -30,14 +30,14 @@
 int systemd_logind_init(void);
 void systemd_logind_fini(void);
 int systemd_logind_take_fd(int major, int minor, const char *path, Bool *paus);
-void systemd_logind_release_fd(int major, int minor);
+void systemd_logind_release_fd(int major, int minor, int fd);
 int systemd_logind_controls_session(void);
 void systemd_logind_vtenter(void);
 #else
 #define systemd_logind_init()
 #define systemd_logind_fini()
 #define systemd_logind_take_fd(major, minor, path, paus) -1
-#define systemd_logind_release_fd(major, minor)
+#define systemd_logind_release_fd(major, minor, fd) close(fd)
 #define systemd_logind_controls_session() 0
 #define systemd_logind_vtenter()
 #endif
commit a6f5ffd5879e7fb052d343592951cc476b699bb4
Author: Laércio de Sousa <lbsousajr at gmail.com>
Date:   Thu Apr 3 11:19:15 2014 -0300

    xfree86: add short description about MatchSeat key in xorg.conf man page
    
    Signed-off-by: Laércio de Sousa <lbsousajr at gmail.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

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
commit 7070ebeebaca1b51f8a2801989120784a1c374ae
Author: Oleg Samarin <osamarin68 at gmail.com>
Date:   Thu Apr 3 11:19:14 2014 -0300

    xfree86: add new key MatchSeat to xorg.conf sections "Device", "Screen", and "ServerLayout"
    
    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 at gmail.com>
    Signed-off-by: Laércio de Sousa <lbsousajr at gmail.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 542d5ab..5d17567 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -232,6 +232,17 @@ xf86ValidateFontPath(char *path)
     return tmp_path;
 }
 
+#define FIND_SUITABLE(pointertype, listhead, ptr)                               \
+    {                                                                           \
+        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;                                                                \
+    }
+
 /*
  * use the datastructure that the parser provides and pick out the parts
  * that we need at this point
@@ -1580,8 +1591,11 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
      * 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);
@@ -1821,7 +1835,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
      * 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);
     }
@@ -2429,14 +2443,19 @@ xf86HandleConfigFile(Bool autoconfig)
      */
 
     /* First check if a layout section is present, and if it is valid. */
+    XF86ConfLayoutPtr layout;
+
+    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;
@@ -2451,16 +2470,13 @@ xf86HandleConfigFile(Bool autoconfig)
             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;
             }
diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c
index 073171f..d3ac293 100644
--- a/hw/xfree86/parser/Device.c
+++ b/hw/xfree86/parser/Device.c
@@ -71,6 +71,7 @@ xf86ConfigSymTabRec DeviceTab[] = {
     {RAMDAC, "ramdac"},
     {DACSPEED, "dacspeed"},
     {CLOCKS, "clocks"},
+    {MATCHSEAT, "matchseat"},
     {OPTION, "option"},
     {VIDEORAM, "videoram"},
     {BIOSBASE, "biosbase"},
@@ -216,6 +217,11 @@ xf86parseDeviceSection(void)
                 Error(NUMBER_MSG, "TextClockFreq");
             ptr->dev_textclockfreq = (int) (xf86_lex_val.realnum * 1000.0 + 0.5);
             break;
+        case MATCHSEAT:
+            if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
+                Error(QUOTE_MSG, "MatchSeat");
+            ptr->match_seat = xf86_lex_val.str;
+            break;
         case OPTION:
             ptr->dev_option_lst = xf86parseOption(ptr->dev_option_lst);
             break;
diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c
index 7be746f..994b31a 100644
--- a/hw/xfree86/parser/Layout.c
+++ b/hw/xfree86/parser/Layout.c
@@ -70,6 +70,7 @@ static xf86ConfigSymTabRec LayoutTab[] = {
     {ENDSECTION, "endsection"},
     {SCREEN, "screen"},
     {IDENTIFIER, "identifier"},
+    {MATCHSEAT, "matchseat"},
     {INACTIVE, "inactive"},
     {INPUTDEVICE, "inputdevice"},
     {OPTION, "option"},
@@ -109,6 +110,11 @@ xf86parseLayoutSection(void)
             ptr->lay_identifier = xf86_lex_val.str;
             has_ident = TRUE;
             break;
+        case MATCHSEAT:
+            if (xf86getSubToken(&(ptr->lay_comment)) != STRING)
+                Error(QUOTE_MSG, "MatchSeat");
+            ptr->match_seat = xf86_lex_val.str;
+            break;
         case INACTIVE:
         {
             XF86ConfInactivePtr iptr;
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
index fecd57c..0e9746a 100644
--- a/hw/xfree86/parser/Screen.c
+++ b/hw/xfree86/parser/Screen.c
@@ -198,6 +198,7 @@ xf86parseDisplaySubSection(void)
 static xf86ConfigSymTabRec ScreenTab[] = {
     {ENDSECTION, "endsection"},
     {IDENTIFIER, "identifier"},
+    {MATCHSEAT, "matchseat"},
     {OBSDRIVER, "driver"},
     {MDEVICE, "device"},
     {MONITOR, "monitor"},
@@ -236,6 +237,11 @@ xf86parseScreenSection(void)
                 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 = xf86_lex_val.str;
+            break;
         case OBSDRIVER:
             if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
                 Error(QUOTE_MSG, "Driver");
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index 8f855ac..c95423a 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -224,6 +224,7 @@ typedef struct {
     int dev_screen;
     XF86OptionPtr dev_option_lst;
     char *dev_comment;
+    char *match_seat;
 } XF86ConfDeviceRec, *XF86ConfDevicePtr;
 
 typedef struct {
@@ -275,6 +276,7 @@ typedef struct {
     XF86OptionPtr scrn_option_lst;
     char *scrn_comment;
     int scrn_virtualX, scrn_virtualY;
+    char *match_seat;
 } XF86ConfScreenRec, *XF86ConfScreenPtr;
 
 typedef struct {
@@ -366,6 +368,7 @@ typedef struct {
     XF86ConfInactivePtr lay_inactive_lst;
     XF86ConfInputrefPtr lay_input_lst;
     XF86OptionPtr lay_option_lst;
+    char *match_seat;
     char *lay_comment;
 } XF86ConfLayoutRec, *XF86ConfLayoutPtr;
 
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index f751b7b..5c01ce7 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -87,6 +87,7 @@ typedef enum {
     VENDOR,
     DASH,
     COMMA,
+    MATCHSEAT,
     OPTION,
     COMMENT,
 
commit 29b1484bb9555e45067669cbfe68a3c40596f4ff
Author: Laércio de Sousa <lbsousajr at gmail.com>
Date:   Thu Apr 3 11:19:13 2014 -0300

    xfree86: allow fallback to PCI bus probe for graphics devices on non-seat0 X servers (#66851)
    
    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 at gmail.com>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

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


More information about the xorg-commit mailing list