xserver: Branch 'master' - 11 commits

Adam Jackson ajax at kemper.freedesktop.org
Tue Jun 20 20:41:45 UTC 2017


 Xext/xselinux_ext.c                |    2 -
 dix/extension.c                    |   47 ++-------------------------
 glx/glxcmds.c                      |    9 ++---
 glx/glxcontext.h                   |   14 ++------
 glx/glxdri2.c                      |   10 +----
 glx/glxdriswrast.c                 |   43 ++++---------------------
 glx/glxext.c                       |    9 -----
 glx/indirect_program.c             |    3 +
 glx/indirect_texture_compression.c |    6 ++-
 glx/indirect_util.c                |   32 +++++++++---------
 glx/single2.c                      |    2 +
 glx/single2swap.c                  |    1 
 glx/singlepix.c                    |   26 +++++++++------
 glx/singlepixswap.c                |   26 +++++++++------
 glx/unpack.h                       |   42 +++++-------------------
 hw/dmx/dmxinit.c                   |   63 -------------------------------------
 hw/dmx/glxProxy/glxext.c           |    6 ---
 hw/dmx/input/usb-keyboard.c        |    3 +
 hw/xfree86/common/xf86.h           |    3 -
 hw/xfree86/common/xf86Events.c     |   42 +-----------------------
 hw/xfree86/common/xf86pciBus.c     |   12 +++++++
 hw/xfree86/common/xf86str.h        |    2 +
 hw/xfree86/dri/dri.c               |   12 -------
 hw/xfree86/dri/dri.h               |    2 -
 hw/xwin/glx/indirect.c             |    8 +---
 include/extnsionst.h               |   11 ------
 26 files changed, 112 insertions(+), 324 deletions(-)

New commits:
commit 525db17e04d5cabaeefd20e38cebe7d606047a76
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:52 2017 -0400

    glx/drisw: Use scratch GCs for swrastPutImage
    
    The scratch GC defaults to the same state as our persistent GCs. Except
    for the "draw" GC, which would generate graphics exposures for... well,
    no reason really, PutImage doesn't generate graphics exposures.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 6b546d8ed..396b68911 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -82,9 +82,6 @@ struct __GLXDRIdrawable {
     __GLXdrawable base;
     __DRIdrawable *driDrawable;
     __GLXDRIscreen *screen;
-
-    GCPtr gc;                   /* scratch GC for span drawing */
-    GCPtr swapgc;               /* GC for swapping the color buffers */
 };
 
 /* white lie */
@@ -98,9 +95,6 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable)
 
     (*core->destroyDrawable) (private->driDrawable);
 
-    FreeGC(private->gc, (GContext) 0);
-    FreeGC(private->swapgc, (GContext) 0);
-
     __glXDrawableRelease(drawable);
 
     free(private);
@@ -258,8 +252,6 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
                              XID drawId,
                              int type, XID glxDrawId, __GLXconfig * glxConfig)
 {
-    XID gcvals[2];
-    int status;
     __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
     __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
     __GLXDRIdrawable *private;
@@ -279,14 +271,6 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
     private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
     private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
 
-    gcvals[0] = GXcopy;
-    private->gc =
-        CreateGC(pDraw, GCFunction, gcvals, &status, (XID) 0, serverClient);
-    gcvals[1] = FALSE;
-    private->swapgc =
-        CreateGC(pDraw, GCFunction | GCGraphicsExposures, gcvals, &status,
-                 (XID) 0, serverClient);
-
     private->driDrawable =
         (*driScreen->swrast->createNewDrawable) (driScreen->driScreen,
                                                  config->driConfig, private);
@@ -316,20 +300,13 @@ swrastPutImage(__DRIdrawable * draw, int op,
     GCPtr gc;
     __GLXcontext *cx = lastGLContext;
 
-    switch (op) {
-    case __DRI_SWRAST_IMAGE_OP_DRAW:
-        gc = drawable->gc;
-        break;
-    case __DRI_SWRAST_IMAGE_OP_SWAP:
-        gc = drawable->swapgc;
-        break;
-    default:
-        return;
+    if ((gc = GetScratchGC(pDraw->depth, pDraw->pScreen))) {
+        ValidateGC(pDraw, gc);
+        gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap,
+                          data);
+        FreeScratchGC(gc);
     }
 
-    ValidateGC(pDraw, gc);
-
-    gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, data);
     if (cx != lastGLContext) {
         lastGLContext = cx;
         cx->makeCurrent(cx);
commit ecc5e362985d1f649c29ac5f93be19851eaf7d87
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:51 2017 -0400

    glx/drisw: Remove unused glx_enable_bits
    
    Sloppy of me!
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index d7d64b3d9..6b546d8ed 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -71,8 +71,6 @@ struct __GLXDRIscreen {
     const __DRIcopySubBufferExtension *copySubBuffer;
     const __DRItexBufferExtension *texBuffer;
     const __DRIconfig **driConfigs;
-
-    unsigned char glx_enable_bits[__GLX_EXT_BYTES];
 };
 
 struct __GLXDRIcontext {
commit a6c23ef31a4e5aea19ddabdf4a0760f4c48f1ebe
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:50 2017 -0400

    glx/dri2: Don't chirp when falling back to software
    
    This isn't an error if the screen isn't accelerated in the first place.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index eae3748a9..701944283 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -1021,8 +1021,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     free(screen);
 
-    LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
-
     return NULL;
 }
 
commit 0b1831d043028f7dd6accca19a81e2abd9a145b5
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:49 2017 -0400

    glx: Remove some indirection around EXT_texture_from_pixmap
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 508815b9d..ac21136b1 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1807,10 +1807,10 @@ __glXDisp_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc)
                           DixReadAccess, &pGlxDraw, &error))
         return error;
 
-    if (!context->textureFromPixmap)
+    if (!context->bindTexImage)
         return __glXError(GLXUnsupportedPrivateRequest);
 
-    return context->textureFromPixmap->bindTexImage(context, buffer, pGlxDraw);
+    return context->bindTexImage(context, buffer, pGlxDraw);
 }
 
 int
@@ -1839,11 +1839,10 @@ __glXDisp_ReleaseTexImageEXT(__GLXclientState * cl, GLbyte * pc)
                           DixReadAccess, &pGlxDraw, &error))
         return error;
 
-    if (!context->textureFromPixmap)
+    if (!context->releaseTexImage)
         return __glXError(GLXUnsupportedPrivateRequest);
 
-    return context->textureFromPixmap->releaseTexImage(context,
-                                                       buffer, pGlxDraw);
+    return context->releaseTexImage(context, buffer, pGlxDraw);
 }
 
 int
diff --git a/glx/glxcontext.h b/glx/glxcontext.h
index edbd491ff..19d347fdb 100644
--- a/glx/glxcontext.h
+++ b/glx/glxcontext.h
@@ -35,14 +35,6 @@
  * Silicon Graphics, Inc.
  */
 
-typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
-struct __GLXtextureFromPixmap {
-    int (*bindTexImage) (__GLXcontext * baseContext,
-                         int buffer, __GLXdrawable * pixmap);
-    int (*releaseTexImage) (__GLXcontext * baseContext,
-                            int buffer, __GLXdrawable * pixmap);
-};
-
 struct __GLXcontext {
     void (*destroy) (__GLXcontext * context);
     int (*makeCurrent) (__GLXcontext * context);
@@ -50,7 +42,11 @@ struct __GLXcontext {
     int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask);
     Bool (*wait) (__GLXcontext * context, __GLXclientState * cl, int *error);
 
-    __GLXtextureFromPixmap *textureFromPixmap;
+    /* EXT_texture_from_pixmap */
+    int (*bindTexImage) (__GLXcontext * baseContext,
+                         int buffer, __GLXdrawable * pixmap);
+    int (*releaseTexImage) (__GLXcontext * baseContext,
+                            int buffer, __GLXdrawable * pixmap);
 
     /*
      ** list of context structs
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 484b4aeab..eae3748a9 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -335,11 +335,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
     return Success;
 }
 
-static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
-    __glXDRIbindTexImage,
-    __glXDRIreleaseTexImage
-};
-
 static Bool
 dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
                          const uint32_t *attribs,
@@ -561,7 +556,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     context->base.makeCurrent = __glXDRIcontextMakeCurrent;
     context->base.loseCurrent = __glXDRIcontextLoseCurrent;
     context->base.copy = __glXDRIcontextCopy;
-    context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
+    context->base.bindTexImage = __glXDRIbindTexImage;
+    context->base.releaseTexImage = __glXDRIreleaseTexImage;
     context->base.wait = __glXDRIcontextWait;
 
     create_driver_context(context, screen, config, driShare, num_attribs,
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index ed0469fd6..d7d64b3d9 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -208,11 +208,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
     return Success;
 }
 
-static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
-    __glXDRIbindTexImage,
-    __glXDRIreleaseTexImage
-};
-
 static __GLXcontext *
 __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                             __GLXconfig * glxConfig,
@@ -248,7 +243,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     context->base.makeCurrent = __glXDRIcontextMakeCurrent;
     context->base.loseCurrent = __glXDRIcontextLoseCurrent;
     context->base.copy = __glXDRIcontextCopy;
-    context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
+    context->base.bindTexImage = __glXDRIbindTexImage;
+    context->base.releaseTexImage = __glXDRIreleaseTexImage;
 
     context->driContext =
         (*core->createNewContext) (screen->driScreen,
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 239327ed4..ad79d249d 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -1522,11 +1522,6 @@ glxWinCreateContext(__GLXscreen * screen,
     __GLXWinContext *context;
     __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;
 
-    static __GLXtextureFromPixmap glxWinTextureFromPixmap = {
-        glxWinBindTexImage,
-        glxWinReleaseTexImage
-    };
-
     context = calloc(1, sizeof(__GLXWinContext));
 
     if (!context)
@@ -1537,7 +1532,8 @@ glxWinCreateContext(__GLXscreen * screen,
     context->base.makeCurrent = glxWinContextMakeCurrent;
     context->base.loseCurrent = glxWinContextLoseCurrent;
     context->base.copy = glxWinContextCopy;
-    context->base.textureFromPixmap = &glxWinTextureFromPixmap;
+    context->base.bindTexImage = glxWinBindTexImage;
+    context->base.releaseTexImage = glxWinReleaseTexImage;
     context->base.config = modes;
     context->base.pGlxScreen = screen;
 
commit c33541e59e338cd53f89d94a6898555d350e84aa
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:48 2017 -0400

    glx: Remove __glXReply
    
    Static data bad, hulk smash.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxext.c b/glx/glxext.c
index 091dd75c1..e88bbd107 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -53,11 +53,6 @@
 RESTYPE __glXContextRes;
 RESTYPE __glXDrawableRes;
 
-/*
-** Reply for most singles.
-*/
-xGLXSingleReply __glXReply;
-
 static DevPrivateKeyRec glxClientPrivateKeyRec;
 
 #define glxClientPrivateKey (&glxClientPrivateKeyRec)
diff --git a/glx/indirect_program.c b/glx/indirect_program.c
index 5caee7b2a..69a050820 100644
--- a/glx/indirect_program.c
+++ b/glx/indirect_program.c
@@ -64,6 +64,7 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc,
         GLenum pname;
         GLint compsize = 0;
         char *answer = NULL, answerBuffer[200];
+        xGLXSingleReply reply = { 0, };
 
         if (do_swap) {
             target = (GLenum) bswap_32(*(int *) (pc + 0));
@@ -92,7 +93,7 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc,
         }
         else {
             __GLX_BEGIN_REPLY(compsize);
-            ((xGLXGetTexImageReply *) &__glXReply)->width = compsize;
+            ((xGLXGetTexImageReply *) &reply)->width = compsize;
             __GLX_SEND_HEADER();
             __GLX_SEND_VOID_ARRAY(compsize);
         }
diff --git a/glx/indirect_texture_compression.c b/glx/indirect_texture_compression.c
index 1ebf7f3a2..6d25bcd04 100644
--- a/glx/indirect_texture_compression.c
+++ b/glx/indirect_texture_compression.c
@@ -51,6 +51,7 @@ __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
         const GLint level = *(GLint *) (pc + 4);
         GLint compsize = 0;
         char *answer = NULL, answerBuffer[200];
+        xGLXSingleReply reply = { 0, };
 
         glGetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
                                  &compsize);
@@ -69,7 +70,7 @@ __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
         }
         else {
             __GLX_BEGIN_REPLY(compsize);
-            ((xGLXGetTexImageReply *) &__glXReply)->width = compsize;
+            ((xGLXGetTexImageReply *) &reply)->width = compsize;
             __GLX_SEND_HEADER();
             __GLX_SEND_VOID_ARRAY(compsize);
         }
@@ -97,6 +98,7 @@ __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
         const GLint level = (GLint) bswap_32(*(int *) (pc + 4));
         GLint compsize = 0;
         char *answer = NULL, answerBuffer[200];
+        xGLXSingleReply reply = { 0, };
 
         glGetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
                                  &compsize);
@@ -115,7 +117,7 @@ __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
         }
         else {
             __GLX_BEGIN_REPLY(compsize);
-            ((xGLXGetTexImageReply *) &__glXReply)->width = compsize;
+            ((xGLXGetTexImageReply *) &reply)->width = compsize;
             __GLX_SEND_HEADER();
             __GLX_SEND_VOID_ARRAY(compsize);
         }
diff --git a/glx/indirect_util.c b/glx/indirect_util.c
index 9ba28157c..dccffa393 100644
--- a/glx/indirect_util.c
+++ b/glx/indirect_util.c
@@ -45,8 +45,6 @@
 
 #define __GLX_PAD(a) (((a)+3)&~3)
 
-extern xGLXSingleReply __glXReply;
-
 GLint
 __glGetBooleanv_variable_size(GLenum e)
 {
@@ -117,6 +115,7 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
                size_t element_size, GLboolean always_array, CARD32 retval)
 {
     size_t reply_ints = 0;
+    xGLXSingleReply reply = { 0, };
 
     if (__glXErrorOccured()) {
         elements = 0;
@@ -125,11 +124,11 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
         reply_ints = bytes_to_int32(elements * element_size);
     }
 
-    __glXReply.length = reply_ints;
-    __glXReply.type = X_Reply;
-    __glXReply.sequenceNumber = client->sequence;
-    __glXReply.size = elements;
-    __glXReply.retval = retval;
+    reply.length = reply_ints;
+    reply.type = X_Reply;
+    reply.sequenceNumber = client->sequence;
+    reply.size = elements;
+    reply.retval = retval;
 
     /* It is faster on almost always every architecture to just copy the 8
      * bytes, even when not necessary, than check to see of the value of
@@ -137,8 +136,8 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
      * harm.
      */
 
-    (void) memcpy(&__glXReply.pad3, data, 8);
-    WriteToClient(client, sz_xGLXSingleReply, &__glXReply);
+    (void) memcpy(&reply.pad3, data, 8);
+    WriteToClient(client, sz_xGLXSingleReply, &reply);
 
     if (reply_ints != 0) {
         WriteToClient(client, reply_ints * 4, data);
@@ -163,6 +162,7 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
                    size_t element_size, GLboolean always_array, CARD32 retval)
 {
     size_t reply_ints = 0;
+    xGLXSingleReply reply = { 0, };
 
     if (__glXErrorOccured()) {
         elements = 0;
@@ -171,11 +171,11 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
         reply_ints = bytes_to_int32(elements * element_size);
     }
 
-    __glXReply.length = bswap_32(reply_ints);
-    __glXReply.type = X_Reply;
-    __glXReply.sequenceNumber = bswap_16(client->sequence);
-    __glXReply.size = bswap_32(elements);
-    __glXReply.retval = bswap_32(retval);
+    reply.length = bswap_32(reply_ints);
+    reply.type = X_Reply;
+    reply.sequenceNumber = bswap_16(client->sequence);
+    reply.size = bswap_32(elements);
+    reply.retval = bswap_32(retval);
 
     /* It is faster on almost always every architecture to just copy the 8
      * bytes, even when not necessary, than check to see of the value of
@@ -183,8 +183,8 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
      * harm.
      */
 
-    (void) memcpy(&__glXReply.pad3, data, 8);
-    WriteToClient(client, sz_xGLXSingleReply, &__glXReply);
+    (void) memcpy(&reply.pad3, data, 8);
+    WriteToClient(client, sz_xGLXSingleReply, &reply);
 
     if (reply_ints != 0) {
         WriteToClient(client, reply_ints * 4, data);
diff --git a/glx/single2.c b/glx/single2.c
index 62dcd79ef..e7488194b 100644
--- a/glx/single2.c
+++ b/glx/single2.c
@@ -232,6 +232,7 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
     ClientPtr client = cl->client;
     __GLXcontext *cx;
     int error;
+    xGLXSingleReply reply = { 0, };
 
     REQUEST_SIZE_MATCH(xGLXSingleReq);
 
@@ -328,6 +329,7 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
     __GLXcontext *cx;
     GLenum name;
     const char *string;
+    xGLXSingleReply reply = { 0, };
 
     __GLX_DECLARE_SWAP_VARIABLES;
     int error;
diff --git a/glx/single2swap.c b/glx/single2swap.c
index c1df248e8..b140946ba 100644
--- a/glx/single2swap.c
+++ b/glx/single2swap.c
@@ -252,6 +252,7 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
     ClientPtr client = cl->client;
     __GLXcontext *cx;
     int error;
+    xGLXSingleReply reply = { 0, };
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
diff --git a/glx/singlepix.c b/glx/singlepix.c
index b253a59be..e1bed19aa 100644
--- a/glx/singlepix.c
+++ b/glx/singlepix.c
@@ -50,6 +50,7 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
     ClientPtr client = cl->client;
     int error;
     char *answer, answerBuffer[200];
+    xGLXSingleReply reply = { 0, };
 
     REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
 
@@ -100,6 +101,7 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc)
     int error;
     char *answer, answerBuffer[200];
     GLint width = 0, height = 0, depth = 1;
+    xGLXSingleReply reply = { 0, };
 
     REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
 
@@ -141,9 +143,9 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc)
     }
     else {
         __GLX_BEGIN_REPLY(compsize);
-        ((xGLXGetTexImageReply *) &__glXReply)->width = width;
-        ((xGLXGetTexImageReply *) &__glXReply)->height = height;
-        ((xGLXGetTexImageReply *) &__glXReply)->depth = depth;
+        ((xGLXGetTexImageReply *) &reply)->width = width;
+        ((xGLXGetTexImageReply *) &reply)->height = height;
+        ((xGLXGetTexImageReply *) &reply)->depth = depth;
         __GLX_SEND_HEADER();
         __GLX_SEND_VOID_ARRAY(compsize);
     }
@@ -159,6 +161,7 @@ __glXDisp_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc)
     int error;
     GLubyte answerBuffer[200];
     char *answer;
+    xGLXSingleReply reply = { 0, };
 
     REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
 
@@ -199,6 +202,7 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     int error;
     char *answer, answerBuffer[200];
     GLint width = 0, height = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -239,8 +243,8 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     }
     else {
         __GLX_BEGIN_REPLY(compsize + compsize2);
-        ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width;
-        ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height;
+        ((xGLXGetSeparableFilterReply *) &reply)->width = width;
+        ((xGLXGetSeparableFilterReply *) &reply)->height = height;
         __GLX_SEND_HEADER();
         __GLX_SEND_VOID_ARRAY(compsize + compsize2);
     }
@@ -277,6 +281,7 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     int error;
     char *answer, answerBuffer[200];
     GLint width = 0, height = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -315,8 +320,8 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     }
     else {
         __GLX_BEGIN_REPLY(compsize);
-        ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width;
-        ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height;
+        ((xGLXGetConvolutionFilterReply *) &reply)->width = width;
+        ((xGLXGetConvolutionFilterReply *) &reply)->height = height;
         __GLX_SEND_HEADER();
         __GLX_SEND_VOID_ARRAY(compsize);
     }
@@ -353,6 +358,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     int error;
     char *answer, answerBuffer[200];
     GLint width = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -385,7 +391,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     }
     else {
         __GLX_BEGIN_REPLY(compsize);
-        ((xGLXGetHistogramReply *) &__glXReply)->width = width;
+        ((xGLXGetHistogramReply *) &reply)->width = width;
         __GLX_SEND_HEADER();
         __GLX_SEND_VOID_ARRAY(compsize);
     }
@@ -421,6 +427,7 @@ GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     ClientPtr client = cl->client;
     int error;
     char *answer, answerBuffer[200];
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -484,6 +491,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     int error;
     char *answer, answerBuffer[200];
     GLint width = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -516,7 +524,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     }
     else {
         __GLX_BEGIN_REPLY(compsize);
-        ((xGLXGetColorTableReply *) &__glXReply)->width = width;
+        ((xGLXGetColorTableReply *) &reply)->width = width;
         __GLX_SEND_HEADER();
         __GLX_SEND_VOID_ARRAY(compsize);
     }
diff --git a/glx/singlepixswap.c b/glx/singlepixswap.c
index 684f4e834..8e4d9bddf 100644
--- a/glx/singlepixswap.c
+++ b/glx/singlepixswap.c
@@ -52,6 +52,7 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc)
     ClientPtr client = cl->client;
     int error;
     char *answer, answerBuffer[200];
+    xGLXSingleReply reply = { 0, };
 
     REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
 
@@ -114,6 +115,7 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc)
     int error;
     char *answer, answerBuffer[200];
     GLint width = 0, height = 0, depth = 1;
+    xGLXSingleReply reply = { 0, };
 
     REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
 
@@ -166,9 +168,9 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc)
         __GLX_SWAP_INT(&width);
         __GLX_SWAP_INT(&height);
         __GLX_SWAP_INT(&depth);
-        ((xGLXGetTexImageReply *) &__glXReply)->width = width;
-        ((xGLXGetTexImageReply *) &__glXReply)->height = height;
-        ((xGLXGetTexImageReply *) &__glXReply)->depth = depth;
+        ((xGLXGetTexImageReply *) &reply)->width = width;
+        ((xGLXGetTexImageReply *) &reply)->height = height;
+        ((xGLXGetTexImageReply *) &reply)->depth = depth;
         __GLX_SEND_HEADER();
         __GLX_SEND_VOID_ARRAY(compsize);
     }
@@ -184,6 +186,7 @@ __glXDispSwap_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc)
     int error;
     GLubyte answerBuffer[200];
     char *answer;
+    xGLXSingleReply reply = { 0, };
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
@@ -229,6 +232,7 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     __GLX_DECLARE_SWAP_VARIABLES;
     char *answer, answerBuffer[200];
     GLint width = 0, height = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -276,8 +280,8 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
         __GLX_SWAP_REPLY_HEADER();
         __GLX_SWAP_INT(&width);
         __GLX_SWAP_INT(&height);
-        ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width;
-        ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height;
+        ((xGLXGetSeparableFilterReply *) &reply)->width = width;
+        ((xGLXGetSeparableFilterReply *) &reply)->height = height;
         __GLX_SEND_VOID_ARRAY(compsize + compsize2);
     }
 
@@ -317,6 +321,7 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     __GLX_DECLARE_SWAP_VARIABLES;
     char *answer, answerBuffer[200];
     GLint width = 0, height = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -362,8 +367,8 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
         __GLX_SWAP_REPLY_HEADER();
         __GLX_SWAP_INT(&width);
         __GLX_SWAP_INT(&height);
-        ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width;
-        ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height;
+        ((xGLXGetConvolutionFilterReply *) &reply)->width = width;
+        ((xGLXGetConvolutionFilterReply *) &reply)->height = height;
         __GLX_SEND_VOID_ARRAY(compsize);
     }
 
@@ -403,6 +408,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     __GLX_DECLARE_SWAP_VARIABLES;
     char *answer, answerBuffer[200];
     GLint width = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -441,7 +447,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
         __GLX_BEGIN_REPLY(compsize);
         __GLX_SWAP_REPLY_HEADER();
         __GLX_SWAP_INT(&width);
-        ((xGLXGetHistogramReply *) &__glXReply)->width = width;
+        ((xGLXGetHistogramReply *) &reply)->width = width;
         __GLX_SEND_VOID_ARRAY(compsize);
     }
 
@@ -480,6 +486,7 @@ GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
 
     __GLX_DECLARE_SWAP_VARIABLES;
     char *answer, answerBuffer[200];
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -551,6 +558,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
     __GLX_DECLARE_SWAP_VARIABLES;
     char *answer, answerBuffer[200];
     GLint width = 0;
+    xGLXSingleReply reply = { 0, };
 
     cx = __glXForceCurrent(cl, tag, &error);
     if (!cx) {
@@ -589,7 +597,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag)
         __GLX_BEGIN_REPLY(compsize);
         __GLX_SWAP_REPLY_HEADER();
         __GLX_SWAP_INT(&width);
-        ((xGLXGetColorTableReply *) &__glXReply)->width = width;
+        ((xGLXGetColorTableReply *) &reply)->width = width;
         __GLX_SEND_VOID_ARRAY(compsize);
     }
 
diff --git a/glx/unpack.h b/glx/unpack.h
index 2b1ebcf02..9676e64c4 100644
--- a/glx/unpack.h
+++ b/glx/unpack.h
@@ -53,26 +53,19 @@
 #define __GLX_GET_DOUBLE(dst,src)	(dst) = *((GLdouble*)(src))
 #endif
 
-extern void __glXMemInit(void);
-
-extern xGLXSingleReply __glXReply;
-
 #define __GLX_BEGIN_REPLY(size) \
-  	__glXReply.length = __GLX_PAD(size) >> 2;	\
-  	__glXReply.type = X_Reply; 			\
-  	__glXReply.sequenceNumber = client->sequence;
+	reply.length = __GLX_PAD(size) >> 2;	\
+	reply.type = X_Reply; 			\
+	reply.sequenceNumber = client->sequence;
 
 #define __GLX_SEND_HEADER() \
-	WriteToClient (client, sz_xGLXSingleReply, &__glXReply);
+	WriteToClient (client, sz_xGLXSingleReply, &reply);
 
 #define __GLX_PUT_RETVAL(a) \
-  	__glXReply.retval = (a);
+	reply.retval = (a);
 
 #define __GLX_PUT_SIZE(a) \
-  	__glXReply.size = (a);
-
-#define __GLX_PUT_RENDERMODE(m) \
-        __glXReply.pad3 = (m)
+	reply.size = (a);
 
 /*
 ** Get a buffer to hold returned data, with the given alignment.  If we have
@@ -101,21 +94,6 @@ extern xGLXSingleReply __glXReply;
 	res = (char *)answerBuffer;					 \
     }
 
-#define __GLX_PUT_BYTE() \
-  	*(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
-
-#define __GLX_PUT_SHORT() \
-  	*(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
-
-#define __GLX_PUT_INT() \
-  	*(GLint *)&__glXReply.pad3 = *(GLint *)answer
-
-#define __GLX_PUT_FLOAT() \
-  	*(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
-
-#define __GLX_PUT_DOUBLE() \
-  	*(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
-
 #define __GLX_SEND_BYTE_ARRAY(len) \
 	WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
 
@@ -216,13 +194,13 @@ extern xGLXSingleReply __glXReply;
 	}
 
 #define __GLX_SWAP_REPLY_HEADER() \
-  	__GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
-  	__GLX_SWAP_INT(&__glXReply.length);
+	__GLX_SWAP_SHORT(&reply.sequenceNumber); \
+	__GLX_SWAP_INT(&reply.length);
 
 #define __GLX_SWAP_REPLY_RETVAL() \
-  	__GLX_SWAP_INT(&__glXReply.retval)
+	__GLX_SWAP_INT(&reply.retval)
 
 #define __GLX_SWAP_REPLY_SIZE() \
-  	__GLX_SWAP_INT(&__glXReply.size)
+	__GLX_SWAP_INT(&reply.size)
 
 #endif                          /* !__GLX_unpack_h__ */
commit d6db66811643d3762716f6b144a7358572216a4f
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:47 2017 -0400

    dmx: Remove some not-very-interesting debug prints
    
    gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it
    might, and we also don't care. Just delete all this.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index 3d394c52b..24bb875fb 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -532,63 +532,6 @@ dmxDisplayInit(DMXScreenInfo * dmxScreen)
     dmxGetPixmapFormats(dmxScreen);
 }
 
-/* If this doesn't compile, just add || defined(yoursystem) to the line
- * below.  This information is to help with bug reports and is not
- * critical. */
-#if !defined(_POSIX_SOURCE)
-static const char *
-dmxExecOS(void)
-{
-    return "";
-}
-#else
-#include <sys/utsname.h>
-static const char *
-dmxExecOS(void)
-{
-    static char buffer[128];
-    static int initialized = 0;
-    struct utsname u;
-
-    if (!initialized++) {
-        memset(buffer, 0, sizeof(buffer));
-        uname(&u);
-        snprintf(buffer, sizeof(buffer) - 1, "%s %s %s",
-                 u.sysname, u.release, u.version);
-    }
-    return buffer;
-}
-#endif
-
-static const char *
-dmxBuildCompiler(void)
-{
-    static char buffer[128];
-    static int initialized = 0;
-
-    if (!initialized++) {
-        memset(buffer, 0, sizeof(buffer));
-#if defined(__GNUC__) && defined(__GNUC_MINOR__) &&defined(__GNUC_PATCHLEVEL__)
-        snprintf(buffer, sizeof(buffer) - 1, "gcc %d.%d.%d",
-                 __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
-#endif
-    }
-    return buffer;
-}
-
-static const char *
-dmxExecHost(void)
-{
-    static char buffer[128];
-    static int initialized = 0;
-
-    if (!initialized++) {
-        memset(buffer, 0, sizeof(buffer));
-        XmuGetHostname(buffer, sizeof(buffer) - 1);
-    }
-    return buffer;
-}
-
 static void dmxAddExtensions(Bool glxSupported)
 {
     const ExtensionModule dmxExtensions[] = {
@@ -641,12 +584,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
         SetVendorRelease(VENDOR_RELEASE);
         SetVendorString(VENDOR_STRING);
 
-        if (dmxGeneration == 1) {
-            dmxLog(dmxInfo, "DMX Build OS:       %s (%s)\n", OSNAME, OSVENDOR);
-            dmxLog(dmxInfo, "DMX Build Compiler: %s\n", dmxBuildCompiler());
-            dmxLog(dmxInfo, "DMX Execution OS:   %s\n", dmxExecOS());
-            dmxLog(dmxInfo, "DMX Execution Host: %s\n", dmxExecHost());
-        }
         dmxLog(dmxInfo, "MAXSCREENS:         %d\n", MAXSCREENS);
 
         for (i = 0; i < dmxNumScreens; i++) {
commit 17ad6e5d5616039021455bc821d6ee2497f7ebde
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:46 2017 -0400

    dmx: Silence an unused-result warning
    
    Modern glibc is very insistent that you care about whether write()
    succeeds:
    
    ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’:
    ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
             write(priv->fd, &event, sizeof(event));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c
index e41ad40eb..b26c822c0 100644
--- a/hw/dmx/input/usb-keyboard.c
+++ b/hw/dmx/input/usb-keyboard.c
@@ -289,7 +289,8 @@ kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
             led = i;
         event.code = led;
         event.value = ! !(ctrl->leds & (1 << led));
-        write(priv->fd, &event, sizeof(event));
+        if (write(priv->fd, &event, sizeof(event)) != sizeof(event))
+            DebugF("Failed to set LEDs!\n");
     }
 }
 
commit fbc4da6fef2a0d2111284a19c26d83686ebcbd1f
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:44 2017 -0400

    xfree86: Move DRICreatePCIBusID to the PCI code
    
    This symbol is used by some DRI2+ drivers and there's nothing
    DRI1-specific about it.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 9d3447cdf..cf4c27aea 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1465,3 +1465,15 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
     if (*chipset < 0)
         *chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
 }
+
+char *
+DRICreatePCIBusID(const struct pci_device *dev)
+{
+    char *busID;
+
+    if (asprintf(&busID, "pci:%04x:%02x:%02x.%d",
+                 dev->domain, dev->bus, dev->dev, dev->func) == -1)
+        return NULL;
+
+    return busID;
+}
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index edd91c745..79c4c9daf 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -771,4 +771,6 @@ typedef enum {
     ACTION_SWITCHSCREEN_PREV,
 } ActionEvent;
 
+extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *dev);
+
 #endif                          /* _XF86STR_H */
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 0142b6ea7..9f7075996 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -2404,15 +2404,3 @@ DRIMoveBuffersHelper(ScreenPtr pScreen,
         *xdir = 1;
 
 }
-
-char *
-DRICreatePCIBusID(const struct pci_device *dev)
-{
-    char *busID;
-
-    if (asprintf(&busID, "pci:%04x:%02x:%02x.%d",
-                 dev->domain, dev->bus, dev->dev, dev->func) == -1)
-        return NULL;
-
-    return busID;
-}
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
index dfd2f827e..2ec1c76ea 100644
--- a/hw/xfree86/dri/dri.h
+++ b/hw/xfree86/dri/dri.h
@@ -325,8 +325,6 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
                                            int dy,
                                            int *xdir, int *ydir, RegionPtr reg);
 
-extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo);
-
 extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn);
 
 extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
commit b723da8390d2fe1bf048247302416b37972a0cc3
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:43 2017 -0400

    xfree86: Remove unused xf86EnableVTSwitch
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 877b9e9e7..674e83cb1 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -77,8 +77,6 @@ extern _X_EXPORT int platformSlotClaimed;
 extern _X_EXPORT confDRIRec xf86ConfigDRI;
 extern _X_EXPORT Bool xf86DRI2Enabled(void);
 
-extern _X_EXPORT Bool VTSwitchEnabled;  /* kbd driver */
-
 #define XF86SCRNINFO(p) xf86ScreenToScrn(p)
 
 #define XF86FLIP_PIXELS() \
@@ -219,7 +217,6 @@ extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
                                                         handler, void *data);
 extern _X_EXPORT void xf86InterceptSignals(int *signo);
 extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void));
-extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
 extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
 extern _X_EXPORT void xf86PrintBacktrace(void);
 extern _X_EXPORT Bool xf86VTOwner(void);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 7b5d1df65..53ec74f26 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -86,20 +86,6 @@
 #include "xf86platformBus.h"
 #include "systemd-logind.h"
 
-/*
- * This is a toggling variable:
- *  FALSE = No VT switching keys have been pressed last time around
- *  TRUE  = Possible VT switch Pending
- * (DWH - 12/2/93)
- *
- * This has been generalised to work with Linux and *BSD+syscons (DHD)
- */
-
-Bool VTSwitchEnabled = TRUE;    /* Allows run-time disabling for
-                                 *BSD and for avoiding VT
-                                 switches when using the DRI
-                                 automatic full screen mode.*/
-
 #ifdef XF86PM
 extern void (*xf86OSPMClose) (void);
 #endif
@@ -197,7 +183,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
             xf86ZoomViewport(xf86Info.currentScreen, -1);
         break;
     case ACTION_SWITCHSCREEN:
-        if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) {
+        if (!xf86Info.dontVTSwitch && arg) {
             int vtno = *((int *) arg);
 
             if (vtno != xf86Info.vtno) {
@@ -209,7 +195,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
         }
         break;
     case ACTION_SWITCHSCREEN_NEXT:
-        if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
+        if (!xf86Info.dontVTSwitch) {
             if (!xf86VTActivate(xf86Info.vtno + 1)) {
                 /* If first try failed, assume this is the last VT and
                  * try wrapping around to the first vt.
@@ -222,7 +208,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
         }
         break;
     case ACTION_SWITCHSCREEN_PREV:
-        if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) {
+        if (!xf86Info.dontVTSwitch && xf86Info.vtno > 0) {
             if (!xf86VTActivate(xf86Info.vtno - 1)) {
                 /* Don't know what the maximum VT is, so can't wrap around */
                 ErrorF("Failed to switch from vt%02d to previous vt: %s\n",
@@ -770,28 +756,6 @@ xf86EnableGeneralHandler(void *handler)
         SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih);
 }
 
-/*
- * As used currently by the DRI, the return value is ignored.
- */
-Bool
-xf86EnableVTSwitch(Bool new)
-{
-    static Bool def = TRUE;
-    Bool old;
-
-    old = VTSwitchEnabled;
-    if (!new) {
-        /* Disable VT switching */
-        def = VTSwitchEnabled;
-        VTSwitchEnabled = FALSE;
-    }
-    else {
-        /* Restore VT switching to default */
-        VTSwitchEnabled = def;
-    }
-    return old;
-}
-
 void
 DDXRingBell(int volume, int pitch, int duration)
 {
commit f44e0af4daaad5b18d79f2076bc98d6e79f638af
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:42 2017 -0400

    dix: Remove extension aliases
    
    This appears to be essentially unused. The only known client-side
    library for the SELinux extension is xcb, which does not look for the
    name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of
    superstition at this point, NVIDIA's driver does not expose it and Mesa
    does not check for it.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c
index 6325634be..1395a563b 100644
--- a/Xext/xselinux_ext.c
+++ b/Xext/xselinux_ext.c
@@ -714,6 +714,4 @@ SELinuxExtensionInit(void)
                             SELinuxNumberEvents, SELinuxNumberErrors,
                             ProcSELinuxDispatch, SProcSELinuxDispatch,
                             SELinuxResetProc, StandardMinorOpcode);
-
-    AddExtensionAlias("Flask", extEntry);
 }
diff --git a/dix/extension.c b/dix/extension.c
index e81f673b2..b4c1c5f16 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -95,8 +95,6 @@ AddExtension(const char *name, int NumEvents, int NumErrors,
         return NULL;
     }
     ext->name = strdup(name);
-    ext->num_aliases = 0;
-    ext->aliases = (const char **) NULL;
     if (!ext->name) {
         dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
         free(ext);
@@ -144,42 +142,15 @@ AddExtension(const char *name, int NumEvents, int NumErrors,
     return ext;
 }
 
-Bool
-AddExtensionAlias(const char *alias, ExtensionEntry * ext)
-{
-    char *name;
-    const char **aliases;
-
-    if (!ext)
-        return FALSE;
-    aliases = reallocarray(ext->aliases, ext->num_aliases + 1, sizeof(char *));
-    if (!aliases)
-        return FALSE;
-    ext->aliases = aliases;
-    name = strdup(alias);
-    if (!name)
-        return FALSE;
-    ext->aliases[ext->num_aliases] = name;
-    ext->num_aliases++;
-    return TRUE;
-}
-
 static int
 FindExtension(const char *extname, int len)
 {
-    int i, j;
+    int i;
 
     for (i = 0; i < NumExtensions; i++) {
         if ((strlen(extensions[i]->name) == len) &&
             !strncmp(extname, extensions[i]->name, len))
             break;
-        for (j = extensions[i]->num_aliases; --j >= 0;) {
-            if ((strlen(extensions[i]->aliases[j]) == len) &&
-                !strncmp(extname, extensions[i]->aliases[j], len))
-                break;
-        }
-        if (j >= 0)
-            break;
     }
     return ((i == NumExtensions) ? -1 : i);
 }
@@ -223,16 +194,13 @@ StandardMinorOpcode(ClientPtr client)
 void
 CloseDownExtensions(void)
 {
-    int i, j;
+    int i;
 
     for (i = NumExtensions - 1; i >= 0; i--) {
         if (extensions[i]->CloseDown)
             extensions[i]->CloseDown(extensions[i]);
         NumExtensions = i;
         free((void *) extensions[i]->name);
-        for (j = extensions[i]->num_aliases; --j >= 0;)
-            free((void *) extensions[i]->aliases[j]);
-        free(extensions[i]->aliases);
         dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION);
         free(extensions[i]);
     }
@@ -294,7 +262,7 @@ ProcListExtensions(ClientPtr client)
     buffer = NULL;
 
     if (NumExtensions) {
-        int i, j;
+        int i;
 
         for (i = 0; i < NumExtensions; i++) {
             /* call callbacks to find out whether to show extension */
@@ -302,9 +270,7 @@ ProcListExtensions(ClientPtr client)
                 continue;
 
             total_length += strlen(extensions[i]->name) + 1;
-            reply.nExtensions += 1 + extensions[i]->num_aliases;
-            for (j = extensions[i]->num_aliases; --j >= 0;)
-                total_length += strlen(extensions[i]->aliases[j]) + 1;
+            reply.nExtensions += 1;
         }
         reply.length = bytes_to_int32(total_length);
         buffer = bufptr = malloc(total_length);
@@ -319,11 +285,6 @@ ProcListExtensions(ClientPtr client)
             *bufptr++ = len = strlen(extensions[i]->name);
             memmove(bufptr, extensions[i]->name, len);
             bufptr += len;
-            for (j = extensions[i]->num_aliases; --j >= 0;) {
-                *bufptr++ = len = strlen(extensions[i]->aliases[j]);
-                memmove(bufptr, extensions[i]->aliases[j], len);
-                bufptr += len;
-            }
         }
     }
     WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply);
diff --git a/glx/glxext.c b/glx/glxext.c
index b9b82ebeb..091dd75c1 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -424,10 +424,6 @@ GlxExtensionInit(void)
         FatalError("__glXExtensionInit: AddExtensions failed\n");
         return;
     }
-    if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
-        ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
-        return;
-    }
 
     __glXErrorBase = extEntry->errorBase;
     __glXEventBase = extEntry->eventBase;
diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c
index c85827284..ca9780f99 100644
--- a/hw/dmx/glxProxy/glxext.c
+++ b/hw/dmx/glxProxy/glxext.c
@@ -323,12 +323,6 @@ GlxExtensionInit(void)
         FatalError("__glXExtensionInit: AddExtensions failed\n");
         return;
     }
-    /*
-       if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
-       ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
-       return;
-       }
-     */
 
     __glXerrorBase = extEntry->errorBase;
     __glXBadContext = extEntry->errorBase + GLXBadContext;
diff --git a/include/extnsionst.h b/include/extnsionst.h
index 8cbf333f9..80c542339 100644
--- a/include/extnsionst.h
+++ b/include/extnsionst.h
@@ -64,8 +64,6 @@ typedef struct _ExtensionEntry {
     int eventLast;
     int errorBase;
     int errorLast;
-    int num_aliases;
-    const char **aliases;
     void *extPrivate;
     unsigned short (*MinorOpcode) (     /* called for errors */
                                       ClientPtr /* client */ );
@@ -95,10 +93,6 @@ AddExtension(const char * /*name */ ,
              unsigned short (* /*MinorOpcodeProc */ )(ClientPtr /*client */ )
     );
 
-extern _X_EXPORT Bool
-AddExtensionAlias(const char * /*alias */ ,
-                  ExtensionEntry * /*extension */ );
-
 extern _X_EXPORT ExtensionEntry *
 CheckExtension(const char *extname);
 extern _X_EXPORT ExtensionEntry *
commit 88e807d4fa90165868929190f601beef18252f57
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:41 2017 -0400

    include: Remove some unused macros
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/include/extnsionst.h b/include/extnsionst.h
index 636f0a891..8cbf333f9 100644
--- a/include/extnsionst.h
+++ b/include/extnsionst.h
@@ -85,11 +85,6 @@ extern _X_EXPORT void
 NotImplemented(                 /* FIXME: this may move to another file... */
                   xEvent *, xEvent *) _X_NORETURN;
 
-#define    SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom)    \
-    pGC->VectorElement = NewRoutineAddress;
-
-#define    GetGCValue(pGC, GCElement)    (pGC->GCElement)
-
 extern _X_EXPORT ExtensionEntry *
 AddExtension(const char * /*name */ ,
              int /*NumEvents */ ,


More information about the xorg-commit mailing list