glx: Inline some reply swapping code
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
51bab63b73
commit
3d81abba9c
|
@ -685,11 +685,12 @@ DoMakeCurrent(__GLXclientState * cl,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
__glXSwapMakeCurrentReply(client, &reply);
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
}
|
__GLX_SWAP_SHORT(&reply.sequenceNumber);
|
||||||
else {
|
__GLX_SWAP_INT(&reply.length);
|
||||||
WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
|
__GLX_SWAP_INT(&reply.contextTag);
|
||||||
}
|
}
|
||||||
|
WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,11 +752,11 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
__glXSwapIsDirectReply(client, &reply);
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
}
|
__GLX_SWAP_SHORT(&reply.sequenceNumber);
|
||||||
else {
|
__GLX_SWAP_INT(&reply.length);
|
||||||
WriteToClient(client, sz_xGLXIsDirectReply, &reply);
|
|
||||||
}
|
}
|
||||||
|
WriteToClient(client, sz_xGLXIsDirectReply, &reply);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -789,11 +790,14 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
__glXSwapQueryVersionReply(client, &reply);
|
__GLX_DECLARE_SWAP_VARIABLES;
|
||||||
}
|
__GLX_SWAP_SHORT(&reply.sequenceNumber);
|
||||||
else {
|
__GLX_SWAP_INT(&reply.length);
|
||||||
WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
|
__GLX_SWAP_INT(&reply.majorVersion);
|
||||||
|
__GLX_SWAP_INT(&reply.minorVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1738,7 +1742,16 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
||||||
sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum);
|
sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum);
|
||||||
|
|
||||||
if (client->swapped) {
|
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 {
|
else {
|
||||||
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
|
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
|
||||||
|
@ -1968,7 +1981,16 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
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 {
|
else {
|
||||||
WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
|
WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
|
||||||
|
@ -2415,7 +2437,14 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
|
||||||
memcpy(buf, pGlxScreen->GLXextensions, n);
|
memcpy(buf, pGlxScreen->GLXextensions, n);
|
||||||
|
|
||||||
if (client->swapped) {
|
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 {
|
else {
|
||||||
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
|
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
|
||||||
|
@ -2483,7 +2512,14 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
|
||||||
memcpy(buf, ptr, n);
|
memcpy(buf, ptr, n);
|
||||||
|
|
||||||
if (client->swapped) {
|
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 {
|
else {
|
||||||
WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
|
WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
|
||||||
|
|
|
@ -825,109 +825,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
|
** Render and Renderlarge are not in the GLX API. They are used by the GLX
|
||||||
** client library to send batches of GL rendering commands.
|
** client library to send batches of GL rendering commands.
|
||||||
|
|
|
@ -188,28 +188,6 @@ extern RESTYPE __glXDrawableRes;
|
||||||
|
|
||||||
extern char *__glXcombine_strings(const char *, const char *);
|
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.
|
* Routines for computing the size of variably-sized rendering commands.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue