[Xquartz-changes] xserver: Branch 'master' - 14 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Oct 26 15:46:06 PDT 2015


 Xext/xvmain.c                          |   82 +++++++++------------------------
 Xi/xichangehierarchy.c                 |    6 --
 configure.ac                           |   13 +++--
 dix/dixfonts.c                         |   21 --------
 hw/xfree86/common/compiler.h           |   49 -------------------
 hw/xfree86/common/xf86platformBus.c    |    3 +
 hw/xfree86/os-support/linux/lnx_init.c |   22 ++++++--
 hw/xfree86/xorg-wrapper.c              |   14 +++++
 present/present.c                      |    2 
 randr/rroutput.c                       |   22 ++++++--
 10 files changed, 84 insertions(+), 150 deletions(-)

New commits:
commit d8b7a900cf912cadb5915b3924dd6ce5a74505e7
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 26 13:47:04 2015 -0400

    xserver 1.17.99.902 (1.18 RC2)
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/configure.ac b/configure.ac
index 220478a..9828cab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.17.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2015-09-01"
-RELEASE_NAME="Nectarine"
+AC_INIT([xorg-server], 1.17.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2015-10-26"
+RELEASE_NAME="Amontillado"
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
commit 47b00fa4bf3b67736957296492310f7fdd6c0a25
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Oct 21 12:15:34 2015 -0400

    xfree86: Use same inb/outb asm code for i386 amd64 and ia64
    
    This matches the GCCUSESGAS path from the old monolith build (where that
    macro was actually set), and fixes the build on modern OSX.
    
    Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 85fb35c..5a1fdac 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -286,7 +286,7 @@ extern _X_EXPORT unsigned int inl(unsigned int port);
 #include <machine/pio.h>
 #endif                          /* __NetBSD__ */
 
-#elif defined(__amd64__)
+#elif defined(__amd64__) || defined(__i386__) || defined(__ia64__)
 
 #include <inttypes.h>
 
@@ -967,53 +967,6 @@ inl(unsigned PORT_SIZE port)
 
 #endif                          /* NDS32_MMIO_SWAP */
 
-#elif defined(__i386__) || defined(__ia64__)
-
-static __inline__ void
-outb(unsigned short port, unsigned char val)
-{
-    __asm__ __volatile__("out%B0 (%1)"::"a"(val), "d"(port));
-}
-
-static __inline__ void
-outw(unsigned short port, unsigned short val)
-{
-    __asm__ __volatile__("out%W0 (%1)"::"a"(val), "d"(port));
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int val)
-{
-    __asm__ __volatile__("out%L0 (%1)"::"a"(val), "d"(port));
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
-    unsigned char ret;
-    __asm__ __volatile__("in%B0 (%1)":"=a"(ret):"d"(port));
-
-    return ret;
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
-    unsigned short ret;
-    __asm__ __volatile__("in%W0 (%1)":"=a"(ret):"d"(port));
-
-    return ret;
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
-    unsigned int ret;
-    __asm__ __volatile__("in%L0 (%1)":"=a"(ret):"d"(port));
-
-    return ret;
-}
-
 #endif                          /* arch madness */
 
 #else                           /* !GNUC */
commit c99fb550e06207e83ec89463fe32bd6bceca45f8
Author: Dave Airlie <airlied at gmail.com>
Date:   Sun Sep 13 07:45:15 2015 +1000

    xf86: don't add gpus from udev if autoAddGPU is set
    
    At startup the server wasn't adding devices, but nothing
    was blocking hotplug devices by the look of it.
    
    bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91388
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index f1e9423..96895a6 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -477,6 +477,9 @@ xf86platformAddDevice(int index)
     screenLayoutPtr layout;
     static const char *hotplug_driver_name = "modesetting";
 
+    if (!xf86Info.autoAddGPU)
+        return -1;
+
     /* force load the driver for now */
     xf86LoadOneModule(hotplug_driver_name, NULL);
 
commit 912f1fe2bb1b640d55fc44fcf636b6ca40d7f40b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 5 10:32:03 2015 +0100

    Xv: Only stop the adaptors when the Pixmap is finally destroyed
    
    Pixmaps are reference counted and DestroyPixmap is called for the
    removal of every reference. However, we only want to stop the adaptors
    writing into the Pixmap just before the Pixmap is finally destroyed,
    similar to how Windows are handled.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 93e5f0c..0c6f25b 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -327,36 +327,24 @@ XvGetRTPort(void)
     return XvRTPort;
 }
 
-static Bool
-XvDestroyPixmap(PixmapPtr pPix)
+static void
+XvStopAdaptors(DrawablePtr pDrawable)
 {
-    Bool status;
-    ScreenPtr pScreen;
-    XvScreenPtr pxvs;
-    XvAdaptorPtr pa;
-    int na;
-    XvPortPtr pp;
-    int np;
-
-    pScreen = pPix->drawable.pScreen;
-
-    SCREEN_PROLOGUE(pScreen, DestroyPixmap);
-
-    pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
+    ScreenPtr pScreen = pDrawable->pScreen;
+    XvScreenPtr pxvs = dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
+    XvAdaptorPtr pa = pxvs->pAdaptors;
+    int na = pxvs->nAdaptors;
 
     /* CHECK TO SEE IF THIS PORT IS IN USE */
-
-    pa = pxvs->pAdaptors;
-    na = pxvs->nAdaptors;
     while (na--) {
-        np = pa->nPorts;
-        pp = pa->pPorts;
+        XvPortPtr pp = pa->pPorts;
+        int np = pa->nPorts;
 
         while (np--) {
-            if (pp->pDraw == (DrawablePtr) pPix) {
-                XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
+            if (pp->pDraw == pDrawable) {
+                XvdiSendVideoNotify(pp, pDrawable, XvPreempted);
 
-                (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw);
+                (void) (*pp->pAdaptor->ddStopVideo) (pp, pDrawable);
 
                 pp->pDraw = NULL;
                 pp->client = NULL;
@@ -366,9 +354,19 @@ XvDestroyPixmap(PixmapPtr pPix)
         }
         pa++;
     }
+}
 
-    status = (*pScreen->DestroyPixmap) (pPix);
+static Bool
+XvDestroyPixmap(PixmapPtr pPix)
+{
+    ScreenPtr pScreen = pPix->drawable.pScreen;
+    Bool status;
+
+    if (pPix->refcnt == 1)
+        XvStopAdaptors(&pPix->drawable);
 
+    SCREEN_PROLOGUE(pScreen, DestroyPixmap);
+    status = (*pScreen->DestroyPixmap) (pPix);
     SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
 
     return status;
@@ -378,45 +376,13 @@ XvDestroyPixmap(PixmapPtr pPix)
 static Bool
 XvDestroyWindow(WindowPtr pWin)
 {
+    ScreenPtr pScreen = pWin->drawable.pScreen;
     Bool status;
-    ScreenPtr pScreen;
-    XvScreenPtr pxvs;
-    XvAdaptorPtr pa;
-    int na;
-    XvPortPtr pp;
-    int np;
 
-    pScreen = pWin->drawable.pScreen;
+    XvStopAdaptors(&pWin->drawable);
 
     SCREEN_PROLOGUE(pScreen, DestroyWindow);
-
-    pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
-
-    /* CHECK TO SEE IF THIS PORT IS IN USE */
-
-    pa = pxvs->pAdaptors;
-    na = pxvs->nAdaptors;
-    while (na--) {
-        np = pa->nPorts;
-        pp = pa->pPorts;
-
-        while (np--) {
-            if (pp->pDraw == (DrawablePtr) pWin) {
-                XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
-
-                (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw);
-
-                pp->pDraw = NULL;
-                pp->client = NULL;
-                pp->time = currentTime;
-            }
-            pp++;
-        }
-        pa++;
-    }
-
     status = (*pScreen->DestroyWindow) (pWin);
-
     SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
 
     return status;
commit 413cb2ff1d754b5f19d77ff19cddf40793989c03
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Feb 16 09:49:18 2015 +0000

    present: Fix missed notify MSC computation
    
    Only treat divisor==0 as async to immediately report the actual vblank.
    If the user species a non-zero divisor, we should compute the missed
    vblank properly or else we report too early.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Reviewed-by: Mario Kleiner <mario.kleiner.de at gmail.com>

diff --git a/present/present.c b/present/present.c
index 7ddffbd..beb4ff0 100644
--- a/present/present.c
+++ b/present/present.c
@@ -933,7 +933,7 @@ present_notify_msc(WindowPtr window,
                           0, 0,
                           NULL,
                           NULL, NULL,
-                          PresentOptionAsync,
+                          divisor == 0 ? PresentOptionAsync : 0,
                           target_msc, divisor, remainder, NULL, 0);
 }
 
commit 702c0a247f5523b43652befaf6be548ddbbe9dee
Author: Alberto Milone <alberto.milone at canonical.com>
Date:   Thu Dec 12 10:00:09 2013 +0100

    randr: make RROutputChanged change the main protocol screen not the gpu screen
    
    We only set changes on the main protocol screen as, for example
    in RRSetChanged() and RRTellChanged(), therefore we should follow
    the same logic when reporting that an output changed in
    RROutputChanged().
    
    This means that RRTellChanged() will then update the relevant
    timestamps also when events come from gpu screens.
    
    [ajax: Fix mixed code and decls]
    
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Alberto Milone <alberto.milone at canonical.com>

diff --git a/randr/rroutput.c b/randr/rroutput.c
index 10df4da..d12b9ba 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -31,15 +31,27 @@ RESTYPE RROutputType;
 void
 RROutputChanged(RROutputPtr output, Bool configChanged)
 {
+    /* set changed bits on the master screen only */
     ScreenPtr pScreen = output->pScreen;
+    rrScrPrivPtr mastersp;
 
     output->changed = TRUE;
-    if (pScreen) {
-        rrScrPriv(pScreen);
-        RRSetChanged(pScreen);
-        if (configChanged)
-            pScrPriv->configChanged = TRUE;
+    if (!pScreen)
+        return;
+
+    if (pScreen->isGPU) {
+        ScreenPtr master = pScreen->current_master;
+        if (!master)
+            return;
+        mastersp = rrGetScrPriv(master);
+    }
+    else {
+        mastersp = rrGetScrPriv(pScreen);
     }
+
+    RRSetChanged(pScreen);
+    if (configChanged)
+        mastersp->configChanged = TRUE;
 }
 
 /*
commit 2092f12a243b9f7682f542b593b77c96d455ec89
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Oct 21 11:36:06 2015 +0200

    linux: Do not call FatalError from xf86CloseConsole
    
    FatalError ends up calling xf86CloseConsole itself, so calling FatalError
    from within xf86CloseConsole is not a good idea.
    
    Make switch_to log errors using xf86Msg(X_WARNING, ...) and return success
    (or failure).
    
    This makes switch_to match the other error checking done in xf86CloseConsole
    which all logs warnings and continues.
    
    Add checking of the return value in xf86OpenConsole and call
    FatalError there when switch_to fails, to preserve the error-handling
    behavior of xf86OpenConsole.
    
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1269210
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index ec06a05..1ed213c 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -63,18 +63,24 @@ drain_console(int fd, void *closure)
     }
 }
 
-static void
+static int
 switch_to(int vt, const char *from)
 {
     int ret;
 
     SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt));
-    if (ret < 0)
-        FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno));
+    if (ret < 0) {
+        xf86Msg(X_WARNING, "%s: VT_ACTIVATE failed: %s\n", from, strerror(errno));
+        return 0;
+    }
 
     SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt));
-    if (ret < 0)
-        FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno));
+    if (ret < 0) {
+        xf86Msg(X_WARNING, "%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno));
+        return 0;
+    }
+
+    return 1;
 }
 
 #pragma GCC diagnostic push
@@ -233,7 +239,8 @@ xf86OpenConsole(void)
             /*
              * now get the VT.  This _must_ succeed, or else fail completely.
              */
-            switch_to(xf86Info.vtno, "xf86OpenConsole");
+            if (!switch_to(xf86Info.vtno, "xf86OpenConsole"))
+                FatalError("xf86OpenConsole: Switching VT failed\n");
 
             SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT));
             if (ret < 0)
@@ -294,7 +301,8 @@ xf86OpenConsole(void)
     else {                      /* serverGeneration != 1 */
         if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch) {
             /* now get the VT */
-            switch_to(xf86Info.vtno, "xf86OpenConsole");
+            if (!switch_to(xf86Info.vtno, "xf86OpenConsole"))
+                FatalError("xf86OpenConsole: Switching VT failed\n");
         }
     }
 }
commit ee06f674bbcd796324d6daf69bfb5d8856e94008
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Thu Oct 15 22:28:49 2015 -0700

    Xi: Silence some tautological warnings
    
    xichangehierarchy.c:424:23: warning: comparison of constant 536870911 with expression of type 'uint16_t'
          (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
        if (stuff->length > (INT_MAX >> 2))
            ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
    xichangehierarchy.c:438:26: warning: comparison of constant 536870911 with expression of type 'uint16_t'
          (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
            if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
                 ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 2732445..8d5b577 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -421,9 +421,7 @@ ProcXIChangeHierarchy(ClientPtr client)
     if (!stuff->num_changes)
         return rc;
 
-    if (stuff->length > (INT_MAX >> 2))
-        return BadAlloc;
-    len = (stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo);
+    len = ((size_t)stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo);
 
     any = (xXIAnyHierarchyChangeInfo *) &stuff[1];
     while (stuff->num_changes--) {
@@ -435,7 +433,7 @@ ProcXIChangeHierarchy(ClientPtr client)
         SWAPIF(swaps(&any->type));
         SWAPIF(swaps(&any->length));
 
-        if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
+        if (len < ((size_t)any->length << 2))
             return BadLength;
 
 #define CHANGE_SIZE_MATCH(type) \
commit 113c0bb4fd764da8c08d8f30abe350c7650c9fc2
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Mon Oct 19 23:15:36 2015 +0200

    hurd: fix xorg-wrapper build
    
    hurd does not have any PATH_MAX limitation. misc.h provides a default value
    which is fine here.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>

diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 6f658d7..4c37cfc 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -44,6 +44,8 @@
 #include <xf86drm.h> /* For DRM_DEV_NAME */
 #endif
 
+#include "misc.h"
+
 #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
 
 static const char *progname;
commit f9a04d19aef77bf787b8d322305a6971d24a6ba1
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Sep 21 07:16:12 2015 +0100

    fonts: Continue when font calls return Suspended more than once
    
    Patch 3ab6cd31cbdf8095b2948034fce5fb645422d8da fixed Xinerama
    interactions with font servers by not putting clients to sleep
    multiple times. However, it introduced additional changes dealing with
    libXfont routine returning Suspended more than once for the same
    request. This additional change was to abandon processing of the
    current request and free the closure data by jumping to
    'xinerama_sleep' in each of the functions.
    
    Font library functions shouldn't return Suspended more than once,
    except for ListFontsWithInfo, which produces multiple replies, and
    thus ends up returning Suspended many times during processing.
    
    With the jump to xinerama_sleep occurring after the first reply was
    processed, the closure for the request was freed and future calls into
    the ListFontsWithInfo callback resulted in dereferencing freed
    memory.
    
    This patch removes the added branches, reverting the code to its
    previous behaviour, which permitted multiple Suspended returns and
    simply waited for the client to be signaled again so that the callback
    could continue processing the request.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 968cee4..300bf04 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -313,8 +313,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
         if (err == Suspended) {
             if (!ClientIsAsleep(client))
                 ClientSleep(client, (ClientSleepProcPtr) doOpenFont, c);
-            else
-                goto xinerama_sleep;
             return TRUE;
         }
         break;
@@ -362,7 +360,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
                           c->fontid, FontToXError(err));
     }
     ClientWakeup(c->client);
- xinerama_sleep:
     for (i = 0; i < c->num_fpes; i++) {
         FreeFPE(c->fpe_list[i]);
     }
@@ -595,8 +592,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
                 if (!ClientIsAsleep(client))
                     ClientSleep(client,
                                 (ClientSleepProcPtr) doListFontsAndAliases, c);
-                else
-                    goto xinerama_sleep;
                 return TRUE;
             }
 
@@ -622,8 +617,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
                         ClientSleep(client,
                                     (ClientSleepProcPtr) doListFontsAndAliases,
                                     c);
-                    else
-                        goto xinerama_sleep;
                     return TRUE;
                 }
                 if (err == Successful)
@@ -641,8 +634,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
                         ClientSleep(client,
                                     (ClientSleepProcPtr) doListFontsAndAliases,
                                     c);
-                    else
-                        goto xinerama_sleep;
                     return TRUE;
                 }
                 if (err == FontNameAlias) {
@@ -787,7 +778,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
 
  bail:
     ClientWakeup(client);
- xinerama_sleep:
     for (i = 0; i < c->num_fpes; i++)
         FreeFPE(c->fpe_list[i]);
     free(c->fpe_list);
@@ -887,8 +877,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
                 if (!ClientIsAsleep(client))
                     ClientSleep(client,
                                 (ClientSleepProcPtr) doListFontsWithInfo, c);
-                else
-                    goto xinerama_sleep;
                 return TRUE;
             }
             if (err == Successful)
@@ -904,8 +892,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
                 if (!ClientIsAsleep(client))
                     ClientSleep(client,
                                 (ClientSleepProcPtr) doListFontsWithInfo, c);
-                else
-                    goto xinerama_sleep;
                 return TRUE;
             }
         }
@@ -1039,7 +1025,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
     WriteSwappedDataToClient(client, length, &finalReply);
  bail:
     ClientWakeup(client);
- xinerama_sleep:
     for (i = 0; i < c->num_fpes; i++)
         FreeFPE(c->fpe_list[i]);
     free(c->reply);
@@ -1296,8 +1281,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
                     client_state = START_SLEEP;
                     continue;   /* on to steps 3 and 4 */
                 }
-                else
-                    goto xinerama_sleep;
                 return TRUE;
             }
             else if (lgerr != Successful) {
@@ -1351,7 +1334,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
     }
     if (ClientIsAsleep(client)) {
         ClientWakeup(c->client);
- xinerama_sleep:
         ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
 
         /* Unreference the font from the scratch GC */
@@ -1476,8 +1458,6 @@ doImageText(ClientPtr client, ITclosurePtr c)
 
             ClientSleep(client, (ClientSleepProcPtr) doImageText, c);
         }
-        else
-            goto xinerama_sleep;
         return TRUE;
     }
     else if (lgerr != Successful) {
@@ -1500,7 +1480,6 @@ doImageText(ClientPtr client, ITclosurePtr c)
     }
     if (ClientIsAsleep(client)) {
         ClientWakeup(c->client);
- xinerama_sleep:
         ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
 
         /* Unreference the font from the scratch GC */
commit 5b582a4a0350c253d729efb31b710851ae9a958e
Merge: 1d4aa67 27ad212
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 19 12:23:22 2015 -0400

    Merge remote-tracking branch 'jeremyhu/master'

commit 1d4aa672424d8b1629fda11400b88607b5066965
Author: Julien Cristau <jcristau at debian.org>
Date:   Mon Oct 19 15:42:30 2015 +0200

    xorg-wrapper: when starting the server as root, reset its environment
    
    When the server is privileged, we shouldn't be passing the user's
    environment directly.
    
    Clearing the environment is recommended by the libdbus maintainers, see
    https://bugs.freedesktop.org/show_bug.cgi?id=52202
    
    v2: rename envp to empty_envp (Jeremy)
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83849
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 75d120a..6f658d7 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -194,6 +194,7 @@ int main(int argc, char *argv[])
     int total_cards = 0;
     int allowed = CONSOLE_ONLY;
     int needs_root_rights = -1;
+    char *const empty_envp[1] = { NULL, };
 
     progname = argv[0];
 
@@ -271,7 +272,10 @@ int main(int argc, char *argv[])
     }
 
     argv[0] = buf;
-    (void) execv(argv[0], argv);
+    if (getuid() == geteuid())
+        (void) execv(argv[0], argv);
+    else
+        (void) execve(argv[0], argv, empty_envp);
     fprintf(stderr, "%s: Failed to execute %s: %s\n",
         progname, buf, strerror(errno));
     exit(1);
commit 08c4912406b965bbac0a3a52413c374a073c051b
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Mon Oct 19 14:47:43 2015 +0200

    xorg-wrapper: fix build without libdrm
    
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/configure.ac b/configure.ac
index 7db7187..220478a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -926,8 +926,6 @@ fi
 AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
 
 if test "x$SUID_WRAPPER" = xyes; then
-        dnl The wrapper uses libdrm headers, so ensure they are available
-        PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
         dnl This is a define so that if some platforms want to put the wrapper
         dnl somewhere else this can be easily changed
         AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 22e97ad..75d120a 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -39,8 +39,10 @@
 #include <sys/consio.h>
 #endif
 #include <unistd.h>
+#ifdef WITH_LIBDRM
 #include <drm.h>
 #include <xf86drm.h> /* For DRM_DEV_NAME */
+#endif
 
 #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
 
@@ -183,7 +185,9 @@ static int on_console(int fd)
 
 int main(int argc, char *argv[])
 {
+#ifdef WITH_LIBDRM
     struct drm_mode_card_res res;
+#endif
     char buf[PATH_MAX];
     int i, r, fd;
     int kms_cards = 0;
@@ -219,6 +223,7 @@ int main(int argc, char *argv[])
         }
     }
 
+#ifdef WITH_LIBDRM
     /* Detect if we need root rights, except when overriden by the config */
     if (needs_root_rights == -1) {
         for (i = 0; i < 16; i++) {
@@ -237,6 +242,7 @@ int main(int argc, char *argv[])
             close(fd);
         }
     }
+#endif
 
     /* If we've found cards, and all cards support kms, drop root rights */
     if (needs_root_rights == 0 || (total_cards && kms_cards == total_cards)) {
commit a4cd8ee5f8e8de776c7f764656770311cdbde0d2
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Mon Oct 19 14:47:42 2015 +0200

    hurd: disable detecting drm
    
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/configure.ac b/configure.ac
index e434720..7db7187 100644
--- a/configure.ac
+++ b/configure.ac
@@ -752,6 +752,11 @@ case $host_os in
 			XF86VIDMODE=no
 		fi
 		;;
+	gnu*)
+		DRM=no
+		DRI2=no
+		DRI3=no
+		;;
 	*) XQUARTZ=no ;;
 esac
 


More information about the Xquartz-changes mailing list