687
698
int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
700
ClientPtr client = cl->client;
689
701
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
703
REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
691
705
return DoMakeCurrent( cl, req->drawable, req->drawable,
692
706
req->context, req->oldContextTag );
695
709
int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
711
ClientPtr client = cl->client;
697
712
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
714
REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
699
716
return DoMakeCurrent( cl, req->drawable, req->readdrawable,
700
717
req->context, req->oldContextTag );
703
720
int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
722
ClientPtr client = cl->client;
705
723
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
725
REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
707
727
return DoMakeCurrent( cl, req->drawable, req->readable,
708
728
req->context, req->oldContextTag );
1362
1434
int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
1436
ClientPtr client = cl->client;
1364
1437
xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
1439
REQUEST_SIZE_MATCH(xGLXCreateGLXPbufferSGIXReq);
1366
1441
return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
1367
1442
req->width, req->height, req->pbuffer);
1370
1445
int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
1447
ClientPtr client = cl->client;
1372
1448
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
1450
REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
1374
1452
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
1377
1455
int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
1457
ClientPtr client = cl->client;
1379
1458
xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
1460
REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq);
1381
1462
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
1409
1490
int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
1492
ClientPtr client = cl->client;
1411
1493
xGLXChangeDrawableAttributesReq *req =
1412
1494
(xGLXChangeDrawableAttributesReq *) pc;
1496
REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq);
1497
if (req->numAttribs > (UINT32_MAX >> 3)) {
1498
client->errorValue = req->numAttribs;
1501
REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3);
1414
1503
return DoChangeDrawableAttributes(cl->client, req->drawable,
1415
1504
req->numAttribs, (CARD32 *) (req + 1));
1418
1507
int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
1509
ClientPtr client = cl->client;
1420
1510
xGLXChangeDrawableAttributesSGIXReq *req =
1421
1511
(xGLXChangeDrawableAttributesSGIXReq *)pc;
1513
REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq);
1514
if (req->numAttribs > (UINT32_MAX >> 3)) {
1515
client->errorValue = req->numAttribs;
1518
REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3);
1423
1520
return DoChangeDrawableAttributes(cl->client, req->drawable,
1424
1521
req->numAttribs, (CARD32 *) (req + 1));
2064
extern RESTYPE __glXSwapBarrierRes;
2066
int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
2068
ClientPtr client = cl->client;
2069
xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
2070
XID drawable = req->drawable;
2071
int barrier = req->barrier;
2074
__GLXscreen *pGlxScreen;
2076
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
2077
pGlxScreen = glxGetScreen(pDraw->pScreen);
2078
if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
2079
screen = pDraw->pScreen->myNum;
2080
if (pGlxScreen->swapBarrierFuncs) {
2081
int ret = pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, barrier);
2082
if (ret == Success) {
2084
/* add source for cleanup when drawable is gone */
2085
AddResource(drawable, __glXSwapBarrierRes, (pointer)(intptr_t)screen);
2088
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
2093
client->errorValue = drawable;
2094
return __glXError(GLXBadDrawable);
2098
int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
2100
ClientPtr client = cl->client;
2101
xGLXQueryMaxSwapBarriersSGIXReq *req =
2102
(xGLXQueryMaxSwapBarriersSGIXReq *) pc;
2103
xGLXQueryMaxSwapBarriersSGIXReply reply;
2104
int screen = req->screen;
2105
__GLXscreen *pGlxScreen;
2107
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
2108
if (pGlxScreen->swapBarrierFuncs)
2109
reply.max = pGlxScreen->swapBarrierFuncs->queryMaxSwapBarriersFunc(screen);
2115
reply.type = X_Reply;
2116
reply.sequenceNumber = client->sequence;
2118
if (client->swapped) {
2119
__GLX_DECLARE_SWAP_VARIABLES;
2120
__GLX_SWAP_SHORT(&reply.sequenceNumber);
2123
WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
2128
#define GLX_BAD_HYPERPIPE_SGIX 92
2130
int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
2132
ClientPtr client = cl->client;
2133
xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc;
2134
xGLXQueryHyperpipeNetworkSGIXReply reply;
2135
int screen = req->screen;
2142
__GLXscreen *pGlxScreen;
2144
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
2145
if (pGlxScreen->hyperpipeFuncs) {
2147
(pGlxScreen->hyperpipeFuncs->queryHyperpipeNetworkFunc(screen, &npipes, &n));
2149
length = __GLX_PAD(n) >> 2;
2150
reply.type = X_Reply;
2151
reply.sequenceNumber = client->sequence;
2152
reply.length = length;
2154
reply.npipes = npipes;
2156
if (client->swapped) {
2157
__GLX_DECLARE_SWAP_VARIABLES;
2158
__GLX_SWAP_SHORT(&reply.sequenceNumber);
2159
__GLX_SWAP_INT(&reply.length);
2160
__GLX_SWAP_INT(&reply.n);
2161
__GLX_SWAP_INT(&reply.npipes);
2163
WriteToClient(client, sz_xGLXQueryHyperpipeNetworkSGIXReply,
2166
WriteToClient(client, length << 2, (char *)rdata);
2171
int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
2173
ClientPtr client = cl->client;
2174
xGLXDestroyHyperpipeConfigSGIXReq * req =
2175
(xGLXDestroyHyperpipeConfigSGIXReq *) pc;
2176
xGLXDestroyHyperpipeConfigSGIXReply reply;
2177
int screen = req->screen;
2178
int success = GLX_BAD_HYPERPIPE_SGIX;
2180
__GLXscreen *pGlxScreen;
2184
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
2185
if (pGlxScreen->hyperpipeFuncs) {
2186
success = pGlxScreen->hyperpipeFuncs->destroyHyperpipeConfigFunc(screen, hpId);
2189
reply.type = X_Reply;
2190
reply.sequenceNumber = client->sequence;
2191
reply.length = __GLX_PAD(0) >> 2;
2193
reply.success = success;
2196
if (client->swapped) {
2197
__GLX_DECLARE_SWAP_VARIABLES;
2198
__GLX_SWAP_SHORT(&reply.sequenceNumber);
2200
WriteToClient(client,
2201
sz_xGLXDestroyHyperpipeConfigSGIXReply,
2206
int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
2208
ClientPtr client = cl->client;
2209
xGLXQueryHyperpipeConfigSGIXReq * req =
2210
(xGLXQueryHyperpipeConfigSGIXReq *) pc;
2211
xGLXQueryHyperpipeConfigSGIXReply reply;
2212
int screen = req->screen;
2218
__GLXscreen *pGlxScreen;
2222
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
2223
if (pGlxScreen->hyperpipeFuncs) {
2224
rdata = pGlxScreen->hyperpipeFuncs->queryHyperpipeConfigFunc(screen, hpId,&npipes, &n);
2227
length = __GLX_PAD(n) >> 2;
2228
reply.type = X_Reply;
2229
reply.sequenceNumber = client->sequence;
2230
reply.length = length;
2232
reply.npipes = npipes;
2235
if (client->swapped) {
2236
__GLX_DECLARE_SWAP_VARIABLES;
2237
__GLX_SWAP_SHORT(&reply.sequenceNumber);
2238
__GLX_SWAP_INT(&reply.length);
2239
__GLX_SWAP_INT(&reply.n);
2240
__GLX_SWAP_INT(&reply.npipes);
2243
WriteToClient(client, sz_xGLXQueryHyperpipeConfigSGIXReply,
2246
WriteToClient(client, length << 2, (char *)rdata);
2251
int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
2253
ClientPtr client = cl->client;
2254
xGLXHyperpipeConfigSGIXReq * req =
2255
(xGLXHyperpipeConfigSGIXReq *) pc;
2256
xGLXHyperpipeConfigSGIXReply reply;
2257
int screen = req->screen;
2260
int npipes=0, networkId;
2262
__GLXscreen *pGlxScreen;
2264
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
2265
networkId = (int)req->networkId;
2266
npipes = (int)req->npipes;
2267
rdata = (void *)(req +1);
2269
if (pGlxScreen->hyperpipeFuncs) {
2270
pGlxScreen->hyperpipeFuncs->hyperpipeConfigFunc(screen,networkId,
2275
reply.type = X_Reply;
2276
reply.sequenceNumber = client->sequence;
2277
reply.length = __GLX_PAD(0) >> 2;
2279
reply.npipes = npipes;
2282
if (client->swapped) {
2283
__GLX_DECLARE_SWAP_VARIABLES;
2284
__GLX_SWAP_SHORT(&reply.sequenceNumber);
2285
__GLX_SWAP_INT(&reply.npipes);
2286
__GLX_SWAP_INT(&reply.hpId);
2289
WriteToClient(client, sz_xGLXHyperpipeConfigSGIXReply,
2296
2198
/************************************************************************/