xserver: Branch 'master'

Kristian Høgsberg krh at kemper.freedesktop.org
Sun Oct 14 12:05:57 PDT 2007


 GL/glx/glxcmds.c     |  134 ++++++++++++++++++++++++---------------------------
 GL/glx/glxcmdsswap.c |  117 +++++++++++++++++++++++++++++---------------
 GL/glx/glxext.h      |   13 ----
 3 files changed, 142 insertions(+), 122 deletions(-)

New commits:
commit ec0fc012e91e703bb399a380df2912f71957a220
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Sun Oct 14 14:59:12 2007 -0400

    Fix GLX byteswapping.

diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index 91c80b2..a6bd2df 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -109,9 +109,10 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
  * same as the VisualID.
  */
 
-int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
-		    GLXContextID shareList, VisualID visual,
-		    GLuint screen, GLboolean isDirect)
+static int
+DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
+		GLXContextID shareList, VisualID visual,
+		GLuint screen, GLboolean isDirect)
 {
     ClientPtr client = cl->client;
     VisualPtr pVisual;
@@ -385,36 +386,6 @@ static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc)
     glxc->isCurrent = GL_TRUE;
 }
 
-/*****************************************************************************/
-/*
-** Make an OpenGL context and drawable current.
-*/
-
-int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
-{
-    xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
-
-    return DoMakeCurrent( cl, req->drawable, req->drawable,
-			  req->context, req->oldContextTag );
-}
-
-int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
-{
-    xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
-
-    return DoMakeCurrent( cl, req->drawable, req->readdrawable,
-			  req->context, req->oldContextTag );
-}
-
-int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
-{
-    xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
-
-    return DoMakeCurrent( cl, req->drawable, req->readable,
-			  req->context, req->oldContextTag );
-}
-
-
 /**
  * Given a drawable ID, get the associated drawable and / or pixmap.
  * 
@@ -501,10 +472,15 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
     return pGlxDraw;
 }
 
+/*****************************************************************************/
+/*
+** Make an OpenGL context and drawable current.
+*/
 
-int DoMakeCurrent( __GLXclientState *cl,
-		   GLXDrawable drawId, GLXDrawable readId,
-		   GLXContextID contextId, GLXContextTag tag )
+static int
+DoMakeCurrent(__GLXclientState *cl,
+	      GLXDrawable drawId, GLXDrawable readId,
+	      GLXContextID contextId, GLXContextTag tag)
 {
     ClientPtr client = cl->client;
     xGLXMakeCurrentReply reply;
@@ -658,6 +634,30 @@ int DoMakeCurrent( __GLXclientState *cl,
     return Success;
 }
 
+int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+    xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
+
+    return DoMakeCurrent( cl, req->drawable, req->drawable,
+			  req->context, req->oldContextTag );
+}
+
+int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+    xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
+
+    return DoMakeCurrent( cl, req->drawable, req->readdrawable,
+			  req->context, req->oldContextTag );
+}
+
+int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+{
+    xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
+
+    return DoMakeCurrent( cl, req->drawable, req->readable,
+			  req->context, req->oldContextTag );
+}
+
 int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc)
 {
     ClientPtr client = cl->client;
@@ -830,8 +830,8 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
 }
 
 
-int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
-		       GLboolean do_swap)
+static int
+DoGetVisualConfigs(__GLXclientState *cl, unsigned screen)
 {
     ClientPtr client = cl->client;
     xGLXGetVisualConfigsReply reply;
@@ -856,7 +856,7 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
     reply.type = X_Reply;
     reply.sequenceNumber = client->sequence;
 
-    if ( do_swap ) {
+    if (client->swapped) {
 	__GLX_SWAP_SHORT(&reply.sequenceNumber);
 	__GLX_SWAP_INT(&reply.length);
 	__GLX_SWAP_INT(&reply.numVisuals);
@@ -910,7 +910,7 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
 	buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
 	buf[p++] = modes->transparentIndex;
 
-	if ( do_swap ) {
+	if (client->swapped) {
 	    __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
 	}
 	WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, 
@@ -922,7 +922,7 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
 int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
-    return DoGetVisualConfigs( cl, req->screen, GL_FALSE );
+    return DoGetVisualConfigs(cl, req->screen);
 }
 
 
@@ -1018,7 +1018,8 @@ __glXCreateARGBConfig(__GLXscreen *screen)
  * is the same, so this routine pulls double duty.
  */
 
-int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap)
+static int
+DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap)
 {
     ClientPtr client = cl->client;
     xGLXGetFBConfigsReply reply;
@@ -1119,7 +1120,6 @@ int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
     return DoGetFBConfigs( cl, req->screen, GL_FALSE );
 }
 
-
 int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
@@ -1501,7 +1501,8 @@ int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
 }
 
 
-int DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
+static int
+DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
 {
     ClientPtr client = cl->client;
     __GLXcontext *ctx;
@@ -1753,7 +1754,10 @@ int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
 ** client library to send batches of GL rendering commands.
 */
 
-int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap)
+/*
+** Execute all the drawing commands in a request.
+*/
+int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXRenderReq *req;
     ClientPtr client= cl->client;
@@ -1764,9 +1768,8 @@ int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap)
     __GLXcontext *glxc;
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    
     req = (xGLXRenderReq *) pc;
-    if (do_swap) {
+    if (client->swapped) {
 	__GLX_SWAP_SHORT(&req->length);
 	__GLX_SWAP_INT(&req->contextTag);
     }
@@ -1790,7 +1793,7 @@ int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap)
 	** Also, each command must be word aligned.
 	*/
 	hdr = (__GLXrenderHeader *) pc;
-	if (do_swap) {
+	if (client->swapped) {
 	    __GLX_SWAP_SHORT(&hdr->length);
 	    __GLX_SWAP_SHORT(&hdr->opcode);
 	}
@@ -1802,7 +1805,8 @@ int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap)
 	*/
 	err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry);
 	proc = (__GLXdispatchRenderProcPtr)
-	  __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, do_swap);
+	    __glXGetProtocolDecodeFunction(& Render_dispatch_info,
+					   opcode, client->swapped);
 
 	if ((err < 0) || (proc == NULL)) {
 	    client->errorValue = commandsDone;
@@ -1811,7 +1815,8 @@ int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap)
 
         if (entry.varsize) {
             /* variable size command */
-            extra = (*entry.varsize)(pc + __GLX_RENDER_HDR_SIZE, do_swap);
+            extra = (*entry.varsize)(pc + __GLX_RENDER_HDR_SIZE,
+				     client->swapped);
             if (extra < 0) {
                 extra = 0;
             }
@@ -1844,15 +1849,11 @@ int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap)
     return Success;
 }
 
+
 /*
-** Execute all the drawing commands in a request.
+** Execute a large rendering request (one that spans multiple X requests).
 */
-int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
-{
-    return DoRender(cl, pc, False);
-}
-
-int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap)
+int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXRenderLargeReq *req;
     ClientPtr client= cl->client;
@@ -1862,10 +1863,9 @@ int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap)
     int error;
     CARD16 opcode;
     __GLX_DECLARE_SWAP_VARIABLES;
-
     
     req = (xGLXRenderLargeReq *) pc;
-    if (do_swap) {
+    if (client->swapped) {
 	__GLX_SWAP_SHORT(&req->length);
 	__GLX_SWAP_INT(&req->contextTag);
 	__GLX_SWAP_INT(&req->dataBytes);
@@ -1908,7 +1908,7 @@ int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap)
 	}
 
 	hdr = (__GLXrenderLargeHeader *) pc;
-	if (do_swap) {
+	if (client->swapped) {
 	    __GLX_SWAP_INT(&hdr->length);
 	    __GLX_SWAP_INT(&hdr->opcode);
 	}
@@ -1930,7 +1930,8 @@ int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap)
 	    ** be computed from its parameters), all the parameters needed
 	    ** will be in the 1st request, so it's okay to do this.
 	    */
-	    extra = (*entry.varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, do_swap);
+	    extra = (*entry.varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE,
+				     client->swapped);
 	    if (extra < 0) {
 		extra = 0;
 	    }
@@ -2030,7 +2031,8 @@ int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap)
 	    opcode = hdr->opcode;
 
 	    proc = (__GLXdispatchRenderProcPtr)
-	      __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, do_swap);
+	      __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode,
+					     client->swapped);
 	    if (proc == NULL) {
 		client->errorValue = opcode;
 		return __glXError(GLXBadLargeRequest);
@@ -2055,14 +2057,6 @@ int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap)
     }
 }
 
-/*
-** Execute a large rendering request (one that spans multiple X requests).
-*/
-int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
-{
-    return DoRenderLarge(cl, pc, False);
-}
-
 extern RESTYPE __glXSwapBarrierRes;
 
 int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c
index 3f600c1..7f17c26 100644
--- a/GL/glx/glxcmdsswap.c
+++ b/GL/glx/glxcmdsswap.c
@@ -77,8 +77,7 @@ int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->screen);
     __GLX_SWAP_INT(&req->shareList);
 
-    return DoCreateContext( cl, req->context, req->shareList, req->visual,
-			    req->screen, req->isDirect );
+    return __glXDisp_CreateContext(cl, pc);
 }
 
 int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
@@ -93,8 +92,7 @@ int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->renderType);
     __GLX_SWAP_INT(&req->shareList);
 
-    return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
-			    req->screen, req->isDirect );
+    return __glXDisp_CreateNewContext(cl, pc);
 }
 
 int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
@@ -110,8 +108,7 @@ int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->renderType);
     __GLX_SWAP_INT(&req->shareList);
 
-    return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
-			    req->screen, req->isDirect );
+    return __glXDisp_CreateContextWithConfigSGIX(cl, pc);
 }
 
 int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc)
@@ -135,8 +132,7 @@ int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->context);
     __GLX_SWAP_INT(&req->oldContextTag);
 
-    return DoMakeCurrent( cl, req->drawable, req->drawable,
-			  req->context, req->oldContextTag );
+    return __glXDisp_MakeCurrent(cl, pc);
 }
 
 int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
@@ -150,8 +146,7 @@ int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->context);
     __GLX_SWAP_INT(&req->oldContextTag);
 
-    return DoMakeCurrent( cl, req->drawable, req->readdrawable,
-			  req->context, req->oldContextTag );
+    return __glXDisp_MakeContextCurrent(cl, pc);
 }
 
 int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
@@ -165,8 +160,7 @@ int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->context);
     __GLX_SWAP_INT(&req->oldContextTag);
 
-    return DoMakeCurrent( cl, req->drawable, req->readable,
-			  req->context, req->oldContextTag );
+    return __glXDisp_MakeCurrentReadSGI(cl, pc);
 }
 
 int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc)
@@ -233,7 +227,7 @@ int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->screen);
-    return DoGetVisualConfigs( cl, req->screen, GL_TRUE );
+    return __glXDisp_GetVisualConfigs(cl, pc);
 }
 
 int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
@@ -242,7 +236,7 @@ int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->screen);
-    return DoGetFBConfigs( cl, req->screen, GL_TRUE );
+    return __glXDisp_GetFBConfigs(cl, pc);
 }
 
 int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
@@ -251,7 +245,7 @@ int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->screen);
-    return DoGetFBConfigs( cl, req->screen, GL_TRUE );
+    return __glXDisp_GetFBConfigsSGIX(cl, pc);
 }
 
 int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
@@ -265,14 +259,15 @@ int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->pixmap);
     __GLX_SWAP_INT(&req->glxpixmap);
 
-    return DoCreateGLXPixmap( cl, req->visual, req->screen,
-			      req->pixmap, req->glxpixmap, NULL, 0 );
+    return __glXDisp_CreateGLXPixmap(cl, pc);
 }
 
 int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
+    CARD32 *attribs;
     __GLX_DECLARE_SWAP_VARIABLES;
+    __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
 
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->screen);
@@ -280,11 +275,10 @@ int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
     __GLX_SWAP_INT(&req->pixmap);
     __GLX_SWAP_INT(&req->glxpixmap);
     __GLX_SWAP_INT(&req->numAttribs);
+    attribs = (CARD32*)(req + 1);
+    __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
 
-    return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
-			      req->pixmap, req->glxpixmap,
-			      (CARD32*)(req + 1),
-			      req->numAttribs );
+    return __glXDisp_CreatePixmap(cl, pc);
 }
 
 int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
@@ -299,8 +293,7 @@ int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc
     __GLX_SWAP_INT(&req->pixmap);
     __GLX_SWAP_INT(&req->glxpixmap);
 
-    return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
-			      req->pixmap, req->glxpixmap, NULL, 0 );
+    return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc);
 }
 
 int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
@@ -328,50 +321,78 @@ int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
 int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;    
+    __GLX_DECLARE_SWAP_VARIABLES;
 
-    (void) req;
+    __GLX_SWAP_INT(&req->context);
 
-    return BadRequest;    
+    return __glXDisp_QueryContext(cl, pc);
 }
 
 int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;    
+    __GLX_DECLARE_SWAP_VARIABLES;
+    __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+    CARD32 *attribs;
 
-    (void) req;
+    __GLX_SWAP_INT(&req->screen);
+    __GLX_SWAP_INT(&req->fbconfig);
+    __GLX_SWAP_INT(&req->pbuffer);
+    __GLX_SWAP_INT(&req->numAttribs);
+    attribs = (CARD32*)(req + 1);
+    __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
 
-    return BadRequest;    
+    return __glXDisp_CreatePbuffer(cl, pc);
 }
 
 int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;    
+    __GLX_DECLARE_SWAP_VARIABLES;
 
-    (void) req;
+    __GLX_SWAP_INT(&req->screen);
+    __GLX_SWAP_INT(&req->fbconfig);
+    __GLX_SWAP_INT(&req->pbuffer);
+    __GLX_SWAP_INT(&req->width);
+    __GLX_SWAP_INT(&req->height);
 
-    return BadRequest;    
+    return __glXDisp_CreateGLXPbufferSGIX(cl, pc);
 }
 
 int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) req;
+    __GLX_DECLARE_SWAP_VARIABLES;
 
-    return BadRequest;
+    __GLX_SWAP_INT(&req->pbuffer);
+
+    return __glXDisp_DestroyPbuffer(cl, pc);
 }
 
 int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) req;
+    __GLX_DECLARE_SWAP_VARIABLES;
 
-    return BadRequest;
+    __GLX_SWAP_INT(&req->pbuffer);
+
+    return __glXDisp_DestroyGLXPbufferSGIX(cl, pc);
 }
 
 int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXChangeDrawableAttributesReq *req =
 	(xGLXChangeDrawableAttributesReq *) req;
+    __GLX_DECLARE_SWAP_VARIABLES;
+    __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+    CARD32 *attribs;
+
+    __GLX_SWAP_INT(&req->drawable);
+    __GLX_SWAP_INT(&req->numAttribs);
+    attribs = (CARD32*)(req + 1);
+    __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
 
-    return BadRequest;
+    return __glXDisp_ChangeDrawableAttributes(cl, pc);
 }
 
 int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
@@ -379,26 +400,44 @@ int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
 {
     xGLXChangeDrawableAttributesSGIXReq *req =
 	(xGLXChangeDrawableAttributesSGIXReq *) req;
+    __GLX_DECLARE_SWAP_VARIABLES;
+    __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+    CARD32 *attribs;
 
-    return BadRequest;
+    __GLX_SWAP_INT(&req->drawable);
+    __GLX_SWAP_INT(&req->numAttribs);
+    attribs = (CARD32*)(req + 1);
+    __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
+
+    return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc);
 }
 
 int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
+    __GLX_DECLARE_SWAP_VARIABLES;
+    __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+    CARD32 *attribs;
 
-    (void) req;
+    __GLX_SWAP_INT(&req->screen);
+    __GLX_SWAP_INT(&req->fbconfig);
+    __GLX_SWAP_INT(&req->window);
+    __GLX_SWAP_INT(&req->glxwindow);
+    __GLX_SWAP_INT(&req->numAttribs);
+    attribs = (CARD32*)(req + 1);
+    __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
 
-    return BadRequest;
+    return __glXDisp_CreateWindow(cl, pc);
 }
 
 int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
+    __GLX_DECLARE_SWAP_VARIABLES;
 
-    (void) req;
+    __GLX_SWAP_INT(&req->glxwindow);
 
-    return BadRequest;
+    return __glXDisp_DestroyWindow(cl, pc);
 }
 
 int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
@@ -668,7 +707,7 @@ void __glXSwapGetDrawableAttributesReply(ClientPtr client,
 
 int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc)
 {
-    return DoRender(cl, pc, True);
+    return __glXDisp_Render(cl, pc);
 }
 
 /*
@@ -676,7 +715,7 @@ int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc)
 */
 int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
 {
-    return DoRenderLarge(cl, pc, True);
+    return __glXDisp_RenderLarge(cl, pc);
 }
 
 /************************************************************************/
diff --git a/GL/glx/glxext.h b/GL/glx/glxext.h
index 601bb22..a81850c 100644
--- a/GL/glx/glxext.h
+++ b/GL/glx/glxext.h
@@ -71,19 +71,6 @@ extern void __glXClearErrorOccured(void);
 extern GLboolean __glXErrorOccured(void);
 extern void __glXResetLargeCommandStatus(__GLXclientState*);
 
-extern int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
-    GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
-extern int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
-    GLboolean do_swap);
-extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen,
-    GLboolean do_swap);
-extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
-    GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
-extern int DoQueryContext(__GLXclientState *cl, GLXContextID gcId);
-
-extern int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap);
-extern int DoRenderLarge(__GLXclientState *cl, GLbyte *pc, int do_swap);
-
 extern void GlxExtensionInit(void);
 
 extern const char GLServerVersion[];


More information about the xorg-commit mailing list