Add mouse and keyboard configuration file
[profile/ivi/xorg-x11-server.git] / glx / singlepixswap.c
1 /*
2  * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3  * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice including the dates of first publication and
13  * either this permission notice or a reference to
14  * http://oss.sgi.com/projects/FreeB/
15  * shall be included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  *
25  * Except as contained in this notice, the name of Silicon Graphics, Inc.
26  * shall not be used in advertising or otherwise to promote the sale, use or
27  * other dealings in this Software without prior written authorization from
28  * Silicon Graphics, Inc.
29  */
30
31 #ifdef HAVE_DIX_CONFIG_H
32 #include <dix-config.h>
33 #endif
34
35 #include "glxserver.h"
36 #include "glxext.h"
37 #include "singlesize.h"
38 #include "unpack.h"
39 #include "indirect_dispatch.h"
40 #include "indirect_size_get.h"
41 #include "glapitable.h"
42 #include "glapi.h"
43 #include "glthread.h"
44 #include "dispatch.h"
45
46 int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
47 {
48     GLsizei width, height;
49     GLenum format, type;
50     GLboolean swapBytes, lsbFirst;
51     GLint compsize;
52     __GLX_DECLARE_SWAP_VARIABLES;
53     __GLXcontext *cx;
54     ClientPtr client = cl->client;
55     int error;
56     char *answer, answerBuffer[200];
57
58     __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
59     cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
60     if (!cx) {
61         return error;
62     }
63
64     pc += __GLX_SINGLE_HDR_SIZE;
65     __GLX_SWAP_INT(pc+0);
66     __GLX_SWAP_INT(pc+4);
67     __GLX_SWAP_INT(pc+8);
68     __GLX_SWAP_INT(pc+12);
69     __GLX_SWAP_INT(pc+16);
70     __GLX_SWAP_INT(pc+20);
71
72     width = *(GLsizei *)(pc + 8);
73     height = *(GLsizei *)(pc + 12);
74     format = *(GLenum *)(pc + 16);
75     type = *(GLenum *)(pc + 20);
76     swapBytes = *(GLboolean *)(pc + 24);
77     lsbFirst = *(GLboolean *)(pc + 25);
78     compsize = __glReadPixels_size(format,type,width,height);
79     if (compsize < 0) compsize = 0;
80
81     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
82     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_LSB_FIRST, lsbFirst) );
83     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
84     __glXClearErrorOccured();
85     CALL_ReadPixels( GET_DISPATCH(),
86                  (*(GLint    *)(pc + 0),
87                  *(GLint    *)(pc + 4),
88                  *(GLsizei  *)(pc + 8),
89                  *(GLsizei  *)(pc + 12),
90                  *(GLenum   *)(pc + 16),
91                  *(GLenum   *)(pc + 20),
92                  answer)
93                  );
94
95     if (__glXErrorOccured()) {
96         __GLX_BEGIN_REPLY(0);
97         __GLX_SWAP_REPLY_HEADER();
98         __GLX_SEND_HEADER();
99     } else {
100         __GLX_BEGIN_REPLY(compsize);
101         __GLX_SWAP_REPLY_HEADER();
102         __GLX_SEND_HEADER();
103         __GLX_SEND_VOID_ARRAY(compsize);
104     }
105     __GLX_NOTE_FLUSHED_CMDS(cx);
106     return Success;
107 }
108
109 int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
110 {
111     GLint level, compsize;
112     GLenum format, type, target;
113     GLboolean swapBytes;
114     __GLX_DECLARE_SWAP_VARIABLES;
115     __GLXcontext *cx;
116     ClientPtr client = cl->client;
117     int error;
118     char *answer, answerBuffer[200];
119     GLint width=0, height=0, depth=1;
120
121     __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
122     cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
123     if (!cx) {
124         return error;
125     }
126
127     pc += __GLX_SINGLE_HDR_SIZE;
128     __GLX_SWAP_INT(pc+0);
129     __GLX_SWAP_INT(pc+4);
130     __GLX_SWAP_INT(pc+8);
131     __GLX_SWAP_INT(pc+12);
132
133     level = *(GLint *)(pc + 4);
134     format = *(GLenum *)(pc + 8);
135     type = *(GLenum *)(pc + 12);
136     target = *(GLenum *)(pc + 0);
137     swapBytes = *(GLboolean *)(pc + 16);
138
139     CALL_GetTexLevelParameteriv( GET_DISPATCH(), (target, level, GL_TEXTURE_WIDTH, &width) );
140     CALL_GetTexLevelParameteriv( GET_DISPATCH(), (target, level, GL_TEXTURE_HEIGHT, &height) );
141     if ( target == GL_TEXTURE_3D) {
142         CALL_GetTexLevelParameteriv( GET_DISPATCH(), (target, level, GL_TEXTURE_DEPTH, &depth) );
143     }
144     /*
145      * The three queries above might fail if we're in a state where queries
146      * are illegal, but then width, height, and depth would still be zero anyway.
147      */
148     compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
149     if (compsize < 0) compsize = 0;
150
151     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
152     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
153     __glXClearErrorOccured();
154     CALL_GetTexImage( GET_DISPATCH(), (
155                   *(GLenum   *)(pc + 0),
156                   *(GLint    *)(pc + 4),
157                   *(GLenum   *)(pc + 8),
158                   *(GLenum   *)(pc + 12),
159                   answer
160                   ) );
161
162     if (__glXErrorOccured()) {
163         __GLX_BEGIN_REPLY(0);
164         __GLX_SWAP_REPLY_HEADER();
165         __GLX_SEND_HEADER();
166     } else {
167         __GLX_BEGIN_REPLY(compsize);
168         __GLX_SWAP_REPLY_HEADER();
169         __GLX_SWAP_INT(&width);
170         __GLX_SWAP_INT(&height);
171         __GLX_SWAP_INT(&depth);
172         ((xGLXGetTexImageReply *)&__glXReply)->width = width;
173         ((xGLXGetTexImageReply *)&__glXReply)->height = height;
174         ((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
175         __GLX_SEND_HEADER();
176         __GLX_SEND_VOID_ARRAY(compsize);
177     }
178     return Success;
179 }
180
181 int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
182 {
183     GLboolean lsbFirst;
184     __GLXcontext *cx;
185     ClientPtr client = cl->client;
186     int error;
187     GLubyte answerBuffer[200];
188     char *answer;
189     __GLX_DECLARE_SWAP_VARIABLES;
190
191     __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
192     cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
193     if (!cx) {
194         return error;
195     }
196     pc += __GLX_SINGLE_HDR_SIZE;
197     lsbFirst = *(GLboolean *)(pc + 0);
198
199     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_LSB_FIRST, lsbFirst) );
200     __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
201
202     __glXClearErrorOccured();
203     CALL_GetPolygonStipple( GET_DISPATCH(), ((GLubyte  *) answer) );
204     if (__glXErrorOccured()) {
205         __GLX_BEGIN_REPLY(0);
206         __GLX_SWAP_REPLY_HEADER();
207         __GLX_SEND_HEADER();
208     } else {
209         __GLX_BEGIN_REPLY(128);
210         __GLX_SWAP_REPLY_HEADER();
211         __GLX_SEND_HEADER();
212         __GLX_SEND_BYTE_ARRAY(128);
213     }
214     return Success;
215 }
216
217 static int GetSeparableFilter(__GLXclientState *cl, GLbyte *pc, GLXContextTag tag)
218 {
219     GLint compsize, compsize2;
220     GLenum format, type, target;
221     GLboolean swapBytes;
222     __GLXcontext *cx;
223     ClientPtr client = cl->client;
224     int error;
225     __GLX_DECLARE_SWAP_VARIABLES;
226     char *answer, answerBuffer[200];
227     GLint width=0, height=0;
228
229     cx = __glXForceCurrent(cl, tag, &error);
230     if (!cx) {
231         return error;
232     }
233
234     __GLX_SWAP_INT(pc+0);
235     __GLX_SWAP_INT(pc+4);
236     __GLX_SWAP_INT(pc+8);
237
238     format = *(GLenum *)(pc + 4);
239     type = *(GLenum *)(pc + 8);
240     target = *(GLenum *)(pc + 0);
241     swapBytes = *(GLboolean *)(pc + 12);
242
243     /* target must be SEPARABLE_2D, however I guess we can let the GL
244        barf on this one.... */
245
246     CALL_GetConvolutionParameteriv( GET_DISPATCH(), (target, GL_CONVOLUTION_WIDTH, &width) );
247     CALL_GetConvolutionParameteriv( GET_DISPATCH(), (target, GL_CONVOLUTION_HEIGHT, &height) );
248     /*
249      * The two queries above might fail if we're in a state where queries
250      * are illegal, but then width and height would still be zero anyway.
251      */
252     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
253     compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
254
255     if (compsize < 0) compsize = 0;
256     if (compsize2 < 0) compsize2 = 0;
257     compsize = __GLX_PAD(compsize);
258     compsize2 = __GLX_PAD(compsize2);
259
260     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
261     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
262     __glXClearErrorOccured();
263     CALL_GetSeparableFilter( GET_DISPATCH(), (
264                   *(GLenum   *)(pc + 0),
265                   *(GLenum   *)(pc + 4),
266                   *(GLenum   *)(pc + 8),
267                   answer,
268                   answer + compsize,
269                   NULL
270                   ) );
271
272     if (__glXErrorOccured()) {
273         __GLX_BEGIN_REPLY(0);
274         __GLX_SWAP_REPLY_HEADER();
275     } else {
276         __GLX_BEGIN_REPLY(compsize + compsize2);
277         __GLX_SWAP_REPLY_HEADER();
278         __GLX_SWAP_INT(&width);
279         __GLX_SWAP_INT(&height);
280         ((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
281         ((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
282         __GLX_SEND_VOID_ARRAY(compsize + compsize2);
283     }
284
285     return Success;
286 }
287
288 int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
289 {
290     const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
291
292     return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
293 }
294
295 int __glXDispSwap_GetSeparableFilterEXT(__GLXclientState *cl, GLbyte *pc)
296 {
297     const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
298
299     return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
300 }
301
302 static int GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc, GLXContextTag tag)
303 {
304     GLint compsize;
305     GLenum format, type, target;
306     GLboolean swapBytes;
307     __GLXcontext *cx;
308     ClientPtr client = cl->client;
309     int error;
310     __GLX_DECLARE_SWAP_VARIABLES;
311     char *answer, answerBuffer[200];
312     GLint width=0, height=0;
313
314     cx = __glXForceCurrent(cl, tag, &error);
315     if (!cx) {
316         return error;
317     }
318
319     __GLX_SWAP_INT(pc+0);
320     __GLX_SWAP_INT(pc+4);
321     __GLX_SWAP_INT(pc+8);
322
323     format = *(GLenum *)(pc + 4);
324     type = *(GLenum *)(pc + 8);
325     target = *(GLenum *)(pc + 0);
326     swapBytes = *(GLboolean *)(pc + 12);
327
328     CALL_GetConvolutionParameteriv( GET_DISPATCH(), (target, GL_CONVOLUTION_WIDTH, &width) );
329     if (target == GL_CONVOLUTION_2D) {
330         height = 1;
331     } else {
332         CALL_GetConvolutionParameteriv( GET_DISPATCH(), (target, GL_CONVOLUTION_HEIGHT, &height) );
333     }
334     /*
335      * The two queries above might fail if we're in a state where queries
336      * are illegal, but then width and height would still be zero anyway.
337      */
338     compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
339     if (compsize < 0) compsize = 0;
340
341     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
342     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
343     __glXClearErrorOccured();
344     CALL_GetConvolutionFilter( GET_DISPATCH(), (
345                   *(GLenum   *)(pc + 0),
346                   *(GLenum   *)(pc + 4),
347                   *(GLenum   *)(pc + 8),
348                   answer
349                   ) );
350
351     if (__glXErrorOccured()) {
352         __GLX_BEGIN_REPLY(0);
353         __GLX_SWAP_REPLY_HEADER();
354     } else {
355         __GLX_BEGIN_REPLY(compsize);
356         __GLX_SWAP_REPLY_HEADER();
357         __GLX_SWAP_INT(&width);
358         __GLX_SWAP_INT(&height);
359         ((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
360         ((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
361         __GLX_SEND_VOID_ARRAY(compsize);
362     }
363
364     return Success;
365 }
366
367 int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
368 {
369     const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
370
371     return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
372 }
373
374 int __glXDispSwap_GetConvolutionFilterEXT(__GLXclientState *cl, GLbyte *pc)
375 {
376     const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
377
378     return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
379 }
380
381 static int GetHistogram(__GLXclientState *cl, GLbyte *pc, GLXContextTag tag)
382 {
383     GLint compsize;
384     GLenum format, type, target;
385     GLboolean swapBytes, reset;
386     __GLXcontext *cx;
387     ClientPtr client = cl->client;
388     int error;
389     __GLX_DECLARE_SWAP_VARIABLES;
390     char *answer, answerBuffer[200];
391     GLint width=0;
392
393     cx = __glXForceCurrent(cl, tag, &error);
394     if (!cx) {
395         return error;
396     }
397
398     __GLX_SWAP_INT(pc+0);
399     __GLX_SWAP_INT(pc+4);
400     __GLX_SWAP_INT(pc+8);
401
402     format = *(GLenum *)(pc + 4);
403     type = *(GLenum *)(pc + 8);
404     target = *(GLenum *)(pc + 0);
405     swapBytes = *(GLboolean *)(pc + 12);
406     reset = *(GLboolean *)(pc + 13);
407
408     CALL_GetHistogramParameteriv( GET_DISPATCH(), (target, GL_HISTOGRAM_WIDTH, &width) );
409     /*
410      * The one query above might fail if we're in a state where queries
411      * are illegal, but then width would still be zero anyway.
412      */
413     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
414     if (compsize < 0) compsize = 0;
415
416     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
417     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
418     __glXClearErrorOccured();
419     CALL_GetHistogram( GET_DISPATCH(), (target, reset, format, type, answer) );
420
421     if (__glXErrorOccured()) {
422         __GLX_BEGIN_REPLY(0);
423         __GLX_SWAP_REPLY_HEADER();
424     } else {
425         __GLX_BEGIN_REPLY(compsize);
426         __GLX_SWAP_REPLY_HEADER();
427         __GLX_SWAP_INT(&width);
428         ((xGLXGetHistogramReply *)&__glXReply)->width = width;
429         __GLX_SEND_VOID_ARRAY(compsize);
430     }
431
432     return Success;
433 }
434
435 int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc)
436 {
437     const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
438
439     return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
440 }
441
442 int __glXDispSwap_GetHistogramEXT(__GLXclientState *cl, GLbyte *pc)
443 {
444     const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
445
446     return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
447 }
448
449 static int GetMinmax(__GLXclientState *cl, GLbyte *pc, GLXContextTag tag)
450 {
451     GLint compsize;
452     GLenum format, type, target;
453     GLboolean swapBytes, reset;
454     __GLXcontext *cx;
455     ClientPtr client = cl->client;
456     int error;
457     __GLX_DECLARE_SWAP_VARIABLES;
458     char *answer, answerBuffer[200];
459
460     cx = __glXForceCurrent(cl, tag, &error);
461     if (!cx) {
462         return error;
463     }
464
465     __GLX_SWAP_INT(pc+0);
466     __GLX_SWAP_INT(pc+4);
467     __GLX_SWAP_INT(pc+8);
468
469     format = *(GLenum *)(pc + 4);
470     type = *(GLenum *)(pc + 8);
471     target = *(GLenum *)(pc + 0);
472     swapBytes = *(GLboolean *)(pc + 12);
473     reset = *(GLboolean *)(pc + 13);
474
475     compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
476     if (compsize < 0) compsize = 0;
477
478     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
479     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
480     __glXClearErrorOccured();
481     CALL_GetMinmax( GET_DISPATCH(), (target, reset, format, type, answer) );
482
483     if (__glXErrorOccured()) {
484         __GLX_BEGIN_REPLY(0);
485         __GLX_SWAP_REPLY_HEADER();
486     } else {
487         __GLX_BEGIN_REPLY(compsize);
488         __GLX_SWAP_REPLY_HEADER();
489         __GLX_SEND_VOID_ARRAY(compsize);
490     }
491
492     return Success;
493 }
494
495 int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc)
496 {
497     const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
498
499     return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
500 }
501
502 int __glXDispSwap_GetMinmaxEXT(__GLXclientState *cl, GLbyte *pc)
503 {
504     const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
505
506     return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
507 }
508
509 static int GetColorTable(__GLXclientState *cl, GLbyte *pc, GLXContextTag tag)
510 {
511     GLint compsize;
512     GLenum format, type, target;
513     GLboolean swapBytes;
514     __GLXcontext *cx;
515     ClientPtr client = cl->client;
516     int error;
517     __GLX_DECLARE_SWAP_VARIABLES;
518     char *answer, answerBuffer[200];
519     GLint width=0;
520
521     cx = __glXForceCurrent(cl, tag, &error);
522     if (!cx) {
523         return error;
524     }
525
526     __GLX_SWAP_INT(pc+0);
527     __GLX_SWAP_INT(pc+4);
528     __GLX_SWAP_INT(pc+8);
529
530     format = *(GLenum *)(pc + 4);
531     type = *(GLenum *)(pc + 8);
532     target = *(GLenum *)(pc + 0);
533     swapBytes = *(GLboolean *)(pc + 12);
534
535     CALL_GetColorTableParameteriv( GET_DISPATCH(), (target, GL_COLOR_TABLE_WIDTH, &width) );
536     /*
537      * The one query above might fail if we're in a state where queries
538      * are illegal, but then width would still be zero anyway.
539      */
540     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
541     if (compsize < 0) compsize = 0;
542
543     CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
544     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
545     __glXClearErrorOccured();
546     CALL_GetColorTable( GET_DISPATCH(), (
547                   *(GLenum   *)(pc + 0),
548                   *(GLenum   *)(pc + 4),
549                   *(GLenum   *)(pc + 8),
550                   answer
551                   ) );
552
553     if (__glXErrorOccured()) {
554         __GLX_BEGIN_REPLY(0);
555         __GLX_SWAP_REPLY_HEADER();
556     } else {
557         __GLX_BEGIN_REPLY(compsize);
558         __GLX_SWAP_REPLY_HEADER();
559         __GLX_SWAP_INT(&width);
560         ((xGLXGetColorTableReply *)&__glXReply)->width = width;
561         __GLX_SEND_VOID_ARRAY(compsize);
562     }
563
564     return Success;
565 }
566
567 int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
568 {
569     const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc);
570
571     return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag);
572 }
573
574 int __glXDispSwap_GetColorTableSGI(__GLXclientState *cl, GLbyte *pc)
575 {
576     const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc);
577
578     return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
579 }