[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



Rebased ref, commits from common ancestor:
commit 6703a7c7cf1a349c137e247a0c8eb462ff7b07be
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Jan 8 20:24:32 2013 -0800

    hw/xfree86: Require only one working CRTC to start the server.
    
    Instead of requiring every mode set to complete successfully, start up
    as long as at least one CRTC is working. This avoids failures when one
    or more CRTCs can't start due to mode setting conflicts.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 13251cf..b3ded5a 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2605,6 +2605,7 @@ xf86SetDesiredModes(ScrnInfoPtr scrn)
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CrtcPtr crtc = config->crtc[0];
     int c;
+    int enabled = 0;
 
     /* A driver with this hook will take care of this */
     if (!crtc->funcs->set_mode_major) {
@@ -2655,14 +2656,20 @@ xf86SetDesiredModes(ScrnInfoPtr scrn)
             transform = &crtc->desiredTransform;
         else
             transform = NULL;
-        if (!xf86CrtcSetModeTransform
+        if (xf86CrtcSetModeTransform
             (crtc, &crtc->desiredMode, crtc->desiredRotation, transform,
-             crtc->desiredX, crtc->desiredY))
-            return FALSE;
+             crtc->desiredX, crtc->desiredY)) {
+            ++enabled;
+        } else {
+            for (o = 0; o < config->num_output; o++)
+                if (config->output[o]->crtc == crtc)
+                    config->output[o]->crtc = NULL;
+            crtc->enabled = FALSE;
+	}
     }
 
     xf86DisableUnusedFunctions(scrn);
-    return TRUE;
+    return enabled != 0;
 }
 
 /**

commit 8b328d4ee3873bc0a7a34f2cb9d301827244b98c
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Fri Dec 21 07:37:33 2012 -0800

    dix: Make small bitfields that store enums unsigned
    
    Commit 31bf81772e146af79b0c456aae2159eba8b0280f changed the clientState field
    from a signed int to a signed int 2-bit bitfield.  The ClientState enum that is
    expected to be assigned to this field has four values: ClientStateInitial (0),
    ClientStateRunning (1), ClientStateRetained (2), and ClientStateGone (3).
    However, because this bitfield is signed, ClientStateRetained becomes -2 when
    assigned, and ClientStateGone becomes -1.  This causes warnings:
    
     test.c:54:10: error: case label value exceeds maximum value for type [-Werror]
     test.c:55:10: error: case label value exceeds maximum value for type [-Werror]
    
    The code here is a switch statement:
    
     53     switch (client->clientState) {
     54     case ClientStateGone:
     55     case ClientStateRetained:
     56         [...]
     57         break;
     58
     59     default:
     60         [...]
     61         break;
     62     }
    
    It also causes bizarre problems like this:
    
     client->clientState = ClientStateGone;
     assert(client->clientState == ClientStateGone); // this assert fails
    
    Also change the signedness of nearby bitfields to match.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by:  Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/include/dixstruct.h b/include/dixstruct.h
index c1236f5..6784819 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -90,12 +90,12 @@ typedef struct _Client {
     Mask clientAsMask;
     short index;
     unsigned char majorOp, minorOp;
-    int swapped:1;
-    int local:1;
-    int big_requests:1;          /* supports large requests */
-    int clientGone:1;
-    int closeDownMode:2;
-    int clientState:2;
+    unsigned int swapped:1;
+    unsigned int local:1;
+    unsigned int big_requests:1; /* supports large requests */
+    unsigned int clientGone:1;
+    unsigned int closeDownMode:2;
+    unsigned int clientState:2;
     char smart_priority;
     short noClientException;      /* this client died or needs to be killed */
     int priority;

commit bd91b05b631f13afd1f7a9d6cbc4f0c5408b523a
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Dec 19 12:47:35 2012 -0800

    Update to version 1.13.99.901 (1.14 RC1)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index ee0fa78..435a38f 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.13.99.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-10-04"
-RELEASE_NAME="Horchata"
+AC_INIT([xorg-server], 1.13.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-12-19"
+RELEASE_NAME="Egg Nog"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 

commit 9ff2e831517875f96477862f979abff394e8d551
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Tue Dec 18 00:41:08 2012 -0800

    EnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel
    
    d785368e0e converted the other miinitext functions to use ARRAY_SIZE,
    and removed the sentinel, but missed EnableDisableExtensionError so
    passing an invalid extension name could cause the server to walk off
    the end off the list looking for a sentinel that wasn't there.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/mi/miinitext.c b/mi/miinitext.c
index 369da5e..81c663a 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -212,10 +212,12 @@ EnableDisableExtension(const char *name, Bool enable)
 void
 EnableDisableExtensionError(const char *name, Bool enable)
 {
-    ExtensionToggle *ext = &ExtensionToggleList[0];
+    ExtensionToggle *ext;
+    int i;
     Bool found = FALSE;
 
-    for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
+    for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
+        ext = &ExtensionToggleList[i];
         if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) {
             ErrorF("[mi] Extension \"%s\" can not be disabled\n", name);
             found = TRUE;
@@ -226,7 +228,8 @@ EnableDisableExtensionError(const char *name, Bool enable)
         ErrorF("[mi] Extension \"%s\" is not recognized\n", name);
     ErrorF("[mi] Only the following extensions can be run-time %s:\n",
            enable ? "enabled" : "disabled");
-    for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
+    for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
+        ext = &ExtensionToggleList[i];
         if (ext->disablePtr != NULL) {
             ErrorF("[mi]    %s\n", ext->name);
         }

commit ba4bb3bc1b87eb57cc34d2ad1f302c9d2a15c847
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Tue Dec 18 01:29:12 2012 -0800

    XQuartz: Don't add the 15bit visual any more
    
    Mountain Lion only supports 32bit backing stores, so don't use 15bit visuals until libXplugin adapts
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index bf51180..e0983d6 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -230,13 +230,15 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
     }
 
     // TODO: Make PseudoColor visuals not suck in TrueColor mode
-    //    if(dfb->depth > 8)
-    //        miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
-    if (dfb->depth > 15)
-        miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor,
-                                 RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5,
-                                                              5),
-                                 BM_ARGB(0, 5, 5, 5));
+    // if(dfb->depth > 8)
+    //    miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
+    //
+    // TODO: Re-add support for 15bit
+    // if (dfb->depth > 15)
+    //    miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor,
+    //                             RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5,
+    //                                                          5),
+    //                             BM_ARGB(0, 5, 5, 5));
     if (dfb->depth > 24)
         miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor,
                                  RM_ARGB(0, 8, 8, 8), GM_ARGB(0, 8, 8,
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index efe2aa8..e376019 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -359,6 +359,10 @@ have_depth:
         dfb->blueMask = 0;
         break;
 
+#if 0
+    // Removed because Mountain Lion removed support for
+    // 15bit backing stores.  We can possibly re-add
+    // this once libXplugin is updated to work around it.
     case 15:
         dfb->visuals = TrueColorMask;     //LARGE_VISUALS;
         dfb->preferredCVC = TrueColor;
@@ -369,6 +373,7 @@ have_depth:
         dfb->greenMask = GM_ARGB(0, 5, 5, 5);
         dfb->blueMask = BM_ARGB(0, 5, 5, 5);
         break;
+#endif
 
     //        case 24:
     default:

commit c298f9c42ec05486ac88fc91a84739d7c3e3ea9e
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Tue Dec 18 01:28:02 2012 -0800

    XQuartz: Revert some unfortunate auto-indenting mishaps with our super-nested for-loops
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index e37eefb..03486cd 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -58,40 +58,38 @@
 #include "darwinfb.h"
 
 /* Based originally on code from indirect.c which was based on code from i830_dri.c. */
-__GLXconfig *
-__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
-{
+__GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) {
     int numConfigs = 0;
     __GLXconfig *visualConfigs, *c;
     struct glCapabilities caps;
     struct glCapabilitiesConfig *conf;
     int stereo, depth, aux, buffers, stencil, accum, color, msample;
 
-    if (getGlCapabilities(&caps)) {
+    if(getGlCapabilities(&caps)) {
         ErrorF("error from getGlCapabilities()!\n");
         return NULL;
     }
 
     /*
-       conf->stereo is 0 or 1, but we need at least 1 iteration of the loop,
-       so we treat a true conf->stereo as 2.
+     conf->stereo is 0 or 1, but we need at least 1 iteration of the loop,
+     so we treat a true conf->stereo as 2.
 
-       The depth size is 0 or 24.  Thus we do 2 iterations for that.
+     The depth size is 0 or 24.  Thus we do 2 iterations for that.
 
-       conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1.
+     conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1.
 
-       conf->buffers indicates whether we have single or double buffering.
+     conf->buffers indicates whether we have single or double buffering.
 
-       conf->total_stencil_bit_depths
+     conf->total_stencil_bit_depths
 
-       conf->total_color_buffers indicates the RGB/RGBA color depths.
+     conf->total_color_buffers indicates the RGB/RGBA color depths.
 
-       conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0)
+     conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0)
 
-       conf->total_depth_buffer_depths
+     conf->total_depth_buffer_depths
 
-       conf->multisample_buffers iterations (with at least 1 if equal to 0).  We add 1
-       for the 0 multisampling config.
+     conf->multisample_buffers iterations (with at least 1 if equal to 0).  We add 1
+     for the 0 multisampling config.
 
      */
 
@@ -99,57 +97,43 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
 
     numConfigs = 0;
 
-    for (conf = caps.configurations; conf; conf = conf->next) {
-        if (conf->total_color_buffers <= 0)
+    for(conf = caps.configurations; conf; conf = conf->next) {
+        if(conf->total_color_buffers <= 0)
             continue;
 
         numConfigs += (conf->stereo ? 2 : 1)
-                      * (conf->aux_buffers ? 2 : 1)
-                      * conf->buffers
-                      * ((conf->total_stencil_bit_depths >
-                          0) ? conf->total_stencil_bit_depths : 1)
-                      * conf->total_color_buffers
-                      * ((conf->total_accum_buffers >
-                          0) ? conf->total_accum_buffers : 1)
-                      * conf->total_depth_buffer_depths
-                      * (conf->multisample_buffers + 1);
+	    * (conf->aux_buffers ? 2 : 1)
+	    * conf->buffers
+	    * ((conf->total_stencil_bit_depths > 0) ? conf->total_stencil_bit_depths : 1)
+	    * conf->total_color_buffers
+	    * ((conf->total_accum_buffers > 0) ? conf->total_accum_buffers : 1)
+	    * conf->total_depth_buffer_depths
+	    * (conf->multisample_buffers + 1);
     }
 
-    if (numConfigsPtr)
+    if(numConfigsPtr)
         *numConfigsPtr = numConfigs;
 
     visualConfigs = calloc(sizeof(*visualConfigs), numConfigs);
 
-    if (NULL == visualConfigs) {
+    if(NULL == visualConfigs) {
         ErrorF("xcalloc failure when allocating visualConfigs\n");
         freeGlCapabilities(&caps);
         return NULL;
     }
 
     c = visualConfigs; /* current buffer */
-    for (conf = caps.configurations; conf; conf = conf->next) {
-        for (stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) {
-            for (aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) {
-                for (buffers = 0; buffers < conf->buffers; ++buffers) {
-                    for (stencil = 0;
-                         stencil < ((conf->total_stencil_bit_depths > 0) ?
-                                    conf->
-                                    total_stencil_bit_depths : 1);
-                         ++stencil) {
-                        for (color = 0; color < conf->total_color_buffers;
-                             ++color) {
-                            for (accum = 0;
-                                 accum < ((conf->total_accum_buffers > 0) ?
-                                          conf->
-                                          total_accum_buffers : 1);
-                                 ++accum) {
-                                for (depth = 0;
-                                     depth < conf->total_depth_buffer_depths;
-                                     ++depth) {
-                                    for (msample = 0;
-                                         msample <
-                                         (conf->multisample_buffers + 1);
-                                         ++msample) {
+    for(conf = caps.configurations; conf; conf = conf->next) {
+        for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) {
+            for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) {
+                for(buffers = 0; buffers < conf->buffers; ++buffers) {
+                    for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ?
+                                                conf->total_stencil_bit_depths : 1); ++stencil) {
+                        for(color = 0; color < conf->total_color_buffers; ++color) {
+                            for(accum = 0; accum < ((conf->total_accum_buffers > 0) ?
+                                                    conf->total_accum_buffers : 1); ++accum) {
+                                for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) {
+                                    for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) {
 
                                         // Global
                                         c->visualID = -1;
@@ -162,12 +146,10 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
                                         c->indexBits = 0;
                                         c->pixmapMode = 0; // TODO: What should this be?
 
-                                        if (conf->accelerated) {
+                                        if(conf->accelerated) {
                                             c->visualRating = GLX_NONE;
-                                        }
-                                        else {
-                                            c->visualRating =
-                                                GLX_SLOW_VISUAL_EXT;
+                                        } else {
+                                            c->visualRating = GLX_SLOW_VISUAL_EXT;
                                         }
 
                                         c->transparentPixel = GLX_NONE;
@@ -179,91 +161,52 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
 
                                         c->visualSelectGroup = 0;
 
-                                        c->swapMethod =
-                                            GLX_SWAP_UNDEFINED_OML;
+                                        c->swapMethod = GLX_SWAP_UNDEFINED_OML;
 
                                         // Stereo
                                         c->stereoMode = stereo ? TRUE : FALSE;
 
                                         // Aux buffers
-                                        c->numAuxBuffers =
-                                            aux ? conf->aux_buffers : 0;
+                                        c->numAuxBuffers = aux ? conf->aux_buffers : 0;
 
                                         // Double Buffered
-                                        c->doubleBufferMode =
-                                            buffers ? TRUE : FALSE;
+                                        c->doubleBufferMode = buffers ? TRUE : FALSE;
 
                                         // Stencil Buffer
-                                        if (conf->total_stencil_bit_depths >
-                                            0) {
-                                            c->stencilBits =
-                                                conf->stencil_bit_depths[
-                                                    stencil];
-                                        }
-                                        else {
+                                        if(conf->total_stencil_bit_depths > 0) {
+                                            c->stencilBits = conf->stencil_bit_depths[stencil];
+                                        } else {
                                             c->stencilBits = 0;
                                         }
 
                                         // Color
-                                        if (GLCAPS_COLOR_BUF_INVALID_VALUE !=
-                                            conf->color_buffers[color].a) {
-                                            c->alphaBits =
-                                                conf->color_buffers[color].a;
-                                        }
-                                        else {
+                                        if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) {
+                                            c->alphaBits = conf->color_buffers[color].a;
+                                        } else {
                                             c->alphaBits = 0;
                                         }
-                                        c->redBits =
-                                            conf->color_buffers[color].r;
-                                        c->greenBits =
-                                            conf->color_buffers[color].g;
-                                        c->blueBits =
-                                            conf->color_buffers[color].b;
-
-                                        c->rgbBits = c->alphaBits +
-                                                     c->redBits +
-                                                     c->greenBits +
-                                                     c->blueBits;
-
-                                        c->alphaMask =
-                                            AM_ARGB(c->alphaBits, c->redBits,
-                                                    c->greenBits,
-                                                    c->blueBits);
-                                        c->redMask =
-                                            RM_ARGB(c->alphaBits, c->redBits,
-                                                    c->greenBits,
-                                                    c->blueBits);
-                                        c->greenMask =
-                                            GM_ARGB(c->alphaBits, c->redBits,
-                                                    c->greenBits,
-                                                    c->blueBits);
-                                        c->blueMask =
-                                            BM_ARGB(c->alphaBits, c->redBits,
-                                                    c->greenBits,
-                                                    c->blueBits);
+                                        c->redBits   = conf->color_buffers[color].r;
+                                        c->greenBits = conf->color_buffers[color].g;
+                                        c->blueBits  = conf->color_buffers[color].b;
+
+                                        c->rgbBits = c->alphaBits + c->redBits + c->greenBits + c->blueBits;
+
+                                        c->alphaMask = AM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits);
+                                        c->redMask   = RM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits);
+                                        c->greenMask = GM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits);
+                                        c->blueMask  = BM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits);
 
                                         // Accumulation Buffers
-                                        if (conf->total_accum_buffers > 0) {
-                                            c->accumRedBits =
-                                                conf->accum_buffers[accum].r;
-                                            c->accumGreenBits =
-                                                conf->accum_buffers[accum].g;
-                                            c->accumBlueBits =
-                                                conf->accum_buffers[accum].b;
-                                            if (
-                                                GLCAPS_COLOR_BUF_INVALID_VALUE
-                                                !=
-                                                conf->accum_buffers[accum].a)
-                                            {
-                                                c->accumAlphaBits =
-                                                    conf->accum_buffers[accum
-                                                    ].a;
-                                            }
-                                            else {
+                                        if(conf->total_accum_buffers > 0) {
+                                            c->accumRedBits = conf->accum_buffers[accum].r;
+                                            c->accumGreenBits = conf->accum_buffers[accum].g;
+                                            c->accumBlueBits = conf->accum_buffers[accum].b;
+                                            if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) {
+                                                c->accumAlphaBits = conf->accum_buffers[accum].a;
+                                            } else {
                                                 c->accumAlphaBits = 0;
                                             }
-                                        }
-                                        else {
+                                        } else {
                                             c->accumRedBits = 0;
                                             c->accumGreenBits = 0;
                                             c->accumBlueBits = 0;
@@ -271,17 +214,13 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
                                         }
 
                                         // Depth
-                                        c->depthBits =
-                                            conf->depth_buffers[depth];
+                                        c->depthBits = conf->depth_buffers[depth];
 
                                         // MultiSample
-                                        if (msample > 0) {
-                                            c->samples =
-                                                conf->multisample_samples;
-                                            c->sampleBuffers =
-                                                conf->multisample_buffers;
-                                        }
-                                        else {
+                                        if(msample > 0) {
+                                            c->samples = conf->multisample_samples;
+                                            c->sampleBuffers = conf->multisample_buffers;
+                                        } else {
                                             c->samples = 0;
                                             c->sampleBuffers = 0;
                                         }
@@ -291,9 +230,7 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
                                          * GLXPbuffers in direct mode.
                                          */
                                         /* SGIX_fbconfig / GLX 1.3 */
-                                        c->drawableType = GLX_WINDOW_BIT |
-                                                          GLX_PIXMAP_BIT |
-                                                          GLX_PBUFFER_BIT;
+                                        c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
                                         c->renderType = GLX_RGBA_BIT;
                                         c->xRenderable = GL_TRUE;
                                         c->fbconfigID = -1;
@@ -310,8 +247,7 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
                                          */
                                         c->maxPbufferWidth = 8192;
                                         c->maxPbufferHeight = 8192;
-                                        c->maxPbufferPixels =
-                                            /*Do we need this?*/ 0;
+                                        c->maxPbufferPixels = /*Do we need this?*/ 0;
                                         /*
                                          * There is no introspection for this sort of thing
                                          * with CGL.  What should we do realistically?
@@ -337,12 +273,10 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
         }
     }
 
-    (c - 1)->next = NULL;
+    (c-1)->next = NULL;
 
     if (c - visualConfigs != numConfigs) {
-        FatalError(
-            "numConfigs calculation error in setVisualConfigs!  numConfigs is %d  i is %d\n",
-            numConfigs, (int)(c - visualConfigs));
+        FatalError("numConfigs calculation error in setVisualConfigs!  numConfigs is %d  i is %d\n", numConfigs, (int)(c - visualConfigs));
     }
 
     freeGlCapabilities(&caps);

commit 07a91fa6c6d535f3f05d4c3bd9c4d2b8c382c475
Author: Rob Clark <robdclark@gmail.com>
Date:   Wed Dec 5 23:21:27 2012 +0000

    hw/dmx: fix build without GLX
    
    Fixes this compile break that showed up on arm recently:
    
    dmxinit.c:746:26: error: 'glxSupported' undeclared (first use in this function)
    dmxinit.c:746:26: note: each undeclared identifier is reported only once for each function it appears in
    
    Signed-off-by: Rob Clark <robdclark@gmail.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index 7a50aeb..7de402b 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -740,10 +740,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
     /* Check if GLX extension exists on all back-end servers */
     for (i = 0; i < dmxNumScreens; i++)
         glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
-#endif
 
     if (serverGeneration == 1)
         dmxAddExtensions(glxSupported);
+#endif
 
     /* Tell dix layer about the backend displays */
     for (i = 0; i < dmxNumScreens; i++) {

commit 5692a1e8f5befd3698134b1a5516a4dadda00115
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Dec 6 16:15:50 2012 -0800

    Support compilers with alternate spellings of typeof
    
    The AC_C_TYPEOF adds a #undef typeof to its autogenerated config.h.in
    template, but b8ab93dfbc7f292 didn't copy that to dix-config.h.in
    when HAVE_TYPEOF was, so the macro could claim typeof support but not
    make it work, when used with compilers like Solaris Studio 12.1 which
    only recognize it as __typeof__.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index b270a32..e1cb9eb 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -429,6 +429,9 @@
 /* Define to 1 if typeof works with your compiler. */
 #undef HAVE_TYPEOF
 
+/* Define to __typeof__ if your compiler spells it that way. */
+#undef typeof
+
 /* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */
 #undef TLS
 

commit f793b5fd3eb16a2ada130367c2ffebeede69a322
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Dec 11 13:36:02 2012 +1000

    dix: don't copy the wrong event mask when activating a passive grab
    
    GrabMask is a union of core, XI1 and XI2 masks. If a XI2 grab is activated,
    the value is a random pointer value, using it as mask has unpredictable
    effects.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/grabs.c b/dix/grabs.c
index fe79674..3b02352 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -219,7 +219,10 @@ CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice,
     grab->resource = FakeClientID(client);
     grab->device = device;
     grab->window = window;
-    grab->eventMask = mask->core;       /* same for XI */
+    if (grabtype == CORE || grabtype == XI)
+        grab->eventMask = mask->core;       /* same for XI */
+    else
+        grab->eventMask = 0;
     grab->deviceMask = 0;
     grab->ownerEvents = param->ownerEvents;
     grab->keyboardMode = param->this_device_mode;

commit dd3242c87a0a58cba055eb99c0c3fcf03153e4b8
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Dec 14 11:34:15 2012 +1000

    dix: don't allow overriding a grab with a different type of grab (#58255)
    
    If a client has a core grab, don't allow re-grabbing with type XI2, etc.
    This was the intent of the original commit
    xorg-server-1.5.99.1-782-g09f9a86, but ineffective.
    
    X.Org Bug 58255 <http://bugs.freedesktop.org/show_bug.cgi?id=58255>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/events.c b/dix/events.c
index 31f8d87..3836d2f 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -5043,7 +5043,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
     grab = grabInfo->grab;
     if (grab && grab->grabtype != grabtype)
         *status = AlreadyGrabbed;
-    if (grab && !SameClient(grab, client))
+    else if (grab && !SameClient(grab, client))
         *status = AlreadyGrabbed;
     else if ((!pWin->realized) ||
              (confineTo &&

commit 2eefa5d6e870c57ac6a5930883d8cfe3a3882a43
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Dec 13 14:42:32 2012 +1000

    Xi: if a MD is removed, send a barrier leave event (if applicable)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>

diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 1714634..7b7b83f 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -714,12 +714,41 @@ static void remove_master_func(pointer res, XID id, pointer devid)
     struct PointerBarrierDevice *pbd;
     struct PointerBarrierClient *barrier;
     struct PointerBarrier *b;
+    DeviceIntPtr dev;
     int *deviceid = devid;
+    int rc;
+    Time ms = GetTimeInMillis();
+
+    rc = dixLookupDevice(&dev, *deviceid, serverClient, DixSendAccess);
+    if (rc != Success)
+        return;
 
     b = res;
     barrier = container_of(b, struct PointerBarrierClient, barrier);
 
     pbd = GetBarrierDevice(barrier, *deviceid);
+
+    if (pbd->hit) {
+        BarrierEvent ev = {
+            .header = ET_Internal,
+            .type =ET_BarrierLeave,
+            .length = sizeof (BarrierEvent),
+            .time = ms,
+            .deviceid = *deviceid,
+            .sourceid = 0,
+            .dx = 0,
+            .dy = 0,
+            .root = barrier->screen->root->drawable.id,
+            .window = barrier->window,
+            .dt = ms - pbd->last_timestamp,
+            .flags = XIBarrierPointerReleased,
+            .event_id = pbd->barrier_event_id,
+            .barrierid = barrier->id,
+        };
+
+        mieqEnqueue(dev, (InternalEvent *) &ev);
+    }
+
     xorg_list_del(&pbd->entry);
     free(pbd);
 }
@@ -731,7 +760,6 @@ void XIBarrierNewMasterDevice(ClientPtr client, int deviceid)
 
 void XIBarrierRemoveMasterDevice(ClientPtr client, int deviceid)
 {
-    /* FIXME: send LeaveNotify */
     FindClientResourcesByType(client, PointerBarrierType, remove_master_func, &deviceid);
 }
 

commit e2423b627ef7e4d08ea0685af5e771ddd2b511ce
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Dec 13 14:04:13 2012 +1000

    Xi: don't store the window pointer in barriers, store the window ID
    
    When a client shuts down and resources are being freed, the window may have
    been freed already, so accessing it to get the window ID is bad. Plus, we
    never care about the window anyway other than for stuffing it into the
    event.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>

diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 7e8b2e6..1714634 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -80,7 +80,7 @@ struct PointerBarrierDevice {
 struct PointerBarrierClient {
     XID id;
     ScreenPtr screen;
-    WindowPtr window;
+    Window window;
     struct PointerBarrier barrier;
     struct xorg_list entry;
     /* num_devices/device_ids are devices the barrier applies to */
@@ -467,7 +467,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
         ev.barrierid = c->id;
 
         ev.dt = ms - pbd->last_timestamp;
-        ev.window = c->window->drawable.id;
+        ev.window = c->window;
         pbd->last_timestamp = ms;
 
         /* root x/y is filled in later */
@@ -501,7 +501,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
         ev.barrierid = c->id;
 
         ev.dt = ms - pbd->last_timestamp;
-        ev.window = c->window->drawable.id;
+        ev.window = c->window;
         pbd->last_timestamp = ms;
 
         /* root x/y is filled in later */
@@ -566,7 +566,7 @@ CreatePointerBarrierClient(ClientPtr client,
     cs = GetBarrierScreen(screen);
 
     ret->screen = screen;
-    ret->window = pWin;
+    ret->window = stuff->window;
     ret->num_devices = stuff->num_devices;
     if (ret->num_devices > 0)
         ret->device_ids = (int*)&ret[1];
@@ -656,7 +656,7 @@ BarrierFreeBarrier(void *data, XID id)
             /* .deviceid */
             .sourceid = 0,
             .barrierid = c->id,
-            .window = c->window->drawable.id,
+            .window = c->window,
             .root = screen->root->drawable.id,
             .dx = 0,
             .dy = 0,

commit f71c2f895c9e2f9d0d42feaac2a3e1d2deb71f67
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Dec 12 15:41:32 2012 +1000

    Xi: fix per-device barrier handling
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>

diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 048af62..7e8b2e6 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -67,19 +67,28 @@ static DevPrivateKeyRec BarrierScreenPrivateKeyRec;
 
 typedef struct PointerBarrierClient *PointerBarrierClientPtr;
 
+struct PointerBarrierDevice {
+    struct xorg_list entry;
+    int deviceid;
+    Time last_timestamp;
+    int barrier_event_id;
+    int release_event_id;
+    Bool hit;
+    Bool seen;
+};
+
 struct PointerBarrierClient {
     XID id;
     ScreenPtr screen;
     WindowPtr window;
     struct PointerBarrier barrier;
     struct xorg_list entry;
+    /* num_devices/device_ids are devices the barrier applies to */
     int num_devices;
     int *device_ids; /* num_devices */
-    Time last_timestamp;
-    int barrier_event_id;
-    int release_event_id;
-    Bool hit;
-    Bool seen;
+
+    /* per_device keeps track of devices actually blocked by barriers */
+    struct xorg_list per_device;
 };
 
 typedef struct _BarrierScreen {
@@ -90,6 +99,47 @@ typedef struct _BarrierScreen {
 #define GetBarrierScreenIfSet(s) GetBarrierScreen(s)
 #define SetBarrierScreen(s,p) dixSetPrivate(&(s)->devPrivates, BarrierScreenPrivateKey, p)
 
+static struct PointerBarrierDevice *AllocBarrierDevice(void)
+{
+    struct PointerBarrierDevice *pbd = NULL;
+
+    pbd = malloc(sizeof(struct PointerBarrierDevice));
+    if (!pbd)
+        return NULL;
+
+    pbd->deviceid = -1; /* must be set by caller */
+    pbd->barrier_event_id = 1;
+    pbd->release_event_id = 0;
+    pbd->hit = FALSE;
+    pbd->seen = FALSE;
+    xorg_list_init(&pbd->entry);
+
+    return pbd;
+}
+
+static void FreePointerBarrierClient(struct PointerBarrierClient *c)
+{
+    struct PointerBarrierDevice *pbd = NULL, *tmp = NULL;
+
+    xorg_list_for_each_entry_safe(pbd, tmp, &c->per_device, entry) {
+        free(pbd);
+    }
+    free(c);
+}
+
+static struct PointerBarrierDevice *GetBarrierDevice(struct PointerBarrierClient *c, int deviceid)
+{
+    struct PointerBarrierDevice *pbd = NULL;
+
+    xorg_list_for_each_entry(pbd, &c->per_device, entry) {
+        if (pbd->deviceid == deviceid)
+            break;
+    }
+
+    BUG_WARN(!pbd);
+    return pbd;
+}
+
 static BOOL
 barrier_is_horizontal(const struct PointerBarrier *barrier)
 {
@@ -283,9 +333,11 @@ barrier_find_nearest(BarrierScreenPtr cs, DeviceIntPtr dev,
 
     xorg_list_for_each_entry(c, &cs->barriers, entry) {
         struct PointerBarrier *b = &c->barrier;
+        struct PointerBarrierDevice *pbd;
         double distance;
 
-        if (c->seen)
+        pbd = GetBarrierDevice(c, dev->id);
+        if (pbd->seen)
             continue;
 
         if (!barrier_is_blocking_direction(b, dir))
@@ -358,6 +410,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
         .root = screen->root->drawable.id,
     };
     InternalEvent *barrier_events = events;
+    DeviceIntPtr master;
 
     if (nevents)
         *nevents = 0;
@@ -365,6 +418,13 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
     if (xorg_list_is_empty(&cs->barriers) || IsFloating(dev))
         goto out;
 
+    /**
+     * This function is only called for slave devices, but pointer-barriers
+     * are for master-devices only. Flip the device to the master here,
+     * continue with that.
+     */
+    master = GetMaster(dev, MASTER_POINTER);
+
     /* How this works:
      * Given the origin and the movement vector, get the nearest barrier
      * to the origin that is blocking the movement.
@@ -375,16 +435,19 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
     dir = barrier_get_direction(current_x, current_y, x, y);
 
     while (dir != 0) {
-        c = barrier_find_nearest(cs, dev, dir, current_x, current_y, x, y);
+        struct PointerBarrierDevice *pbd;
+
+        c = barrier_find_nearest(cs, master, dir, current_x, current_y, x, y);
         if (!c)
             break;
 
         nearest = &c->barrier;
 
-        c->seen = TRUE;
-        c->hit = TRUE;
+        pbd = GetBarrierDevice(c, master->id);
+        pbd->seen = TRUE;
+        pbd->hit = TRUE;
 
-        if (c->barrier_event_id == c->release_event_id)
+        if (pbd->barrier_event_id == pbd->release_event_id)
             continue;
 
         ev.type = ET_BarrierHit;
@@ -400,12 +463,12 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
         }
 
         ev.flags = 0;
-        ev.event_id = c->barrier_event_id;
+        ev.event_id = pbd->barrier_event_id;
         ev.barrierid = c->id;
 


Reply to: