summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-08-16 14:49:17 -0400
committerAdam Jackson <ajax@redhat.com>2017-08-21 10:13:01 -0400
commit3d81abba9ca2f9d57b4c293e3b7fcb32ef853f44 (patch)
treed3549a26e169a3387b0bbafb0551f9daf8adaeee /glx
parent51bab63b7353319c51ec2f1adaed95d86e4f6119 (diff)
downloadxserver-3d81abba9ca2f9d57b4c293e3b7fcb32ef853f44.tar.gz
glx: Inline some reply swapping code
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c68
-rw-r--r--glx/glxcmdsswap.c103
-rw-r--r--glx/glxserver.h22
3 files changed, 52 insertions, 141 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 9ad90eec2..6a763970d 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -685,11 +685,12 @@ DoMakeCurrent(__GLXclientState * cl,
}
if (client->swapped) {
- __glXSwapMakeCurrentReply(client, &reply);
- }
- else {
- WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.contextTag);
}
+ WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
return Success;
}
@@ -751,11 +752,11 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc)
};
if (client->swapped) {
- __glXSwapIsDirectReply(client, &reply);
- }
- else {
- WriteToClient(client, sz_xGLXIsDirectReply, &reply);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
}
+ WriteToClient(client, sz_xGLXIsDirectReply, &reply);
return Success;
}
@@ -789,11 +790,14 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
};
if (client->swapped) {
- __glXSwapQueryVersionReply(client, &reply);
- }
- else {
- WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.majorVersion);
+ __GLX_SWAP_INT(&reply.minorVersion);
}
+
+ WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
return Success;
}
@@ -1738,7 +1742,16 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum);
if (client->swapped) {
- __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
+ int length = reply.length;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.n);
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
+ __GLX_SWAP_INT_ARRAY((int *) sendBuf, length);
+ WriteToClient(client, length << 2, sendBuf);
}
else {
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
@@ -1968,7 +1981,16 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
};
if (client->swapped) {
- __glXSwapGetDrawableAttributesReply(client, &reply, attributes);
+ int length = reply.length;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.numAttribs);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
+ __GLX_SWAP_INT_ARRAY((int *) attributes, length);
+ WriteToClient(client, length << 2, attributes);
}
else {
WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
@@ -2415,7 +2437,14 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
memcpy(buf, pGlxScreen->GLXextensions, n);
if (client->swapped) {
- glxSwapQueryExtensionsStringReply(client, &reply, buf);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.n);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
+ __GLX_SWAP_INT_ARRAY((int *) buf, length);
+ WriteToClient(client, length << 2, buf);
}
else {
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
@@ -2483,7 +2512,14 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
memcpy(buf, ptr, n);
if (client->swapped) {
- glxSwapQueryServerStringReply(client, &reply, buf);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.n);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
+ /** no swap is needed for an array of chars **/
+ /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
+ WriteToClient(client, length << 2, buf);
}
else {
WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c
index 9ec1222f8..44a09e61c 100644
--- a/glx/glxcmdsswap.c
+++ b/glx/glxcmdsswap.c
@@ -826,109 +826,6 @@ __glXDispSwap_GetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
/************************************************************************/
/*
-** Swap replies.
-*/
-
-void
-__glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->contextTag);
- WriteToClient(client, sz_xGLXMakeCurrentReply, reply);
-}
-
-void
-__glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- WriteToClient(client, sz_xGLXIsDirectReply, reply);
-}
-
-void
-__glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->majorVersion);
- __GLX_SWAP_INT(&reply->minorVersion);
- WriteToClient(client, sz_xGLXQueryVersionReply, reply);
-}
-
-void
-glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply * reply,
- char *buf)
-{
- int length = reply->length;
-
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply);
- __GLX_SWAP_INT_ARRAY((int *) buf, length);
- WriteToClient(client, length << 2, buf);
-}
-
-void
-glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply * reply, char *buf)
-{
- int length = reply->length;
-
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryServerStringReply, reply);
- /** no swap is needed for an array of chars **/
- /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
- WriteToClient(client, length << 2, buf);
-}
-
-void
-__glXSwapQueryContextInfoEXTReply(ClientPtr client,
- xGLXQueryContextInfoEXTReply * reply,
- int *buf)
-{
- int length = reply->length;
-
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply);
- __GLX_SWAP_INT_ARRAY((int *) buf, length);
- WriteToClient(client, length << 2, buf);
-}
-
-void
-__glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply * reply,
- CARD32 *buf)
-{
- int length = reply->length;
-
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->numAttribs);
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply);
- __GLX_SWAP_INT_ARRAY((int *) buf, length);
- WriteToClient(client, length << 2, buf);
-}
-
-/************************************************************************/
-
-/*
** Render and Renderlarge are not in the GLX API. They are used by the GLX
** client library to send batches of GL rendering commands.
*/
diff --git a/glx/glxserver.h b/glx/glxserver.h
index 547826bd9..a54ce4b92 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -189,28 +189,6 @@ extern RESTYPE __glXDrawableRes;
extern char *__glXcombine_strings(const char *, const char *);
/*
-** Routines for sending swapped replies.
-*/
-
-extern void __glXSwapMakeCurrentReply(ClientPtr client,
- xGLXMakeCurrentReply * reply);
-extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply);
-extern void __glXSwapQueryVersionReply(ClientPtr client,
- xGLXQueryVersionReply * reply);
-extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
- xGLXQueryContextInfoEXTReply *
- reply, int *buf);
-extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply *
- reply, CARD32 *buf);
-extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *
- reply, char *buf);
-extern void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply * reply,
- char *buf);
-
-/*
* Routines for computing the size of variably-sized rendering commands.
*/