diff options
Diffstat (limited to 'xorg-server/glx')
-rw-r--r-- | xorg-server/glx/extension_string.c | 96 | ||||
-rw-r--r-- | xorg-server/glx/extension_string.h | 36 | ||||
-rw-r--r-- | xorg-server/glx/glxbyteorder.h | 4 | ||||
-rw-r--r-- | xorg-server/glx/glxdrawable.h | 28 | ||||
-rw-r--r-- | xorg-server/glx/glxext.h | 11 | ||||
-rw-r--r-- | xorg-server/glx/glxutil.h | 14 | ||||
-rw-r--r-- | xorg-server/glx/indirect_size.h | 114 | ||||
-rw-r--r-- | xorg-server/glx/indirect_size_get.h | 242 | ||||
-rw-r--r-- | xorg-server/glx/indirect_table.h | 8 | ||||
-rw-r--r-- | xorg-server/glx/singlesize.h | 8 | ||||
-rw-r--r-- | xorg-server/glx/unpack.h | 461 |
11 files changed, 504 insertions, 518 deletions
diff --git a/xorg-server/glx/extension_string.c b/xorg-server/glx/extension_string.c index 7721cb056..866f8bf45 100644 --- a/xorg-server/glx/extension_string.c +++ b/xorg-server/glx/extension_string.c @@ -45,10 +45,10 @@ #define EXT_ENABLED(bit,supported) (IS_SET(supported, bit)) struct extension_info { - const char * const name; - unsigned name_len; + const char *const name; + unsigned name_len; - unsigned char bit; + unsigned char bit; /** * This is the lowest version of GLX that "requires" this extension. @@ -56,37 +56,36 @@ struct extension_info { * SGI_make_current_read. If the extension is not required by any known * version of GLX, use 0, 0. */ - unsigned char version_major; - unsigned char version_minor; + unsigned char version_major; + unsigned char version_minor; /** * Is driver support forced by the ABI? */ - unsigned char driver_support; + unsigned char driver_support; }; static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ - { GLX(ARB_multisample), VER(1,4), Y, }, - - { GLX(EXT_import_context), VER(0,0), Y, }, - { GLX(EXT_texture_from_pixmap), VER(0,0), Y, }, - { GLX(EXT_visual_info), VER(0,0), Y, }, - { GLX(EXT_visual_rating), VER(0,0), Y, }, - - { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, - { GLX(OML_swap_method), VER(0,0), Y, }, - { GLX(SGI_make_current_read), VER(1,3), N, }, - { GLX(SGI_swap_control), VER(0,0), N, }, - { GLX(SGIS_multisample), VER(0,0), Y, }, - { GLX(SGIX_fbconfig), VER(1,3), Y, }, - { GLX(SGIX_pbuffer), VER(1,3), Y, }, - { GLX(SGIX_visual_select_group), VER(0,0), Y, }, - { GLX(INTEL_swap_event), VER(1,4), N, }, - { NULL } + {GLX(ARB_multisample), VER(1, 4), Y,}, + + {GLX(EXT_import_context), VER(0, 0), Y,}, + {GLX(EXT_texture_from_pixmap), VER(0, 0), Y,}, + {GLX(EXT_visual_info), VER(0, 0), Y,}, + {GLX(EXT_visual_rating), VER(0, 0), Y,}, + + {GLX(MESA_copy_sub_buffer), VER(0, 0), N,}, + {GLX(OML_swap_method), VER(0, 0), Y,}, + {GLX(SGI_make_current_read), VER(1, 3), N,}, + {GLX(SGI_swap_control), VER(0, 0), N,}, + {GLX(SGIS_multisample), VER(0, 0), Y,}, + {GLX(SGIX_fbconfig), VER(1, 3), Y,}, + {GLX(SGIX_pbuffer), VER(1, 3), Y,}, + {GLX(SGIX_visual_select_group), VER(0, 0), Y,}, + {GLX(INTEL_swap_event), VER(1, 4), N,}, + {NULL} }; - /** * Create a GLX extension string for a set of enable bits. * @@ -111,56 +110,51 @@ __glXGetExtensionString(const unsigned char *enable_bits, char *buffer) unsigned i; int length = 0; - for (i = 0; known_glx_extensions[i].name != NULL; i++) { - const unsigned bit = known_glx_extensions[i].bit; - const size_t len = known_glx_extensions[i].name_len; - - if (EXT_ENABLED(bit, enable_bits)) { - if (buffer != NULL) { - (void) memcpy(& buffer[length], known_glx_extensions[i].name, - len); - - buffer[length + len + 0] = ' '; - buffer[length + len + 1] = '\0'; - } - - length += len + 1; - } + const unsigned bit = known_glx_extensions[i].bit; + const size_t len = known_glx_extensions[i].name_len; + + if (EXT_ENABLED(bit, enable_bits)) { + if (buffer != NULL) { + (void) memcpy(&buffer[length], known_glx_extensions[i].name, + len); + + buffer[length + len + 0] = ' '; + buffer[length + len + 1] = '\0'; + } + + length += len + 1; + } } return length + 1; } - void __glXEnableExtension(unsigned char *enable_bits, const char *ext) { const size_t ext_name_len = strlen(ext); unsigned i; - for (i = 0; known_glx_extensions[i].name != NULL; i++) { - if ((ext_name_len == known_glx_extensions[i].name_len) - && (memcmp(ext, known_glx_extensions[i].name, ext_name_len) == 0)) { - SET_BIT(enable_bits, known_glx_extensions[i].bit); - break; - } + if ((ext_name_len == known_glx_extensions[i].name_len) + && (memcmp(ext, known_glx_extensions[i].name, ext_name_len) == 0)) { + SET_BIT(enable_bits, known_glx_extensions[i].bit); + break; + } } } - void __glXInitExtensionEnableBits(unsigned char *enable_bits) { unsigned i; - (void) memset(enable_bits, 0, __GLX_EXT_BYTES); for (i = 0; known_glx_extensions[i].name != NULL; i++) { - if (known_glx_extensions[i].driver_support) { - SET_BIT(enable_bits, known_glx_extensions[i].bit); - } + if (known_glx_extensions[i].driver_support) { + SET_BIT(enable_bits, known_glx_extensions[i].bit); + } } } diff --git a/xorg-server/glx/extension_string.h b/xorg-server/glx/extension_string.h index 912534a04..e02213f8f 100644 --- a/xorg-server/glx/extension_string.h +++ b/xorg-server/glx/extension_string.h @@ -36,29 +36,29 @@ enum { /* GLX_ARB_get_proc_address is implemented on the client. */ - ARB_multisample_bit = 0, - EXT_import_context_bit, - EXT_texture_from_pixmap_bit, - EXT_visual_info_bit, - EXT_visual_rating_bit, - MESA_copy_sub_buffer_bit, - OML_swap_method_bit, - SGI_make_current_read_bit, - SGI_swap_control_bit, - SGI_video_sync_bit, - SGIS_multisample_bit, - SGIX_fbconfig_bit, - SGIX_pbuffer_bit, - SGIX_visual_select_group_bit, - INTEL_swap_event_bit, - __NUM_GLX_EXTS, + ARB_multisample_bit = 0, + EXT_import_context_bit, + EXT_texture_from_pixmap_bit, + EXT_visual_info_bit, + EXT_visual_rating_bit, + MESA_copy_sub_buffer_bit, + OML_swap_method_bit, + SGI_make_current_read_bit, + SGI_swap_control_bit, + SGI_video_sync_bit, + SGIS_multisample_bit, + SGIX_fbconfig_bit, + SGIX_pbuffer_bit, + SGIX_visual_select_group_bit, + INTEL_swap_event_bit, + __NUM_GLX_EXTS, }; #define __GLX_EXT_BYTES ((__NUM_GLX_EXTS + 7) / 8) extern int __glXGetExtensionString(const unsigned char *enable_bits, - char *buffer); + char *buffer); extern void __glXEnableExtension(unsigned char *enable_bits, const char *ext); extern void __glXInitExtensionEnableBits(unsigned char *enable_bits); -#endif /* GLX_EXTENSION_STRING_H */ +#endif /* GLX_EXTENSION_STRING_H */ diff --git a/xorg-server/glx/glxbyteorder.h b/xorg-server/glx/glxbyteorder.h index cdf6b15f0..73f0f7df7 100644 --- a/xorg-server/glx/glxbyteorder.h +++ b/xorg-server/glx/glxbyteorder.h @@ -51,11 +51,11 @@ #define bswap_32(value) \ (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ (uint32_t)bswap_16((uint16_t)((value) >> 16))) - + #define bswap_64(value) \ (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \ << 32) | \ (uint64_t)bswap_32((uint32_t)((value) >> 32))) #endif -#endif /* !defined(__GLXBYTEORDER_H__) */ +#endif /* !defined(__GLXBYTEORDER_H__) */ diff --git a/xorg-server/glx/glxdrawable.h b/xorg-server/glx/glxdrawable.h index 2a365c505..007658961 100644 --- a/xorg-server/glx/glxdrawable.h +++ b/xorg-server/glx/glxdrawable.h @@ -44,34 +44,34 @@ enum { }; struct __GLXdrawable { - void (*destroy)(__GLXdrawable *private); - GLboolean (*swapBuffers)(ClientPtr client, __GLXdrawable *); - void (*copySubBuffer)(__GLXdrawable *drawable, - int x, int y, int w, int h); - void (*waitX)(__GLXdrawable *); - void (*waitGL)(__GLXdrawable *); + void (*destroy) (__GLXdrawable * private); + GLboolean(*swapBuffers) (ClientPtr client, __GLXdrawable *); + void (*copySubBuffer) (__GLXdrawable * drawable, + int x, int y, int w, int h); + void (*waitX) (__GLXdrawable *); + void (*waitGL) (__GLXdrawable *); DrawablePtr pDraw; XID drawId; /* - ** Either GLX_DRAWABLE_PIXMAP, GLX_DRAWABLE_WINDOW or - ** GLX_DRAWABLE_PBUFFER. - */ + ** Either GLX_DRAWABLE_PIXMAP, GLX_DRAWABLE_WINDOW or + ** GLX_DRAWABLE_PBUFFER. + */ int type; /* - ** Configuration of the visual to which this drawable was created. - */ + ** Configuration of the visual to which this drawable was created. + */ __GLXconfig *config; GLenum target; GLenum format; /* - ** Event mask - */ + ** Event mask + */ unsigned long eventMask; }; -#endif /* !__GLX_drawable_h__ */ +#endif /* !__GLX_drawable_h__ */ diff --git a/xorg-server/glx/glxext.h b/xorg-server/glx/glxext.h index 3c1be9c54..fd74411d7 100644 --- a/xorg-server/glx/glxext.h +++ b/xorg-server/glx/glxext.h @@ -41,17 +41,16 @@ #define SERVEXTERN _declspec(dllexport) #endif -extern GLboolean __glXFreeContext(__GLXcontext *glxc); +extern GLboolean __glXFreeContext(__GLXcontext * glxc); extern void __glXFlushContextCache(void); -extern void __glXAddToContextList(__GLXcontext *cx); +extern void __glXAddToContextList(__GLXcontext * cx); SERVEXTERN void __glXErrorCallBack(GLenum code); extern void __glXClearErrorOccured(void); extern GLboolean __glXErrorOccured(void); -extern void __glXResetLargeCommandStatus(__GLXclientState*); +extern void __glXResetLargeCommandStatus(__GLXclientState *); extern const char GLServerVersion[]; -extern int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap); - -#endif /* _glxext_h_ */ +extern int DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap); +#endif /* _glxext_h_ */ diff --git a/xorg-server/glx/glxutil.h b/xorg-server/glx/glxutil.h index d1a715b4b..314606da2 100644 --- a/xorg-server/glx/glxutil.h +++ b/xorg-server/glx/glxutil.h @@ -35,17 +35,17 @@ * Silicon Graphics, Inc. */ -extern GLboolean __glXDrawableInit(__GLXdrawable *drawable, - __GLXscreen *screen, - DrawablePtr pDraw, int type, XID drawID, - __GLXconfig *config); -extern void __glXDrawableRelease(__GLXdrawable *drawable); +extern GLboolean __glXDrawableInit(__GLXdrawable * drawable, + __GLXscreen * screen, + DrawablePtr pDraw, int type, XID drawID, + __GLXconfig * config); +extern void __glXDrawableRelease(__GLXdrawable * drawable); /* context helper routines */ -extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag); +extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag); /* init helper routines */ extern void *__glXglDDXScreenInfo(void); extern void *__glXglDDXExtensionInfo(void); -#endif /* _glxcmds_h_ */ +#endif /* _glxcmds_h_ */ diff --git a/xorg-server/glx/indirect_size.h b/xorg-server/glx/indirect_size.h index a760d0580..b1be16b3c 100644 --- a/xorg-server/glx/indirect_size.h +++ b/xorg-server/glx/indirect_size.h @@ -1,57 +1,57 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2004 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#if !defined( _INDIRECT_SIZE_H_ ) -# define _INDIRECT_SIZE_H_ - -/** - * \file - * Prototypes for functions used to determine the number of data elements in - * various GLX protocol messages. - * - * \author Ian Romanick <idr@us.ibm.com> - */ - -#include <X11/Xfuncproto.h> - -# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif - -# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif - - -# undef PURE -# undef FASTCALL - -#endif /* !defined( _INDIRECT_SIZE_H_ ) */ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if !defined( _INDIRECT_SIZE_H_ )
+# define _INDIRECT_SIZE_H_
+
+/**
+ * \file
+ * Prototypes for functions used to determine the number of data elements in
+ * various GLX protocol messages.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+#include <X11/Xfuncproto.h>
+
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif
+
+# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define FASTCALL __attribute__((fastcall))
+# else
+# define FASTCALL
+# endif
+
+
+# undef PURE
+# undef FASTCALL
+
+#endif /* !defined( _INDIRECT_SIZE_H_ ) */
diff --git a/xorg-server/glx/indirect_size_get.h b/xorg-server/glx/indirect_size_get.h index d07422b0c..1d51c4b9c 100644 --- a/xorg-server/glx/indirect_size_get.h +++ b/xorg-server/glx/indirect_size_get.h @@ -1,121 +1,121 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2004 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#if !defined( _INDIRECT_SIZE_GET_H_ ) -# define _INDIRECT_SIZE_GET_H_ - -/** - * \file - * Prototypes for functions used to determine the number of data elements in - * various GLX protocol messages. - * - * \author Ian Romanick <idr@us.ibm.com> - */ - -#include <X11/Xfuncproto.h> - -# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif - -# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif - -extern _X_INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetPointerv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glPointParameterfvEXT_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribivNV_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glPointParameterivNV_size(GLenum); -extern _X_INTERNAL PURE FASTCALL GLint __glGetFramebufferAttachmentParameterivEXT_size(GLenum); - -# undef PURE -# undef FASTCALL - -#endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if !defined( _INDIRECT_SIZE_GET_H_ )
+# define _INDIRECT_SIZE_GET_H_
+
+/**
+ * \file
+ * Prototypes for functions used to determine the number of data elements in
+ * various GLX protocol messages.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+#include <X11/Xfuncproto.h>
+
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif
+
+# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define FASTCALL __attribute__((fastcall))
+# else
+# define FASTCALL
+# endif
+
+extern _X_INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetPointerv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glPointParameterfvEXT_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribivNV_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glPointParameterivNV_size(GLenum);
+extern _X_INTERNAL PURE FASTCALL GLint __glGetFramebufferAttachmentParameterivEXT_size(GLenum);
+
+# undef PURE
+# undef FASTCALL
+
+#endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */
diff --git a/xorg-server/glx/indirect_table.h b/xorg-server/glx/indirect_table.h index 4af1ccbea..a39dc4e3d 100644 --- a/xorg-server/glx/indirect_table.h +++ b/xorg-server/glx/indirect_table.h @@ -45,8 +45,8 @@ struct __glXDispatchInfo { /** */ - const int_fast16_t * dispatch_tree; - + const int_fast16_t *dispatch_tree; + /** * Array of protocol decode and dispatch functions index by the opcode * search tree (i.e., \c dispatch_tree). The first element in each pair @@ -70,7 +70,7 @@ struct __glXDispatchInfo { * If size checking is not to be performed on this type of protocol * data, this pointer will be \c NULL. */ - const int_fast16_t (*size_table)[2]; + const int_fast16_t(*size_table)[2]; /** * Array of functions used to calculate the variable-size portion of @@ -103,4 +103,4 @@ extern const struct __glXDispatchInfo Single_dispatch_info; extern const struct __glXDispatchInfo Render_dispatch_info; extern const struct __glXDispatchInfo VendorPriv_dispatch_info; -#endif /* INDIRECT_TABLE_H */ +#endif /* INDIRECT_TABLE_H */ diff --git a/xorg-server/glx/singlesize.h b/xorg-server/glx/singlesize.h index 78826dfb0..dc85d3d36 100644 --- a/xorg-server/glx/singlesize.h +++ b/xorg-server/glx/singlesize.h @@ -38,7 +38,7 @@ #include "indirect_size.h" extern GLint __glReadPixels_size(GLenum format, GLenum type, - GLint width, GLint height); + GLint width, GLint height); extern GLint __glGetMap_size(GLenum pname, GLenum query); extern GLint __glGetMapdv_size(GLenum target, GLenum query); extern GLint __glGetMapfv_size(GLenum target, GLenum query); @@ -48,7 +48,7 @@ extern GLint __glGetPixelMapfv_size(GLenum map); extern GLint __glGetPixelMapuiv_size(GLenum map); extern GLint __glGetPixelMapusv_size(GLenum map); extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format, - GLenum type, GLint width, GLint height, - GLint depth); + GLenum type, GLint width, GLint height, + GLint depth); -#endif /* _singlesize_h_ */ +#endif /* _singlesize_h_ */ diff --git a/xorg-server/glx/unpack.h b/xorg-server/glx/unpack.h index a5f211555..0a088fc33 100644 --- a/xorg-server/glx/unpack.h +++ b/xorg-server/glx/unpack.h @@ -1,234 +1,227 @@ -#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef __GLX_unpack_h__
-#define __GLX_unpack_h__
-
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
-
-/*
-** Fetch the context-id out of a SingleReq request pointed to by pc.
-*/
-#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
-#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
-
-/*
-** Fetch a double from potentially unaligned memory.
-*/
-#ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n)
-#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
-#else
-#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
-#endif
-
-extern void __glXMemInit(void);
-
-extern xGLXSingleReply __glXReply;
-
-#define __GLX_BEGIN_REPLY(size) \
- __glXReply.length = __GLX_PAD(size) >> 2; \
- __glXReply.type = X_Reply; \
- __glXReply.sequenceNumber = client->sequence;
-
-#define __GLX_SEND_HEADER() \
- WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
-
-#define __GLX_PUT_RETVAL(a) \
- __glXReply.retval = (a);
-
-#define __GLX_PUT_SIZE(a) \
- __glXReply.size = (a);
-
-#define __GLX_PUT_RENDERMODE(m) \
- __glXReply.pad3 = (m)
-
-/*
-** Get a buffer to hold returned data, with the given alignment. If we have
-** to realloc, allocate size+align, in case the pointer has to be bumped for
-** alignment. The answerBuffer should already be aligned.
-**
-** NOTE: the cast (long)res below assumes a long is large enough to hold a
-** pointer.
-*/
-#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
- if ((size) > sizeof(answerBuffer)) { \
- int bump; \
- if ((cl)->returnBufSize < (size)+(align)) { \
- (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
- (size)+(align)); \
- if (!(cl)->returnBuf) { \
- return BadAlloc; \
- } \
- (cl)->returnBufSize = (size)+(align); \
- } \
- res = (char*)cl->returnBuf; \
- bump = (long)(res) % (align); \
- if (bump) res += (align) - (bump); \
- } else { \
- res = (char *)answerBuffer; \
- }
-
-#define __GLX_PUT_BYTE() \
- *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
-
-#define __GLX_PUT_SHORT() \
- *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
-
-#define __GLX_PUT_INT() \
- *(GLint *)&__glXReply.pad3 = *(GLint *)answer
-
-#define __GLX_PUT_FLOAT() \
- *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
-
-#define __GLX_PUT_DOUBLE() \
- *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
-
-#define __GLX_SEND_BYTE_ARRAY(len) \
- WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
-
-#define __GLX_SEND_SHORT_ARRAY(len) \
- WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
-
-#define __GLX_SEND_INT_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
-
-#define __GLX_SEND_FLOAT_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
-
-#define __GLX_SEND_DOUBLE_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
-
-
-#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
-#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
-#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
-#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
-
-/*
-** PERFORMANCE NOTE:
-** Machine dependent optimizations abound here; these swapping macros can
-** conceivably be replaced with routines that do the job faster.
-*/
-#define __GLX_DECLARE_SWAP_VARIABLES \
- GLbyte sw
-
-#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
- GLbyte *swapPC; \
- GLbyte *swapEnd
-
-
-#define __GLX_SWAP_INT(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
- ((GLbyte *)(pc))[3] = sw; \
- sw = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = sw;
-
-#define __GLX_SWAP_SHORT(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = sw;
-
-#define __GLX_SWAP_DOUBLE(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
- ((GLbyte *)(pc))[7] = sw; \
- sw = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
- ((GLbyte *)(pc))[6] = sw; \
- sw = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
- ((GLbyte *)(pc))[5] = sw; \
- sw = ((GLbyte *)(pc))[3]; \
- ((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
- ((GLbyte *)(pc))[4] = sw;
-
-#define __GLX_SWAP_FLOAT(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
- ((GLbyte *)(pc))[3] = sw; \
- sw = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = sw;
-
-#define __GLX_SWAP_INT_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_INT(swapPC); \
- swapPC += __GLX_SIZE_INT32; \
- }
-
-#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_SHORT(swapPC); \
- swapPC += __GLX_SIZE_INT16; \
- }
-
-#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_DOUBLE(swapPC); \
- swapPC += __GLX_SIZE_FLOAT64; \
- }
-
-#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_FLOAT(swapPC); \
- swapPC += __GLX_SIZE_FLOAT32; \
- }
-
-#define __GLX_SWAP_REPLY_HEADER() \
- __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
- __GLX_SWAP_INT(&__glXReply.length);
-
-#define __GLX_SWAP_REPLY_RETVAL() \
- __GLX_SWAP_INT(&__glXReply.retval)
-
-#define __GLX_SWAP_REPLY_SIZE() \
- __GLX_SWAP_INT(&__glXReply.size)
-
-#endif /* !__GLX_unpack_h__ */
-
-
-
-
-
+#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#ifndef __GLX_unpack_h__ +#define __GLX_unpack_h__ + +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#define __GLX_PAD(s) (((s)+3) & (GLuint)~3) + +/* +** Fetch the context-id out of a SingleReq request pointed to by pc. +*/ +#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag) +#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag) + +/* +** Fetch a double from potentially unaligned memory. +*/ +#ifdef __GLX_ALIGN64 +#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n) +#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8) +#else +#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src)) +#endif + +extern void __glXMemInit(void); + +extern xGLXSingleReply __glXReply; + +#define __GLX_BEGIN_REPLY(size) \ + __glXReply.length = __GLX_PAD(size) >> 2; \ + __glXReply.type = X_Reply; \ + __glXReply.sequenceNumber = client->sequence; + +#define __GLX_SEND_HEADER() \ + WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply); + +#define __GLX_PUT_RETVAL(a) \ + __glXReply.retval = (a); + +#define __GLX_PUT_SIZE(a) \ + __glXReply.size = (a); + +#define __GLX_PUT_RENDERMODE(m) \ + __glXReply.pad3 = (m) + +/* +** Get a buffer to hold returned data, with the given alignment. If we have +** to realloc, allocate size+align, in case the pointer has to be bumped for +** alignment. The answerBuffer should already be aligned. +** +** NOTE: the cast (long)res below assumes a long is large enough to hold a +** pointer. +*/ +#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \ + if ((size) > sizeof(answerBuffer)) { \ + int bump; \ + if ((cl)->returnBufSize < (size)+(align)) { \ + (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \ + (size)+(align)); \ + if (!(cl)->returnBuf) { \ + return BadAlloc; \ + } \ + (cl)->returnBufSize = (size)+(align); \ + } \ + res = (char*)cl->returnBuf; \ + bump = (long)(res) % (align); \ + if (bump) res += (align) - (bump); \ + } else { \ + res = (char *)answerBuffer; \ + } + +#define __GLX_PUT_BYTE() \ + *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer + +#define __GLX_PUT_SHORT() \ + *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer + +#define __GLX_PUT_INT() \ + *(GLint *)&__glXReply.pad3 = *(GLint *)answer + +#define __GLX_PUT_FLOAT() \ + *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer + +#define __GLX_PUT_DOUBLE() \ + *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer + +#define __GLX_SEND_BYTE_ARRAY(len) \ + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer) + +#define __GLX_SEND_SHORT_ARRAY(len) \ + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer) + +#define __GLX_SEND_INT_ARRAY(len) \ + WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer) + +#define __GLX_SEND_FLOAT_ARRAY(len) \ + WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer) + +#define __GLX_SEND_DOUBLE_ARRAY(len) \ + WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer) + +#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) +#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) +#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len) +#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len) + +/* +** PERFORMANCE NOTE: +** Machine dependent optimizations abound here; these swapping macros can +** conceivably be replaced with routines that do the job faster. +*/ +#define __GLX_DECLARE_SWAP_VARIABLES \ + GLbyte sw + +#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \ + GLbyte *swapPC; \ + GLbyte *swapEnd + +#define __GLX_SWAP_INT(pc) \ + sw = ((GLbyte *)(pc))[0]; \ + ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \ + ((GLbyte *)(pc))[3] = sw; \ + sw = ((GLbyte *)(pc))[1]; \ + ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \ + ((GLbyte *)(pc))[2] = sw; + +#define __GLX_SWAP_SHORT(pc) \ + sw = ((GLbyte *)(pc))[0]; \ + ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \ + ((GLbyte *)(pc))[1] = sw; + +#define __GLX_SWAP_DOUBLE(pc) \ + sw = ((GLbyte *)(pc))[0]; \ + ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \ + ((GLbyte *)(pc))[7] = sw; \ + sw = ((GLbyte *)(pc))[1]; \ + ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \ + ((GLbyte *)(pc))[6] = sw; \ + sw = ((GLbyte *)(pc))[2]; \ + ((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \ + ((GLbyte *)(pc))[5] = sw; \ + sw = ((GLbyte *)(pc))[3]; \ + ((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \ + ((GLbyte *)(pc))[4] = sw; + +#define __GLX_SWAP_FLOAT(pc) \ + sw = ((GLbyte *)(pc))[0]; \ + ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \ + ((GLbyte *)(pc))[3] = sw; \ + sw = ((GLbyte *)(pc))[1]; \ + ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \ + ((GLbyte *)(pc))[2] = sw; + +#define __GLX_SWAP_INT_ARRAY(pc, count) \ + swapPC = ((GLbyte *)(pc)); \ + swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\ + while (swapPC < swapEnd) { \ + __GLX_SWAP_INT(swapPC); \ + swapPC += __GLX_SIZE_INT32; \ + } + +#define __GLX_SWAP_SHORT_ARRAY(pc, count) \ + swapPC = ((GLbyte *)(pc)); \ + swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\ + while (swapPC < swapEnd) { \ + __GLX_SWAP_SHORT(swapPC); \ + swapPC += __GLX_SIZE_INT16; \ + } + +#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \ + swapPC = ((GLbyte *)(pc)); \ + swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\ + while (swapPC < swapEnd) { \ + __GLX_SWAP_DOUBLE(swapPC); \ + swapPC += __GLX_SIZE_FLOAT64; \ + } + +#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \ + swapPC = ((GLbyte *)(pc)); \ + swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\ + while (swapPC < swapEnd) { \ + __GLX_SWAP_FLOAT(swapPC); \ + swapPC += __GLX_SIZE_FLOAT32; \ + } + +#define __GLX_SWAP_REPLY_HEADER() \ + __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \ + __GLX_SWAP_INT(&__glXReply.length); + +#define __GLX_SWAP_REPLY_RETVAL() \ + __GLX_SWAP_INT(&__glXReply.retval) + +#define __GLX_SWAP_REPLY_SIZE() \ + __GLX_SWAP_INT(&__glXReply.size) + +#endif /* !__GLX_unpack_h__ */ |