diff options
Diffstat (limited to 'xc/lib')
71 files changed, 1284 insertions, 828 deletions
diff --git a/xc/lib/FS/Imakefile b/xc/lib/FS/Imakefile index e297d0d22..b0fb7a817 100644 --- a/xc/lib/FS/Imakefile +++ b/xc/lib/FS/Imakefile @@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:44:07 cpqbld Exp $ -XCOMM $XFree86: xc/lib/FS/Imakefile,v 3.5 2001/01/17 19:41:28 dawes Exp $ +XCOMM $XFree86: xc/lib/FS/Imakefile,v 3.6 2001/04/23 16:17:06 tsi Exp $ #define DoNormalLib NormalLibFS #define DoSharedLib SharedLibFS @@ -19,7 +19,7 @@ XCOMM $XFree86: xc/lib/FS/Imakefile,v 3.5 2001/01/17 19:41:28 dawes Exp $ DEFINES = -DMALLOC_0_RETURNS_NULL #endif -DEPEND_DEFINES = $(TRANS_INCLUDES) $(CONN_DEFINES) +DEPEND_DEFINES = $(TRANS_INCLUDES) $(CONN_DEFINES) DependDefines HEADERS = FSlib.h diff --git a/xc/lib/GL/dri/dri_glx.c b/xc/lib/GL/dri/dri_glx.c index 20884c16b..75b3347b3 100644 --- a/xc/lib/GL/dri/dri_glx.c +++ b/xc/lib/GL/dri/dri_glx.c @@ -24,7 +24,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.7 2000/09/26 15:56:45 tsi Exp $ */ +/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.8 2001/04/10 16:07:49 dawes Exp $ */ /* * Authors: @@ -46,6 +46,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <dlfcn.h> #include "dri_glx.h" #include <sys/types.h> +#include <stdarg.h> typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, @@ -68,6 +69,43 @@ extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, #endif +static void InfoMessageF(const char *f, ...) +{ + va_list args; + const char *env; + + if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) { + fprintf(stderr, "libGL: "); + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + } +} + +static void ErrorMessageF(const char *f, ...) +{ + va_list args; + + if (getenv("LIBGL_DEBUG")) { + fprintf(stderr, "libGL error: "); + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + } +} + +static void PrintF(const char *f, ...) +{ + va_list args; + const char *env; + + if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) { + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + } +} + static void ErrorMessage(const char *msg) { if (getenv("LIBGL_DEBUG")) { @@ -180,22 +218,19 @@ static void *OpenDriver(const char *driverName) libPaths = DEFAULT_DRIVER_DIR; for (i = 0; ; i++) { - char libDir[1000], info[1000], realDriverName[100]; + char libDir[1000], realDriverName[200]; void *handle; ExtractDir(i, libPaths, 1000, libDir); if (!libDir[0]) return NULL; - sprintf(realDriverName, "%s/%s_dri.so", libDir, driverName); - sprintf(info, "trying %s", realDriverName); - InfoMessage(info); + snprintf(realDriverName, 200, "%s/%s_dri.so", libDir, driverName); + InfoMessageF("trying %s\n", realDriverName); handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL); if (handle) { return handle; } else { - char message[1000]; - snprintf(message, 1000, "dlopen failed: %s", dlerror()); - ErrorMessage(message); + ErrorMessageF("dlopen failed: %s\n", dlerror()); } } @@ -246,9 +281,7 @@ static void Find_CreateScreenFuncs(Display *dpy, b = XF86DRIGetClientDriverName(dpy, scrn, &driverMajor, &driverMinor, &driverPatch, &driverName); if (!b) { - char message[1000]; - snprintf(message, 1000, "Cannot determine driver name for screen %d", scrn); - ErrorMessage(message); + ErrorMessageF("Cannot determine driver name for screen %d\n", scrn); continue; } @@ -265,7 +298,7 @@ static void Find_CreateScreenFuncs(Display *dpy, /* success! */ createFuncs[scrn] = createScreenFunc; libraryHandles[scrn] = handle; - break; /* onto the next screen */ + continue; /* onto the next screen */ } else { ErrorMessage("driCreateScreen() not defined in driver!"); @@ -366,7 +399,6 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) static void register_extensions_on_screen(Display *dpy, int scrNum) { - GLboolean verbose = GL_FALSE; /* for debugging only */ int eventBase, errorBase; Bool b, b2; int driMajor, driMinor, driPatch; @@ -380,34 +412,29 @@ register_extensions_on_screen(Display *dpy, int scrNum) */ b = XF86DRIQueryExtension(dpy, &eventBase, &errorBase); if (!b) { - if (verbose) - fprintf(stderr, "XF86DRIQueryExtension failed\n"); + InfoMessage("XF86DRIQueryExtension failed"); return; } b = XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &b2); if (!b || !b2) { - if (verbose) - fprintf(stderr, "XF86DRIQueryDirectRenderingCapable failed\n"); + InfoMessage("XF86DRIQueryDirectRenderingCapable failed"); return; } b = XF86DRIQueryVersion(dpy, &driMajor, &driMinor, &driPatch); if (!b) { - if (verbose) - fprintf(stderr, "XF86DRIQueryVersion failed\n"); - return; + InfoMessage("XF86DRIQueryVersion failed"); } b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor, &driverPatch, &driverName); if (!b) { - if (verbose) - fprintf(stderr, "XF86DRIGetClientDriverName failed\n"); + InfoMessage("XF86DRIGetClientDriverName failed"); return; } - else if (verbose) { - printf("XF86DRIGetClientDriverName: %d.%d.%d %s\n", driverMajor, + else { + InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s\n", driverMajor, driverMinor, driverPatch, driverName); } @@ -446,8 +473,10 @@ void __glXRegisterExtensions(void) { static GLboolean alreadyCalled = GL_FALSE; - if (alreadyCalled) + + if (alreadyCalled) { return; + } #ifndef BUILT_IN_DRI_DRIVER { diff --git a/xc/lib/GL/dri/drm/Imakefile b/xc/lib/GL/dri/drm/Imakefile index 769b08355..274540f16 100644 --- a/xc/lib/GL/dri/drm/Imakefile +++ b/xc/lib/GL/dri/drm/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.15 2001/04/03 02:29:32 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.16 2001/04/23 19:02:11 alanh Exp $ #if GlxUseBuiltInDRIDriver #define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) @@ -42,7 +42,7 @@ OS_SUBDIR = cygwin OS_SUBDIR2 = cygwin #endif -LinkSourceFile(xf86drm.c,$(XF86OSSRC)/$(OS_SUBDIR)/drm) +LinkSourceFile(xf86drm.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm) LinkSourceFile(xf86drmHash.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm) LinkSourceFile(xf86drmRandom.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm) diff --git a/xc/lib/GL/glx/glxclient.h b/xc/lib/GL/glx/glxclient.h index 7bbb35745..0973bd682 100644 --- a/xc/lib/GL/glx/glxclient.h +++ b/xc/lib/GL/glx/glxclient.h @@ -30,9 +30,8 @@ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. -** */ -/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.12 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.13 2001/04/10 16:07:49 dawes Exp $ */ /* * Direct rendering support added by Precision Insight, Inc. diff --git a/xc/lib/GL/glx/glxcmds.c b/xc/lib/GL/glx/glxcmds.c index 3376c188c..2bfcc1a8d 100644 --- a/xc/lib/GL/glx/glxcmds.c +++ b/xc/lib/GL/glx/glxcmds.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.14 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.15 2001/04/07 01:39:39 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -38,7 +38,7 @@ #include "glxclient.h" #include <extutil.h> #include <Xext.h> -#include <strings.h> +#include <string.h> #include "glapi.h" #ifdef GLX_DIRECT_RENDERING #include "indirect_init.h" diff --git a/xc/lib/GL/glx/glxext.c b/xc/lib/GL/glx/glxext.c index 233dce353..f25a8a9eb 100644 --- a/xc/lib/GL/glx/glxext.c +++ b/xc/lib/GL/glx/glxext.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.12 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.13 2001/04/10 16:07:49 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are @@ -448,11 +448,14 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv) #ifdef GLX_DIRECT_RENDERING /* Initialize the direct rendering per screen data and functions */ - if (priv->driDisplay.private) + if (priv->driDisplay.private && + priv->driDisplay.createScreen && + priv->driDisplay.createScreen[i]) { psc->driScreen.private = - (*priv->driDisplay.createScreen)(dpy, i, &psc->driScreen, + (*(priv->driDisplay.createScreen[i]))(dpy, i, &psc->driScreen, psc->numConfigs, psc->configs); + } #endif } SyncHandle(); diff --git a/xc/lib/GL/mesa/dri/dri_mesa.c b/xc/lib/GL/mesa/dri/dri_mesa.c index 06846ac44..097872382 100644 --- a/xc/lib/GL/mesa/dri/dri_mesa.c +++ b/xc/lib/GL/mesa/dri/dri_mesa.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/dri/dri_mesa.c,v 1.15 2001/03/21 16:14:19 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/dri/dri_mesa.c,v 1.16 2001/04/10 16:07:49 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -459,7 +459,7 @@ static Bool driMesaBindContext(Display *dpy, int scrn, if (try) { if (psp->fullscreen && !psp->pSAREA->frame.fullscreen) { /* Server has closed fullscreen mode */ - __driMesaMessage("server closed fullscreen mode\n"); + __driMesaMessage("server closed fullscreen mode"); psp->fullscreen = NULL; } if (XF86DRIOpenFullScreen(dpy, scrn, draw)) { diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c index 8b06ef77b..eb32c8a24 100644 --- a/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c +++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.1 2000/06/20 05:08:38 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.2 2001/04/10 16:07:50 dawes Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -16,9 +16,9 @@ * 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 - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS 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 + * DAVID MILLER, OR ANY OTHER CONTRIBUTORS 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. * * @@ -53,7 +53,7 @@ static const GLubyte *ffbDDGetString(GLcontext *ctx, GLenum name) case GL_VENDOR: return (GLubyte *) "David S. Miller"; case GL_RENDERER: - return (GLubyte *) "DRI-FFB"; + return (GLubyte *) "Mesa DRI FFB 20010321"; default: return NULL; }; diff --git a/xc/lib/GL/mesa/src/drv/i810/i810dd.c b/xc/lib/GL/mesa/src/drv/i810/i810dd.c index eb78a91c6..910108010 100644 --- a/xc/lib/GL/mesa/src/drv/i810/i810dd.c +++ b/xc/lib/GL/mesa/src/drv/i810/i810dd.c @@ -15,13 +15,13 @@ * 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 - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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 + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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. * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810dd.c,v 1.4 2000/09/24 13:51:04 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810dd.c,v 1.5 2001/04/10 16:07:50 dawes Exp $ */ #include "types.h" #include "vbrender.h" @@ -56,7 +56,7 @@ static const GLubyte *i810DDGetString( GLcontext *ctx, GLenum name ) case GL_VENDOR: return (GLubyte *)"Keith Whitwell, Precision Insight Inc."; case GL_RENDERER: - return (GLubyte *)"Mesa DRI I810 20000510"; + return (GLubyte *)"Mesa DRI I810 20010321"; default: return 0; } @@ -65,10 +65,10 @@ static const GLubyte *i810DDGetString( GLcontext *ctx, GLenum name ) static GLint i810GetParameteri(const GLcontext *ctx, GLint param) { switch (param) { - case DD_HAVE_HARDWARE_FOG: + case DD_HAVE_HARDWARE_FOG: return 1; default: - return 0; + return 0; } } @@ -76,7 +76,7 @@ static GLint i810GetParameteri(const GLcontext *ctx, GLint param) static void i810BufferSize(GLcontext *ctx, GLuint *width, GLuint *height) { - i810ContextPtr imesa = I810_CONTEXT(ctx); + i810ContextPtr imesa = I810_CONTEXT(ctx); /* Need to lock to make sure the driDrawable is uptodate. This * information is used to resize Mesa's software buffers, so it has @@ -104,19 +104,19 @@ void i810DDExtensionsInit( GLcontext *ctx ) /* The imaging subset of 1.2 isn't supported by any mesa driver. */ gl_extensions_disable( ctx, "ARB_imaging" ); - gl_extensions_disable( ctx, "GL_ARB_texture_compression" ); - gl_extensions_disable( ctx, "GL_ARB_texture_cube_map" ); + gl_extensions_disable( ctx, "GL_ARB_texture_compression" ); + gl_extensions_disable( ctx, "GL_ARB_texture_cube_map" ); gl_extensions_disable( ctx, "GL_EXT_blend_color" ); gl_extensions_disable( ctx, "GL_EXT_blend_logic_op" ); gl_extensions_disable( ctx, "GL_EXT_blend_minmax" ); gl_extensions_disable( ctx, "GL_EXT_blend_subtract" ); - gl_extensions_disable( ctx, "GL_EXT_convolution" ); - gl_extensions_disable( ctx, "GL_EXT_texture_lod_bias" ); + gl_extensions_disable( ctx, "GL_EXT_convolution" ); + gl_extensions_disable( ctx, "GL_EXT_texture_lod_bias" ); gl_extensions_disable( ctx, "GL_INGR_blend_func_separate" ); - gl_extensions_disable( ctx, "GL_MESA_resize_buffers" ); - gl_extensions_disable( ctx, "GL_SGIX_pixel_texture" ); - gl_extensions_disable( ctx, "GL_SGI_color_matrix" ); - gl_extensions_disable( ctx, "GL_SGI_color_table" ); + gl_extensions_disable( ctx, "GL_MESA_resize_buffers" ); + gl_extensions_disable( ctx, "GL_SGIX_pixel_texture" ); + gl_extensions_disable( ctx, "GL_SGI_color_matrix" ); + gl_extensions_disable( ctx, "GL_SGI_color_table" ); /* We do support tex_env_add, however */ diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c index b12a6eb40..94b0c6b6f 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c @@ -1,35 +1,29 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.11 2001/03/21 16:14:21 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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 PRECISION INSIGHT AND/OR ITS 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. - -**************************************************************************/ - +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.12 2001/04/10 16:07:50 dawes Exp $ */ /* - * Authors: - * Keith Whitwell <keithw@precisioninsight.com> + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ #ifdef GLX_DIRECT_RENDERING @@ -61,18 +55,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mga_dri.h" - - - #ifndef MGA_DEBUG int MGA_DEBUG = (0 -/* | DEBUG_ALWAYS_SYNC */ - | DEBUG_VERBOSE_MSG -/* | DEBUG_VERBOSE_LRU */ - | DEBUG_VERBOSE_DRI - | DEBUG_VERBOSE_IOCTL -/* | DEBUG_VERBOSE_2D */ - ); +/* | DEBUG_ALWAYS_SYNC */ +/* | DEBUG_VERBOSE_MSG */ +/* | DEBUG_VERBOSE_LRU */ +/* | DEBUG_VERBOSE_DRI */ +/* | DEBUG_VERBOSE_IOCTL */ +/* | DEBUG_VERBOSE_2D */ +/* | DEBUG_VERBOSE_FALLBACK */ + ); #endif diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h index a785d83af..68c075555 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h +++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h @@ -1,36 +1,30 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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 PRECISION INSIGHT AND/OR ITS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.8 2001/04/01 13:59:59 tsi Exp $ */ - /* - * Authors: - * Keith Whitwell <keithw@precisioninsight.com> + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.9 2001/04/10 16:07:50 dawes Exp $ */ #ifndef _MGA_INIT_H_ #define _MGA_INIT_H_ diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c index 0e53b2f41..731afb75a 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c @@ -1,37 +1,30 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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 PRECISION INSIGHT AND/OR ITS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.6 2001/03/21 16:14:22 dawes Exp $ */ - /* - * Authors: - * Keith Whitwell <keithw@precisioninsight.com> + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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: * - * $PI: $ + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.7 2001/04/10 16:07:50 dawes Exp $ */ #include <stdio.h> #include "mgacontext.h" diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h index 2a72aba6f..28dba8735 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.h @@ -1,4 +1,30 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.h,v 1.3 2000/08/25 13:42:23 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.h,v 1.4 2001/04/10 16:07:50 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ #ifndef MGA_BUFFERS_H #define MGA_BUFFERS_H diff --git a/xc/lib/GL/mesa/src/drv/mga/mgacontext.h b/xc/lib/GL/mesa/src/drv/mga/mgacontext.h index 124da2f26..2462a54a7 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgacontext.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgacontext.h @@ -1,31 +1,31 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.3 2001/03/21 16:14:22 dawes Exp $*/ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.4 2001/04/10 16:07:50 dawes Exp $*/ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ - #ifndef MGALIB_INC #define MGALIB_INC @@ -277,12 +277,13 @@ struct mga_context_t { extern int MGA_DEBUG; #endif -#define DEBUG_ALWAYS_SYNC 0x1 -#define DEBUG_VERBOSE_MSG 0x2 -#define DEBUG_VERBOSE_LRU 0x4 -#define DEBUG_VERBOSE_DRI 0x8 -#define DEBUG_VERBOSE_IOCTL 0x10 -#define DEBUG_VERBOSE_2D 0x20 +#define DEBUG_ALWAYS_SYNC 0x1 +#define DEBUG_VERBOSE_MSG 0x2 +#define DEBUG_VERBOSE_LRU 0x4 +#define DEBUG_VERBOSE_DRI 0x8 +#define DEBUG_VERBOSE_IOCTL 0x10 +#define DEBUG_VERBOSE_2D 0x20 +#define DEBUG_VERBOSE_FALLBACK 0x40 static __inline__ GLuint mgaPackColor(GLuint cpp, GLubyte r, GLubyte g, diff --git a/xc/lib/GL/mesa/src/drv/mga/mgadd.c b/xc/lib/GL/mesa/src/drv/mga/mgadd.c index 8c4efa77d..706e14bc8 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgadd.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgadd.c @@ -1,30 +1,30 @@ /* - * GLX Hardware Device Driver for Matrox G200/G400 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.9 2001/04/01 13:59:59 tsi Exp $ */ - +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.10 2001/04/10 16:07:50 dawes Exp $ */ #include "types.h" @@ -51,7 +51,7 @@ #include "X86/common_x86_asm.h" #endif -#define MGA_DATE "20010316" +#define MGA_DATE "20010321" diff --git a/xc/lib/GL/mesa/src/drv/mga/mgadd.h b/xc/lib/GL/mesa/src/drv/mga/mgadd.h index 0bd4c712e..c6e27f8a6 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgadd.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgadd.h @@ -1,30 +1,31 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.h,v 1.2 2001/04/10 16:07:50 dawes Exp $ */ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ - #ifndef MGADD_INC #define MGADD_INC diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c b/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c index 50eb1a64e..254d0b168 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c @@ -1,27 +1,30 @@ /* - * GLX Hardware Device Driver for Matrox G400 - * Copyright (C) 1999 Keith Whitwell + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c,v 1.6 2001/03/21 16:14:22 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaeltpath.c,v 1.7 2001/04/10 16:07:50 dawes Exp $ */ #include <stdio.h> diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h b/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h index 2bc19ddcd..4016b12ca 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h @@ -1,30 +1,33 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h,v 1.4 2001/04/10 16:07:50 dawes Exp $ */ /* - * DRI Hardware Device Driver for G200/G400 - * Copyright (C) 1999 Keith Whitwell + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaelttmp.h,v 1.3 2000/08/28 02:43:12 tsi Exp $ */ /* Buffers fill from high addresses down with vertices and from low - * addresses up with elements. + * addresses up with elements. */ @@ -55,14 +58,14 @@ static void TAG(emit_unclipped_verts)( struct vertex_buffer *VB ) mmesa->retained_buf = mmesa->elt_buf; mmesa->first_vert_phys = mmesa->next_vert_phys; - for (i = 0 ; i < count ; f -= BUFFER_STRIDE, i++) + for (i = 0 ; i < count ; f -= BUFFER_STRIDE, i++) { - if (!clipmask[i]) + if (!clipmask[i]) { f[0] = sx * dev[0] + tx; f[1] = sy * dev[1] + ty; f[2] = sz * dev[2] + tz; - f[3] = dev[3]; + f[3] = dev[3]; if (TYPE & MGA_RGBA_BIT) { #if defined(USE_X86_ASM) @@ -107,12 +110,12 @@ static void TAG(emit_unclipped_verts)( struct vertex_buffer *VB ) /* Build three temporary clipspace vertex for clipping a triangle. * Recreate from the VB data rather than trying to read back from - * uncached memory. + * uncached memory. */ static void TAG(build_tri_verts)( mgaContextPtr mmesa, - struct vertex_buffer *VB, - GLfloat *O, - GLuint *elt ) + struct vertex_buffer *VB, + GLfloat *O, + GLuint *elt ) { int i; @@ -121,7 +124,7 @@ static void TAG(build_tri_verts)( mgaContextPtr mmesa, O[0] = clip[0]; O[1] = clip[1]; - O[2] = clip[2]; + O[2] = clip[2]; O[3] = clip[3]; if (TYPE & MGA_RGBA_BIT) { @@ -163,7 +166,7 @@ static void TAG(build_tri_verts)( mgaContextPtr mmesa, /* Interpolate between two of the vertices constructed above. */ -static void TAG(interp)( GLfloat t, +static void TAG(interp)( GLfloat t, GLfloat *O, const GLfloat *I, const GLfloat *J ) @@ -181,7 +184,7 @@ static void TAG(interp)( GLfloat t, } *(GLuint *)&O[5] = ~0; /* note that this is a new vertex */ - + if (TYPE & MGA_TEX0_BIT) { O[6] = LINTERP(t, I[6], J[6]); O[7] = LINTERP(t, I[7], J[7]); @@ -204,7 +207,7 @@ static void TAG(project_and_emit_verts)( mgaContextPtr mmesa, GLuint *elt, int nr) { - + GLfloat *O = mmesa->next_vert; GLuint phys = mmesa->next_vert_phys; @@ -212,27 +215,27 @@ static void TAG(project_and_emit_verts)( mgaContextPtr mmesa, const GLfloat sx = m[0], sy = m[5], sz = m[10]; const GLfloat tx = m[12], ty = m[13], tz = m[14]; GLuint i; - + for (i = 0 ; i < nr ; i++) { const GLfloat *I = &verts[elt[i] * CLIP_STRIDE]; GLuint tmp = *(GLuint *)&I[5]; - if ((elt[i] = tmp) == ~0) - { + if ((elt[i] = tmp) == ~0) + { GLfloat oow = 1.0/I[3]; elt[i] = phys; phys -= BUFFER_STRIDE * sizeof(GLuint); - + O[0] = sx * I[0] * oow + tx; O[1] = sy * I[1] * oow + ty; O[2] = sz * I[2] * oow + tz; - O[3] = oow; + O[3] = oow; if (TYPE & MGA_RGBA_BIT) { *(int*)&O[4] = *(int*)&I[4]; } - + if (TYPE & MGA_TEX0_BIT) { *(int*)&O[6] = *(int*)&I[6]; *(int*)&O[7] = *(int*)&I[7]; diff --git a/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c b/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c index a1e9b04ce..0eac06f68 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgafastpath.c @@ -1,27 +1,30 @@ /* - * GLX Hardware Device Driver for Intel i810 - * Copyright (C) 1999 Keith Whitwell + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgafastpath.c,v 1.7 2001/03/21 16:14:22 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgafastpath.c,v 1.8 2001/04/10 16:07:50 dawes Exp $ */ #include <stdio.h> @@ -489,7 +492,6 @@ void mgaDDFastPath( struct vertex_buffer *VB ) gl_prepare_arrays_cva( VB ); /* still need this */ -#if 1 if (gl_reduce_prim[prim] == GL_TRIANGLES && VB->Count < (MGA_BUFFER_SIZE / 48) && (ctx->ModelProjectMatrix.flags & (MAT_FLAG_GENERAL| @@ -499,7 +501,6 @@ void mgaDDFastPath( struct vertex_buffer *VB ) mgaDDEltPath( VB ); return; } -#endif /* Reserve enough space for the pathological case. */ diff --git a/xc/lib/GL/mesa/src/drv/mga/mgafasttmp.h b/xc/lib/GL/mesa/src/drv/mga/mgafasttmp.h index 683640409..b49105a8c 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgafasttmp.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgafasttmp.h @@ -1,29 +1,32 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgafasttmp.h,v 1.3 2001/04/10 16:07:50 dawes Exp $ */ /* - * DRI Hardware Device Driver for G200/G400 - * Copyright (C) 1999 Keith Whitwell + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * + * Authors: + * Keith Whitwell <keithw@valinux.com> */ - /* The first part of setup is applied to all vertices, clipped or * unclipped. This data will be used for clipping, and then all * vertices with a zero clipmask will be projected to device space. @@ -41,14 +44,14 @@ static void TAG(mga_setup_full)( struct vertex_buffer *VB, GLuint do_cliptest ) GLuint count = VB->Count; gl_xform_points3_v16_general(MGA_DRIVER_DATA(VB)->verts[start].f, - m, + m, VB->ObjPtr->start, VB->ObjPtr->stride, count - start); if (do_cliptest) { - VB->ClipAndMask = ~0; + VB->ClipAndMask = ~0; VB->ClipOrMask = 0; gl_cliptest_points4_v16(MGA_DRIVER_DATA(VB)->verts[start].f, MGA_DRIVER_DATA(VB)->verts[count].f, @@ -121,7 +124,7 @@ static void TAG(mga_setup_full)( struct vertex_buffer *VB, GLuint do_cliptest ) #else *(unsigned int *)(f+CLIP_S1) = *(unsigned int *)tex1_data; *(unsigned int *)(f+CLIP_T1) = *(unsigned int *)(tex1_data+1); -#endif +#endif } if(TYPE & MGA_RGBA_BIT)color += color_stride; if(TYPE & MGA_TEX0_BIT)STRIDE_F(tex0_data, tex0_stride); @@ -139,7 +142,7 @@ static void TAG(mga_setup_full)( struct vertex_buffer *VB, GLuint do_cliptest ) * routine into the header. Less code and better chance of doing some * of this stuff in assembly. */ -static void TAG(mga_interp_vert)( GLfloat t, +static void TAG(mga_interp_vert)( GLfloat t, GLfloat *O, const GLfloat *I, const GLfloat *J ) diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c index 719595449..b07e69271 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c @@ -1,4 +1,31 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.10 2001/03/21 16:14:22 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + * Gareth Hughes <gareth@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.11 2001/04/10 16:07:50 dawes Exp $ */ #include <stdio.h> @@ -273,6 +300,7 @@ void mgaSwapBuffers( mgaContextPtr mmesa ) MGA_READ( MGAREG_PRIMADDRESS ) - mmesa->primary_offset, mmesa->sarea->last_wrap ); } + UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH ); for ( i = 0 ; i < 1024 ; i++ ) { /* Don't just hammer the register... */ @@ -379,6 +407,8 @@ static void age_mmesa( mgaContextPtr mmesa, int age ) if (mmesa->CurrentTexObj[1]) mmesa->CurrentTexObj[1]->age = age; } +static int __break_vertex = 0; + void mgaFlushVerticesLocked( mgaContextPtr mmesa ) { XF86DRIClipRectPtr pbox = mmesa->pClipRects; @@ -465,6 +495,13 @@ void mgaFlushVerticesLocked( mgaContextPtr mmesa ) } } + /* Do we really need to do this ? */ +#ifdef __i386__ + if ( __break_vertex ) { + __asm__ __volatile__ ( "int $3" ); + } +#endif + mmesa->dirty &= ~MGA_UPLOAD_CLIPRECTS; } diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h index bb3f4f45f..ad2e6d1ed 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.7 2001/03/21 16:14:22 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + * Gareth Hughes <gareth@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.8 2001/04/10 16:07:50 dawes Exp $ */ #ifndef MGA_IOCTL_H #define MGA_IOCTL_H diff --git a/xc/lib/GL/mesa/src/drv/mga/mgapipeline.c b/xc/lib/GL/mesa/src/drv/mga/mgapipeline.c index 1f5288de5..cf2843df5 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgapipeline.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgapipeline.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapipeline.c,v 1.3 2000/09/26 15:56:47 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapipeline.c,v 1.4 2001/04/10 16:07:50 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ #include <stdio.h> #include "mgavb.h" @@ -13,7 +39,7 @@ static struct gl_pipeline_stage mga_fast_stage = { (PIPE_OP_VERT_XFORM|PIPE_OP_RAST_SETUP_0| PIPE_OP_RAST_SETUP_1|PIPE_OP_RENDER), PIPE_PRECALC, - 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, mgaDDFastPath }; @@ -27,17 +53,17 @@ static struct gl_pipeline_stage mga_fast_stage = { ENABLE_USERCLIP | \ ENABLE_LIGHT | \ ENABLE_FOG) - + /* The driver gets first shot at building the pipeline - make some * quick tests to see if we can use the fast path. */ GLboolean mgaDDBuildPrecalcPipeline( GLcontext *ctx ) -{ +{ struct gl_pipeline *pipe = &ctx->CVA.pre; mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - - if (mmesa->renderindex == 0 && + + if (mmesa->renderindex == 0 && (ctx->Enabled & ILLEGAL_ENABLES) == 0 && (ctx->Array.Flags & (VERT_OBJ_234| VERT_TEX0_4| @@ -50,9 +76,9 @@ GLboolean mgaDDBuildPrecalcPipeline( GLcontext *ctx ) pipe->ops = pipe->stages[0]->ops; mmesa->using_fast_path = 1; return 1; - } + } - if (mmesa->using_fast_path) + if (mmesa->using_fast_path) { mmesa->using_fast_path = 0; ctx->CVA.VB->ClipOrMask = 0; @@ -60,7 +86,7 @@ GLboolean mgaDDBuildPrecalcPipeline( GLcontext *ctx ) ctx->Array.NewArrayState |= ctx->Array.Summary; return 0; } - + return 0; } @@ -68,7 +94,7 @@ GLboolean mgaDDBuildPrecalcPipeline( GLcontext *ctx ) /* Still do the normal fixup and copy-to-current, so this isn't so - * bad. + * bad. */ #define ILLEGAL_INPUTS_IMM (VERT_OBJ_4| \ VERT_TEX0_4| \ @@ -134,5 +160,3 @@ GLuint mgaDDRegisterPipelineStages( struct gl_pipeline_stage *out, return o; } - - diff --git a/xc/lib/GL/mesa/src/drv/mga/mgapipeline.h b/xc/lib/GL/mesa/src/drv/mga/mgapipeline.h index dc0179227..ab961a895 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgapipeline.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgapipeline.h @@ -1,3 +1,31 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapipeline.h,v 1.3 2001/04/10 16:07:50 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ + #ifndef _MGA_PIPELINE_H #define _MGA_PIPELINE_H diff --git a/xc/lib/GL/mesa/src/drv/mga/mgapixel.c b/xc/lib/GL/mesa/src/drv/mga/mgapixel.c index d4732831c..231d7b9e7 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgapixel.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgapixel.c @@ -1,29 +1,31 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.2 2001/03/21 16:14:22 dawes Exp $ */ -/************************************************************************** - -Copyright 2000 Compaq Computer Inc. and VA Linux, 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 -on 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 -ATI, PRECISION INSIGHT 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. - -**************************************************************************/ +/* + * Copyright 2000 Compaq Computer Inc. and VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + * Gareth Hughes <gareth@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.3 2001/04/10 16:07:51 dawes Exp $ */ #include "enums.h" #include "types.h" @@ -35,14 +37,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mgabuffers.h" #include "drm.h" -#include <sys/ioctl.h> -#define IS_AGP_MEM(mmesa, p) \ - (mmesa->mgaScreen->agp.map <= ((char *)p) && \ - mmesa->mgaScreen->agp.map + \ - mmesa->mgaScreen->agp.size > ((char *)p)) -#define AGP_OFFSET(mmesa, p) \ - (((char *)p) - mmesa->mgaScreen->agp.map ) +#define IS_AGP_MEM( mmesa, p ) \ + ((GLuint)mmesa->mgaScreen->buffers.map <= ((GLuint)p) && \ + (GLuint)mmesa->mgaScreen->buffers.map + \ + (GLuint)mmesa->mgaScreen->buffers.size > ((GLuint)p)) + +#define AGP_OFFSET( mmesa, p ) \ + (((GLuint)p) - (GLuint)mmesa->mgaScreen->buffers.map ) #if defined(MESA_packed_depth_stencil) @@ -54,20 +56,19 @@ check_depth_stencil_24_8( const GLcontext *ctx, GLenum type, { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - return (type == GL_UNSIGNED_INT_24_8_MESA && - ctx->Visual->DepthBits == 24 && - ctx->Visual->StencilBits == 8 && - mmesa->mgaScreen->cpp == 4 && - mmesa->hw_stencil && - !ctx->Pixel.IndexShift && - !ctx->Pixel.IndexOffset && - !ctx->Pixel.MapStencilFlag && - ctx->Pixel.DepthBias == 0.0 && - ctx->Pixel.DepthScale == 1.0 && - !packing->SwapBytes && - pitch % 32 == 0 && - pitch < 4096); - + return ( type == GL_UNSIGNED_INT_24_8_MESA && + ctx->Visual->DepthBits == 24 && + ctx->Visual->StencilBits == 8 && + mmesa->mgaScreen->cpp == 4 && + mmesa->hw_stencil && + !ctx->Pixel.IndexShift && + !ctx->Pixel.IndexOffset && + !ctx->Pixel.MapStencilFlag && + ctx->Pixel.DepthBias == 0.0 && + ctx->Pixel.DepthScale == 1.0 && + !packing->SwapBytes && + pitch % 32 == 0 && + pitch < 4096 ); } #endif @@ -79,69 +80,70 @@ check_depth( const GLcontext *ctx, GLenum type, { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - if (IS_AGP_MEM(mmesa, pixels) && - !((type == GL_UNSIGNED_INT && mmesa->mgaScreen->cpp == 4) || - (type == GL_UNSIGNED_SHORT && mmesa->mgaScreen->cpp == 2))) + if ( IS_AGP_MEM( mmesa, pixels ) && + !( ( type == GL_UNSIGNED_INT && mmesa->mgaScreen->cpp == 4 ) || + ( type == GL_UNSIGNED_SHORT && mmesa->mgaScreen->cpp == 2 ) ) ) return GL_FALSE; - return (ctx->Pixel.DepthBias == 0.0 && - ctx->Pixel.DepthScale == 1.0 && - !packing->SwapBytes && - pitch % 32 == 0 && - pitch < 4096); + return ( ctx->Pixel.DepthBias == 0.0 && + ctx->Pixel.DepthScale == 1.0 && + !packing->SwapBytes && + pitch % 32 == 0 && + pitch < 4096 ); } static GLboolean check_color( const GLcontext *ctx, GLenum type, GLenum format, - const struct gl_pixelstore_attrib *packing, - const void *pixels, GLint sz, GLint pitch ) + const struct gl_pixelstore_attrib *packing, + const void *pixels, GLint sz, GLint pitch ) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); GLuint cpp = mmesa->mgaScreen->cpp; /* Can't do conversions on agp reads/draws. */ - if (IS_AGP_MEM(mmesa, pixels) && - !(pitch % 32 == 0 && - pitch < 4096 && - ((type == GL_UNSIGNED_BYTE && cpp == 4 && format == GL_BGRA) || - (type == GL_UNSIGNED_INT_8_8_8_8 && cpp == 4 && format == GL_BGRA) || - (type == GL_UNSIGNED_SHORT_5_6_5_REV && cpp==2 && format == GL_RGB)))) + if ( IS_AGP_MEM( mmesa, pixels ) && + !( pitch % 32 == 0 && pitch < 4096 && + ( ( type == GL_UNSIGNED_BYTE && + cpp == 4 && format == GL_BGRA ) || + ( type == GL_UNSIGNED_INT_8_8_8_8 && + cpp == 4 && format == GL_BGRA ) || + ( type == GL_UNSIGNED_SHORT_5_6_5_REV && + cpp == 2 && format == GL_RGB ) ) ) ) return GL_FALSE; - return - (ctx->ColorMatrix.type == MATRIX_IDENTITY && - !ctx->Pixel.ScaleOrBiasRGBA && - !ctx->Pixel.ScaleOrBiasRGBApcm && - !ctx->Pixel.MapColorFlag && - !ctx->Pixel.ColorTableEnabled && - !ctx->Pixel.PostColorMatrixColorTableEnabled && - !ctx->Pixel.MinMaxEnabled && - !ctx->Pixel.HistogramEnabled && - !packing->SwapBytes && - !packing->LsbFirst); + return ( ctx->ColorMatrix.type == MATRIX_IDENTITY && + !ctx->Pixel.ScaleOrBiasRGBA && + !ctx->Pixel.ScaleOrBiasRGBApcm && + !ctx->Pixel.MapColorFlag && + !ctx->Pixel.ColorTableEnabled && + !ctx->Pixel.PostColorMatrixColorTableEnabled && + !ctx->Pixel.MinMaxEnabled && + !ctx->Pixel.HistogramEnabled && + !packing->SwapBytes && + !packing->LsbFirst ); } static GLboolean check_color_per_fragment_ops( const GLcontext *ctx ) { - return (!(ctx->RasterMask & ~(SCISSOR_BIT|WINCLIP_BIT|MULTI_DRAW_BIT)) && - ctx->Current.RasterPosValid && - ctx->Pixel.ZoomX == 1.0F && - (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)); + return ( !(ctx->RasterMask & ~(SCISSOR_BIT|WINCLIP_BIT|MULTI_DRAW_BIT)) && + ctx->Current.RasterPosValid && + ctx->Pixel.ZoomX == 1.0F && + ( ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F ) ); } static GLboolean check_depth_per_fragment_ops( const GLcontext *ctx ) { - return (ctx->Current.RasterPosValid && - ctx->Color.ColorMask[RCOMP] == 0 && - ctx->Color.ColorMask[BCOMP] == 0 && - ctx->Color.ColorMask[GCOMP] == 0 && - ctx->Color.ColorMask[ACOMP] == 0 && - ctx->Pixel.ZoomX == 1.0F && - (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)); + return ( ctx->Current.RasterPosValid && + ctx->Color.ColorMask[RCOMP] == 0 && + ctx->Color.ColorMask[BCOMP] == 0 && + ctx->Color.ColorMask[GCOMP] == 0 && + ctx->Color.ColorMask[ACOMP] == 0 && + ctx->Pixel.ZoomX == 1.0F && + ( ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F ) ); } /* In addition to the requirements for depth: @@ -150,8 +152,8 @@ check_depth_per_fragment_ops( const GLcontext *ctx ) static GLboolean check_stencil_per_fragment_ops( const GLcontext *ctx ) { - return (!ctx->Pixel.IndexShift && - !ctx->Pixel.IndexOffset); + return ( !ctx->Pixel.IndexShift && + !ctx->Pixel.IndexOffset ); } #endif diff --git a/xc/lib/GL/mesa/src/drv/mga/mgapixel.h b/xc/lib/GL/mesa/src/drv/mga/mgapixel.h index 4766c1409..c7bb04d92 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgapixel.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgapixel.h @@ -1,29 +1,30 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.h,v 1.2 2001/03/21 16:14:22 dawes Exp $ */ -/************************************************************************** - -Copyright 2000 Compaq Computer Inc. and VA Linux, 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 -on 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 -ATI, PRECISION INSIGHT 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. - -**************************************************************************/ +/* + * Copyright 2000-2001 Compaq Computer Inc. VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.h,v 1.3 2001/04/10 16:07:51 dawes Exp $ */ #ifndef MGA_PIXELS_H #define MGA_PIXELS_H @@ -33,4 +34,3 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. extern void mgaDDInitPixelFuncs( GLcontext *ctx ); #endif - diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c index 0f53c6fda..2fb01b757 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.7 2001/03/21 16:14:22 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.8 2001/04/10 16:07:51 dawes Exp $ */ #include "types.h" #include "mgadd.h" diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaspan.h b/xc/lib/GL/mesa/src/drv/mga/mgaspan.h index 5db0fb976..16bbf2f67 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgaspan.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgaspan.h @@ -1,3 +1,31 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.h,v 1.2 2001/04/10 16:07:51 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ + #ifndef _MGA_SPAN_H #define _MGA_SPAN_H diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c index 6d2adb5ea..203a92f27 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.8 2001/03/21 16:14:22 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.9 2001/04/10 16:07:51 dawes Exp $ */ #include <stdio.h> diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.h b/xc/lib/GL/mesa/src/drv/mga/mgastate.h index ac92cb0c2..50ba3c363 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgastate.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.h @@ -1,3 +1,31 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.h,v 1.3 2001/04/10 16:07:51 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ + #ifndef _MGA_STATE_H #define _MGA_STATE_H diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.c b/xc/lib/GL/mesa/src/drv/mga/mgatex.c index e057dc50c..d99313c81 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatex.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.c @@ -1,31 +1,30 @@ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * original by Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> - * 9/20/99 rewrite by John Carmack <johnc@idsoftware.com> - * 13/1/00 port to DRI by Keith Whitwell <keithw@precisioninsight.com> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.9 2001/03/21 16:14:22 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.10 2001/04/10 16:07:51 dawes Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -539,6 +538,9 @@ static void mgaUpdateTextureEnvG400( GLcontext *ctx, int unit ) #else /* s/w fallback, pretty sure we can't do in h/w */ mmesa->Fallback |= MGA_FALLBACK_TEXTURE; + if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) + fprintf( stderr, "FALLBACK: GL_DECAL RGBA texture, unit=%d\n", + unit ); #endif } else { @@ -613,6 +615,9 @@ static void mgaUpdateTextureEnvG400( GLcontext *ctx, int unit ) } else { mmesa->Fallback |= MGA_FALLBACK_TEXTURE; + if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) + fprintf( stderr, "FALLBACK: GL_BLEND envcolor=0x%08x\n", + mmesa->envcolor ); /* Do singletexture GL_BLEND with 'all ones' env-color * by using both texture units. Multitexture gl_blend @@ -659,18 +664,25 @@ static void mgaUpdateTextureObject( GLcontext *ctx, int unit ) tObj = ctx->Texture.Unit[source].Current; if (enabled != TEXTURE0_2D) { - if (enabled) + if (enabled) { mmesa->Fallback |= MGA_FALLBACK_TEXTURE; + if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) + fprintf( stderr, "FALLBACK: tex enable != 2D\n" ); + } return; } if ( !tObj || tObj != ctx->Texture.Unit[source].CurrentD[2] ) { mmesa->Fallback |= MGA_FALLBACK_TEXTURE; + if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) + fprintf( stderr, "FALLBACK: tObj != 2D texture\n" ); return; } if (tObj->Image[tObj->BaseLevel]->Border > 0) { mmesa->Fallback |= MGA_FALLBACK_TEXTURE; + if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) + fprintf( stderr, "FALLBACK: texture border\n" ); return; } @@ -681,6 +693,8 @@ static void mgaUpdateTextureObject( GLcontext *ctx, int unit ) mgaCreateTexObj( mmesa, tObj ); if ( !tObj->DriverData ) { mmesa->Fallback |= MGA_FALLBACK_TEXTURE; + if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) + fprintf( stderr, "FALLBACK: could not create texture object\n" ); return; } } diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.h b/xc/lib/GL/mesa/src/drv/mga/mgatex.h index bd977f1e8..7180ef77d 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatex.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.h @@ -1,30 +1,30 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.6 2001/04/10 16:07:51 dawes Exp $ */ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * John Carmack <johnc@idsoftware.com> - * Keith Whitwell <keithw@precisioninsight.com> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.5 2001/01/08 01:07:19 martin Exp $ */ #ifndef MGATEX_INC #define MGATEX_INC @@ -47,7 +47,7 @@ void mgaConvertTexture( GLuint *dest, int texelBytes, void mgaUploadSubImageLocked( mgaContextPtr mmesa, mgaTextureObjectPtr t, - int level, + int level, int x, int y, int width, int height ); int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t ); diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c b/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c index 4e5bf8607..aa26d181e 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c @@ -1,32 +1,31 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c,v 1.1 2000/09/24 13:51:08 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c,v 1.2 2001/04/10 16:07:51 dawes Exp $ */ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * original by Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> - * 9/20/99 rewrite by John Carmack <johnc@idsoftware.com> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ - #include <stdlib.h> #include <stdio.h> @@ -44,18 +43,18 @@ * for an 8x8 texture. This happens when we have to crutch the pitch * limits of the mga by uploading a block of texels as a single line. */ -void mgaConvertTexture( GLuint *destPtr, int texelBytes, +void mgaConvertTexture( GLuint *destPtr, int texelBytes, struct gl_texture_image *image, - int x, int y, int width, int height ) + int x, int y, int width, int height ) { register int i, j; GLubyte *src; int stride; - + if (0) fprintf(stderr, "texture image %p\n", image->Data); - - if (image->Data == 0) + + if (image->Data == 0) return; /* FIXME: g400 luminance_alpha internal format */ @@ -70,7 +69,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width); for ( i = height ; i ; i-- ) { for ( j = width >> 2 ; j ; j-- ) { - + *destPtr++ = src[0] | ( src[1] << 8 ) | ( src[2] << 16 ) | ( src[3] << 24 ); src += 4; } @@ -88,8 +87,8 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width) * 3; for ( i = height ; i ; i-- ) { for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR565(src[0],src[1],src[2]) | + + *destPtr++ = MGAPACKCOLOR565(src[0],src[1],src[2]) | ( MGAPACKCOLOR565(src[3],src[4],src[5]) << 16 ); src += 6; } @@ -101,8 +100,8 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width) * 4; for ( i = height ; i ; i-- ) { for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(src[0],src[1],src[2],src[3]) | + + *destPtr++ = MGAPACKCOLOR4444(src[0],src[1],src[2],src[3]) | ( MGAPACKCOLOR4444(src[4],src[5],src[6],src[7]) << 16 ); src += 8; } @@ -115,7 +114,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, for ( i = height ; i ; i-- ) { for ( j = width >> 1 ; j ; j-- ) { /* FIXME: should probably use 555 texture to get true grey */ - *destPtr++ = MGAPACKCOLOR565(src[0],src[0],src[0]) | + *destPtr++ = MGAPACKCOLOR565(src[0],src[0],src[0]) | ( MGAPACKCOLOR565(src[1],src[1],src[1]) << 16 ); src += 2; } @@ -127,8 +126,8 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width); for ( i = height ; i ; i-- ) { for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(src[0],src[0],src[0],src[0]) | + + *destPtr++ = MGAPACKCOLOR4444(src[0],src[0],src[0],src[0]) | ( MGAPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16 ); src += 2; } @@ -140,8 +139,8 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width); for ( i = height ; i ; i-- ) { for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(255,255,255,src[0]) | + + *destPtr++ = MGAPACKCOLOR4444(255,255,255,src[0]) | ( MGAPACKCOLOR4444(255,255,255,src[1]) << 16 ); src += 2; } @@ -153,8 +152,8 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width) * 2; for ( i = height ; i ; i-- ) { for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(src[0],src[0],src[0],src[1]) | + + *destPtr++ = MGAPACKCOLOR4444(src[0],src[0],src[0],src[1]) | ( MGAPACKCOLOR4444(src[2],src[2],src[2],src[3]) << 16 ); src += 4; } @@ -172,7 +171,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width) * 3; for ( i = height ; i ; i-- ) { for ( j = width ; j ; j-- ) { - + *destPtr++ = MGAPACKCOLOR8888(src[0],src[1],src[2], 255); src += 3; } @@ -184,7 +183,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width) * 4; for ( i = height ; i ; i-- ) { for ( j = width ; j ; j-- ) { - + *destPtr++ = MGAPACKCOLOR8888(src[0],src[1],src[2],src[3]); src += 4; } @@ -196,7 +195,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width); for ( i = height ; i ; i-- ) { for ( j = width ; j ; j-- ) { - + *destPtr++ = MGAPACKCOLOR8888(src[0],src[0],src[0], 255); src += 1; } @@ -208,7 +207,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width); for ( i = height ; i ; i-- ) { for ( j = width ; j ; j-- ) { - + *destPtr++ = MGAPACKCOLOR8888(src[0],src[0],src[0],src[0]); src += 1; } @@ -220,7 +219,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width); for ( i = height ; i ; i-- ) { for ( j = width ; j ; j-- ) { - + *destPtr++ = MGAPACKCOLOR8888(255,255,255,src[0]); src += 1; } @@ -232,7 +231,7 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, stride = (image->Width - width) * 2; for ( i = height ; i ; i-- ) { for ( j = width ; j ; j-- ) { - + *destPtr++ = MGAPACKCOLOR8888(src[0],src[0], src[0],src[1]); src += 2; @@ -252,6 +251,6 @@ void mgaConvertTexture( GLuint *destPtr, int texelBytes, format_error: - fprintf(stderr, "Unsupported texelBytes %i, image->Format %i\n", + fprintf(stderr, "Unsupported texelBytes %i, image->Format %i\n", (int)texelBytes, (int)image->Format ); } diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c index 04f1cb10d..b421e284d 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.3 2001/03/21 16:14:22 dawes Exp $ */ +/* + * Copyright 2000-2001 VA Linux Systems, 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 + * on 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 + * VA LINUX SYSTEMS AND/OR ITS 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. + * + * Authors: + * Keith Whitwell <keithw@valinux.com> + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.4 2001/04/10 16:07:51 dawes Exp $ */ #include <stdlib.h> #include <stdio.h> diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.c b/xc/lib/GL/mesa/src/drv/mga/mgatris.c index cd10daddd..cd9da5a0e 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatris.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.c @@ -1,29 +1,30 @@ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.7 2001/03/21 16:14:22 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.8 2001/04/10 16:07:51 dawes Exp $ */ #include <stdio.h> #include <math.h> @@ -53,9 +54,9 @@ -static triangle_func tri_tab[0x10]; -static quad_func quad_tab[0x10]; -static line_func line_tab[0x10]; +static triangle_func tri_tab[0x10]; +static quad_func quad_tab[0x10]; +static line_func line_tab[0x10]; static points_func points_tab[0x10]; #define IND (0) @@ -132,9 +133,9 @@ void mgaDDChooseRenderState(GLcontext *ctx) if (flags & ANY_RASTER_FLAGS) { if (flags & DD_FLATSHADE) index |= MGA_FLAT_BIT; if (flags & DD_TRI_LIGHT_TWOSIDE) index |= MGA_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= MGA_OFFSET_BIT; + if (flags & DD_TRI_OFFSET) index |= MGA_OFFSET_BIT; } - + mmesa->PointsFunc = points_tab[index]; mmesa->LineFunc = line_tab[index]; mmesa->TriangleFunc = tri_tab[index]; @@ -149,7 +150,7 @@ void mgaDDChooseRenderState(GLcontext *ctx) mmesa->PointsFunc = 0; mmesa->IndirectTriangles |= DD_POINT_SW_RASTERIZE; } - + if (flags & LINE_FALLBACK) { mmesa->renderindex |= MGA_FALLBACK_BIT; mmesa->LineFunc = 0; diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatris.h b/xc/lib/GL/mesa/src/drv/mga/mgatris.h index 1015c6fdd..5a16490e6 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatris.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgatris.h @@ -1,32 +1,33 @@ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.7 2001/03/21 16:14:22 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.8 2001/04/10 16:07:51 dawes Exp $ */ -#ifndef MGATIS_INC -#define MGATIS_INC +#ifndef MGATRIS_INC +#define MGATRIS_INC #include "types.h" #include "mgaioctl.h" @@ -36,13 +37,13 @@ extern void mgaDDTrifuncInit( void ); #define MGA_FLAT_BIT 0x1 -#define MGA_OFFSET_BIT 0x2 -#define MGA_TWOSIDE_BIT 0x4 +#define MGA_OFFSET_BIT 0x2 +#define MGA_TWOSIDE_BIT 0x4 #define MGA_FALLBACK_BIT 0x8 static __inline void mga_draw_triangle( mgaContextPtr mmesa, - mgaVertex *v0, - mgaVertex *v1, + mgaVertex *v0, + mgaVertex *v1, mgaVertex *v2 ) { GLuint vertsize = mmesa->vertsize; @@ -69,15 +70,15 @@ static __inline void mga_draw_triangle( mgaContextPtr mmesa, : "memory" ); #else { - for (j = 0 ; j < vertsize ; j++) + for (j = 0 ; j < vertsize ; j++) wv[j] = v0->ui[j]; wv += vertsize; - for (j = 0 ; j < vertsize ; j++) + for (j = 0 ; j < vertsize ; j++) wv[j] = v1->ui[j]; wv += vertsize; - for (j = 0 ; j < vertsize ; j++) + for (j = 0 ; j < vertsize ; j++) wv[j] = v2->ui[j]; } #endif @@ -95,43 +96,43 @@ static __inline void mga_draw_point( mgaContextPtr mmesa, *(float *)&wv[0] = x - sz; *(float *)&wv[1] = y - sz; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp->ui[j]; wv += vertsize; *(float *)&wv[0] = x + sz; *(float *)&wv[1] = y - sz; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp->ui[j]; wv += vertsize; *(float *)&wv[0] = x + sz; *(float *)&wv[1] = y + sz; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp->ui[j]; wv += vertsize; *(float *)&wv[0] = x + sz; *(float *)&wv[1] = y + sz; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp->ui[j]; wv += vertsize; *(float *)&wv[0] = x - sz; *(float *)&wv[1] = y + sz; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp->ui[j]; wv += vertsize; *(float *)&wv[0] = x - sz; *(float *)&wv[1] = y - sz; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp->ui[j]; } static __inline void mga_draw_line( mgaContextPtr mmesa, - const mgaVertex *tmp0, + const mgaVertex *tmp0, const mgaVertex *tmp1, float width ) { @@ -178,37 +179,37 @@ static __inline void mga_draw_line( mgaContextPtr mmesa, *(float *)&wv[0] = x0 - ix; *(float *)&wv[1] = y0 - iy; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp0->ui[j]; wv += vertsize; *(float *)&wv[0] = x1 + ix; *(float *)&wv[1] = y1 + iy; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp1->ui[j]; wv += vertsize; *(float *)&wv[0] = x0 + ix; *(float *)&wv[1] = y0 + iy; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp0->ui[j]; wv += vertsize; - + *(float *)&wv[0] = x0 - ix; *(float *)&wv[1] = y0 - iy; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp0->ui[j]; wv += vertsize; *(float *)&wv[0] = x1 - ix; *(float *)&wv[1] = y1 - iy; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp1->ui[j]; wv += vertsize; *(float *)&wv[0] = x1 + ix; *(float *)&wv[1] = y1 + iy; - for (j = 2 ; j < vertsize ; j++) + for (j = 2 ; j < vertsize ; j++) wv[j] = tmp1->ui[j]; wv += vertsize; } diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.c b/xc/lib/GL/mesa/src/drv/mga/mgavb.c index d8f597fcf..90020f178 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgavb.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.c @@ -1,30 +1,31 @@ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.9 2001/03/21 16:14:22 dawes Exp $ */ - +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.10 2001/04/10 16:07:51 dawes Exp $ */ + #include "mgacontext.h" #include "mgavb.h" #include "mga_xmesa.h" @@ -67,7 +68,7 @@ /* The v code we have doesn't seem to support projective texturing * in the multitexture case. (Would require another 1/w value for the - * second set of texcoords). This may be a problem for the g400. + * second set of texcoords). This may be a problem for the g400. */ #define TEX0_4 \ if (VB->TexCoordPtr[0]->size == 4) { \ @@ -88,7 +89,7 @@ v->v.rhw = win[3]; \ v->v.z = depth_scale * win[2]; \ v->v.x = win[0] + xoffset; \ - v->v.y = - win[1] + yoffset; + v->v.y = - win[1] + yoffset; #define NOP @@ -195,7 +196,7 @@ void mgaDDSetupInit( void ) for (i = 0 ; i < 0x80 ; i++) setup_func[i] = rs_invalid; - + /* Functions to build vert's from scratch */ setup_func[MGA_WIN_BIT|MGA_TEX0_BIT] = rs_wt0; setup_func[MGA_WIN_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT] = rs_wt0t1; @@ -241,7 +242,7 @@ void mgaPrintSetupFlags(char *msg, GLuint flags ) fprintf(stderr, "%s: %d %s%s%s%s%s%s%s\n", msg, (int)flags, - (flags & MGA_WIN_BIT) ? " xyzw," : "", + (flags & MGA_WIN_BIT) ? " xyzw," : "", (flags & MGA_RGBA_BIT) ? " rgba," : "", (flags & MGA_SPEC_BIT) ? " spec," : "", (flags & MGA_FOG_BIT) ? " fog," : "", @@ -273,44 +274,44 @@ void mgaChooseRasterSetupFunc(GLcontext *ctx) funcindex &= ~MGA_RGBA_BIT; */ if (ctx->Texture.Unit[0].EnvMode == GL_BLEND && - mmesa->envcolor) + mmesa->envcolor) { mmesa->multitex = 1; mmesa->vertsize = 10; mmesa->tmu_source[1] = 0; funcindex |= MGA_TEX1_BIT; - } + } funcindex |= MGA_TEX0_BIT; } - if (ctx->Texture.ReallyEnabled & 0xf0) { + if (ctx->Texture.ReallyEnabled & 0xf0) { if (ctx->Texture.ReallyEnabled & 0xf) { mmesa->multitex = 1; mmesa->vertsize = 10; mmesa->blend_flags |= MGA_BLEND_MULTITEX; - funcindex |= MGA_TEX1_BIT; + funcindex |= MGA_TEX1_BIT; } else { - /* Just a funny way of doing single texturing + /* Just a funny way of doing single texturing */ mmesa->tmu_source[0] = 1; mmesa->tex_dest[1] = MGA_TEX0_BIT; if (ctx->Texture.Unit[0].EnvMode == GL_BLEND && - mmesa->envcolor) + mmesa->envcolor) { mmesa->multitex = 1; mmesa->vertsize = 10; mmesa->tmu_source[1] = 1; funcindex |= MGA_TEX1_BIT; - } + } funcindex |= MGA_TEX0_BIT; } } if (multi != mmesa->multitex) - mmesa->new_state |= MGA_NEW_WARP; + mmesa->new_state |= MGA_NEW_WARP; /* Not really a good place to do this - need to make the mga state @@ -328,7 +329,7 @@ void mgaChooseRasterSetupFunc(GLcontext *ctx) funcindex |= MGA_FOG_BIT; if (0) - mgaPrintSetupFlags("xsmesa: full setup function", funcindex); + mgaPrintSetupFlags("xsmesa: full setup function", funcindex); mmesa->dirty |= MGA_UPLOAD_PIPE; mmesa->setupindex = funcindex; @@ -352,7 +353,7 @@ void mgaDDCheckPartialRasterSetup( GLcontext *ctx, struct gl_pipeline_stage *d ) if ((ctx->Array.Summary & VERT_OBJ_ANY) == 0) return; - if (ctx->IndirectTriangles) + if (ctx->IndirectTriangles) return; mmesa->setupdone = tmp; @@ -381,7 +382,7 @@ void mgaDDPartialRasterSetup( struct vertex_buffer *VB ) if (new & VERT_RGBA) ind |= MGA_RGBA_BIT | MGA_SPEC_BIT; - if (new & VERT_TEX0_ANY) + if (new & VERT_TEX0_ANY) ind |= MGA_TEX0_BIT; if (new & VERT_TEX1_ANY) @@ -397,8 +398,8 @@ void mgaDDPartialRasterSetup( struct vertex_buffer *VB ) if (0) mgaPrintSetupFlags("xsmesa: partial setup function", ind); - if (ind) - setup_func[ind&~MGA_ALPHA_BIT]( VB, VB->Start, VB->Count ); + if (ind) + setup_func[ind&~MGA_ALPHA_BIT]( VB, VB->Start, VB->Count ); } @@ -411,7 +412,7 @@ void mgaDDDoRasterSetup( struct vertex_buffer *VB ) */ /* REFRESH_DRAWABLE_INFO( mmesa ); */ - if (VB->Type == VB_CVA_PRECALC) + if (VB->Type == VB_CVA_PRECALC) mgaDDPartialRasterSetup( VB ); else if (ctx->Driver.RasterSetup) ctx->Driver.RasterSetup( VB, VB->CopyStart, VB->Count ); @@ -433,19 +434,19 @@ void mgaDDResizeVB( struct vertex_buffer *VB, GLuint size ) FREE( mvb->vert_store ); mvb->vert_store = MALLOC( sizeof(mgaVertex) * mvb->size + 31); - if (!mvb->vert_store) + if (!mvb->vert_store) FatalError("mga-glx: out of memory !\n"); mvb->verts = (mgaVertexPtr)(((unsigned long)mvb->vert_store + 31) & ~31); gl_vector1ui_free( &mvb->clipped_elements ); - gl_vector1ui_alloc( &mvb->clipped_elements, VEC_WRITABLE, mvb->size, 32 ); - if (!mvb->clipped_elements.start) + gl_vector1ui_alloc( &mvb->clipped_elements, VEC_WRITABLE, mvb->size, 32 ); + if (!mvb->clipped_elements.start) FatalError("mga-glx: out of memory !\n"); ALIGN_FREE( VB->ClipMask ); VB->ClipMask = (GLubyte *)ALIGN_MALLOC(sizeof(GLubyte) * mvb->size, 32); - if (!VB->ClipMask) + if (!VB->ClipMask) FatalError("mga-glx: out of memory !\n"); if (VB->Type == VB_IMMEDIATE) { @@ -471,25 +472,25 @@ void mgaDDRegisterVB( struct vertex_buffer *VB ) */ mvb->size = VB->Size * 5; mvb->vert_store = MALLOC( sizeof(mgaVertex) * mvb->size + 31); - if (!mvb->vert_store) + if (!mvb->vert_store) FatalError("mga-glx: out of memory !\n"); - + mvb->verts = (mgaVertexPtr)(((unsigned long)mvb->vert_store + 31) & ~31); gl_vector1ui_alloc( &mvb->clipped_elements, VEC_WRITABLE, mvb->size, 32 ); - if (!mvb->clipped_elements.start) + if (!mvb->clipped_elements.start) FatalError("mga-glx: out of memory !\n"); ALIGN_FREE( VB->ClipMask ); VB->ClipMask = (GLubyte *)ALIGN_MALLOC(sizeof(GLubyte) * mvb->size, 32); - if (!VB->ClipMask) + if (!VB->ClipMask) FatalError("mga-glx: out of memory !\n"); mvb->primitive = (GLuint *)MALLOC( sizeof(GLuint) * mvb->size ); mvb->next_primitive = (GLuint *)MALLOC( sizeof(GLuint) * mvb->size ); if (!mvb->primitive || !mvb->next_primitive) FatalError("mga-glx: out of memory!"); - + VB->driver_data = mvb; } @@ -497,7 +498,7 @@ void mgaDDRegisterVB( struct vertex_buffer *VB ) void mgaDDUnregisterVB( struct vertex_buffer *VB ) { mgaVertexBufferPtr mvb = MGA_DRIVER_DATA(VB); - + if (mvb) { if (mvb->vert_store) FREE(mvb->vert_store); if (mvb->primitive) FREE(mvb->primitive); @@ -505,7 +506,5 @@ void mgaDDUnregisterVB( struct vertex_buffer *VB ) gl_vector1ui_free( &mvb->clipped_elements ); FREE(mvb); VB->driver_data = 0; - } + } } - - diff --git a/xc/lib/GL/mesa/src/drv/mga/mgavb.h b/xc/lib/GL/mesa/src/drv/mga/mgavb.h index c51fd0744..399d946ec 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgavb.h +++ b/xc/lib/GL/mesa/src/drv/mga/mgavb.h @@ -1,29 +1,30 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.h,v 1.6 2001/04/10 16:07:51 dawes Exp $ */ /* - * GLX Hardware Device Driver for Matrox Millenium G200 - * Copyright (C) 1999 Wittawat Yamwong + * Copyright 2000-2001 VA Linux Systems, 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: + * on 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 shall be included - * in all copies or substantial portions of the Software. + * 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 NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. + * 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 + * VA LINUX SYSTEMS AND/OR ITS 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. * - * - * Wittawat Yamwong <Wittawat.Yamwong@stud.uni-hannover.de> + * Authors: + * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.h,v 1.5 2000/09/24 13:51:09 alanh Exp $ */ #ifndef MGAVB_INC #define MGAVB_INC @@ -34,7 +35,7 @@ /* common datatypes for the mga warp engines */ -/* +/* * color type for the vertex data * we probably want to use an internal datatype here? */ @@ -64,7 +65,7 @@ typedef struct mga_warp_vertex_t { /* The fastpath code still expects a 16-float stride vertex. */ union mga_vertex_t { - mga_warp_vertex v; + mga_warp_vertex v; float f[16]; GLuint ui[16]; }; @@ -85,7 +86,7 @@ struct mga_vertex_buffer_t { GLuint *elt_buf; GLuint vert_phys_start; }; - + typedef struct mga_vertex_buffer_t *mgaVertexBufferPtr; #define MGA_CONTEXT(ctx) ((mgaContextPtr)((ctx)->DriverCtx)) @@ -106,7 +107,7 @@ extern void mgaChooseRasterSetupFunc(GLcontext *ctx); extern void mgaPrintSetupFlags(char *msg, GLuint flags ); extern void mgaDDDoRasterSetup( struct vertex_buffer *VB ); extern void mgaDDPartialRasterSetup( struct vertex_buffer *VB ); -extern void mgaDDCheckPartialRasterSetup( GLcontext *ctx, +extern void mgaDDCheckPartialRasterSetup( GLcontext *ctx, struct gl_pipeline_stage *d ); diff --git a/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc b/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc index 826a27e44..ebf4fc39f 100644 --- a/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc,v 1.1 2001/03/23 19:18:41 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc,v 1.2 2001/04/10 17:53:07 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines -DDRIVERTS -DX_BYTE_ORDER=ByteOrder DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ -I$(GLXLIBSRC)/mesa/dri \ diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.h b/xc/lib/GL/mesa/src/drv/r128/r128_context.h index 462b8b812..800cc1754 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_context.h +++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.6 2001/03/21 16:14:23 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.8 2001/04/10 17:53:07 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -255,6 +255,24 @@ extern r128ContextPtr r128MakeCurrent( r128ContextPtr oldCtx, r128ContextPtr newCtx, __DRIdrawablePrivate *dPriv ); +/* ================================================================ + * Byte ordering + */ +#include "X11/Xarch.h" + +#if X_BYTE_ORDER == X_LITTLE_ENDIAN +#define LE32_OUT( x, y ) do { x = y; } while (0) +#define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)&(x) = y; } while (0) +#else +#include <byteswap.h> +#define LE32_OUT( x, y ) do { x = bswap_32( y ); } while (0) +#define LE32_OUT_FLOAT( x, y ) \ +do { \ + GLuint __tmp; \ + *(GLfloat *)&__tmp = y; \ + x = bswap_32( __tmp ); \ +} while (0) +#endif /* ================================================================ * Debugging: diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c index af5fb66ff..fd6223ff5 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.11 2001/03/25 05:32:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.12 2001/04/10 16:07:52 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -45,7 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "X86/common_x86_asm.h" #endif -#define R128_DATE "20010130" +#define R128_DATE "20010405" /* Return the width and height of the current color buffer. @@ -84,7 +84,7 @@ static const GLubyte *r128DDGetString( GLcontext *ctx, GLenum name ) strncat( buffer, " M3", 3 ); } - /* Append any AGP-specific information. + /* Append any AGP/PCI-specific information. */ switch ( rmesa->r128Screen->AGPMode ) { case 1: diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c index 76b87775d..09dbb390d 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.5 2001/04/01 14:00:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.6 2001/04/10 16:07:52 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -308,7 +308,19 @@ static int r128WaitForFrameCompletion( r128ContextPtr rmesa ) int wait = 0; while ( 1 ) { +#if defined(__alpha__) + /* necessary to preserve the Alpha paradigm */ + /* NOTE: this will not work on SPARSE machines */ + mem_barrier(); + frame = *(volatile CARD32 *)(void *)(R128MMIO + R128_LAST_FRAME_REG); +#else frame = INREG( R128_LAST_FRAME_REG ); +#endif + + if ( 0 ) + fprintf( stderr, " last=0x%08x frame=0x%08x\n", + rmesa->sarea->last_frame, frame ); + if ( rmesa->sarea->last_frame - frame <= R128_MAX_OUTSTANDING ) { break; } @@ -327,7 +339,7 @@ static int r128WaitForFrameCompletion( r128ContextPtr rmesa ) */ void r128SwapBuffers( r128ContextPtr rmesa ) { - GLint nbox = rmesa->numClipRects; + GLint nbox; GLint i; GLint ret; @@ -342,6 +354,8 @@ void r128SwapBuffers( r128ContextPtr rmesa ) LOCK_HARDWARE( rmesa ); + nbox = rmesa->numClipRects; /* must be in locked region */ + /* Throttle the frame rate -- only allow one pending swap buffers * request at a time. */ diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c index ee3ba607d..4e8601c0b 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.8 2001/03/21 16:14:24 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.9 2001/04/10 16:07:52 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -30,6 +30,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Gareth Hughes <gareth@valinux.com> * Kevin E. Martin <martin@valinux.com> + * Michel Dänzer <michdaen@iiic.ethz.ch> * */ @@ -572,8 +573,8 @@ static void r128ConvertTexture16bpp( CARD32 *dst, for ( i = 0 ; i < height ; i++ ) { src = (CARD8 *)image->Data + ((y + i) * pitch + x) * 4; for ( j = width >> 1 ; j ; j-- ) { - *dst++ = ((R128PACKCOLOR4444( src[0], src[1], src[2], src[3] )) | - (R128PACKCOLOR4444( src[4], src[5], src[6], src[7] ) << 16)); + *dst++ = R128PACKCOLORS4444( src[0], src[1], src[2], src[3], + src[4], src[5], src[6], src[7] ); src += 8; } } @@ -583,8 +584,8 @@ static void r128ConvertTexture16bpp( CARD32 *dst, for ( i = 0 ; i < height ; i++ ) { src = (CARD8 *)image->Data + ((y + i) * pitch + x) * 3; for ( j = width >> 1 ; j ; j-- ) { - *dst++ = ((R128PACKCOLOR565( src[0], src[1], src[2] )) | - (R128PACKCOLOR565( src[3], src[4], src[5] ) << 16)); + *dst++ = R128PACKCOLORS565( src[0], src[1], src[2], + src[3], src[4], src[5] ); src += 6; } } @@ -594,8 +595,8 @@ static void r128ConvertTexture16bpp( CARD32 *dst, for ( i = 0 ; i < height ; i++ ) { src = (CARD8 *)image->Data + ((y + i) * pitch + x); for ( j = width >> 1 ; j ; j-- ) { - *dst++ = ((R128PACKCOLOR4444( 0xff, 0xff, 0xff, src[0] )) | - (R128PACKCOLOR4444( 0xff, 0xff, 0xff, src[1] ) << 16)); + *dst++ = R128PACKCOLORS4444( 0xff, 0xff, 0xff, src[0], + 0xff, 0xff, 0xff, src[1] ); src += 2; } } @@ -605,8 +606,8 @@ static void r128ConvertTexture16bpp( CARD32 *dst, for ( i = 0 ; i < height ; i++ ) { src = (CARD8 *)image->Data + ((y + i) * pitch + x) * 2; for ( j = width >> 1 ; j ; j-- ) { - *dst++ = ((R128PACKCOLOR4444( src[0], src[0], src[0], src[1] )) | - (R128PACKCOLOR4444( src[2], src[2], src[2], src[3] ) << 16)); + *dst++ = R128PACKCOLORS4444( src[0], src[0], src[0], src[1], + src[2], src[2], src[2], src[3] ); src += 4; } } @@ -877,7 +878,8 @@ int r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t ) t->memBlock = mmAllocMem( rmesa->texHeap[heap], t->totalSize, 12, 0 ); /* Try AGP before kicking anything out of local mem */ - if ( !t->memBlock && heap == R128_CARD_HEAP ) { + if ( !rmesa->r128Screen->IsPCI && + !t->memBlock && heap == R128_CARD_HEAP ) { t->memBlock = mmAllocMem( rmesa->texHeap[R128_AGP_HEAP], t->totalSize, 12, 0 ); diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tex.h b/xc/lib/GL/mesa/src/drv/r128/r128_tex.h index e1f67a56d..4e8822947 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_tex.h +++ b/xc/lib/GL/mesa/src/drv/r128/r128_tex.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.4 2001/01/08 01:07:23 martin Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.6 2001/04/10 17:53:07 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -74,6 +74,24 @@ extern void r128DDInitTextureFuncs( GLcontext *ctx ); #define R128PACKCOLOR4444( r, g, b, a ) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) +#include "X11/Xarch.h" +#if X_BYTE_ORDER == X_LITTLE_ENDIAN +#define R128PACKCOLORS565( r0, g0, b0, r1, g1, b1 ) \ + ((R128PACKCOLOR565( r0, g0, b0 )) | \ + (R128PACKCOLOR565( r1, g1, b1 ) << 16)) +#define R128PACKCOLORS4444( r0, g0, b0, a0, r1, g1, b1, a1 ) \ + ((R128PACKCOLOR4444( r0, g0, b0, a0 )) | \ + (R128PACKCOLOR4444( r1, g1, b1, a1 ) << 16)) +#else +#define R128PACKCOLORS565( r0, g0, b0, r1, g1, b1 ) \ + ((R128PACKCOLOR565( r1, g1, b1 )) | \ + (R128PACKCOLOR565( r0, g0, b0 ) << 16)) +#define R128PACKCOLORS4444( r0, g0, b0, a0, r1, g1, b1, a1 ) \ + ((R128PACKCOLOR4444( r1, g1, b1, a1 )) | \ + (R128PACKCOLOR4444( r0, g0, b0, a0 ) << 16)) + +#endif + static __inline__ CARD32 r128PackColor( GLuint cpp, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c index 4d83e27e0..261142d75 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.4 2001/01/08 01:07:24 martin Exp $ */ /* -*- c-basic-offset: 3 -*- */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.6 2001/04/10 17:53:07 dawes Exp $ */ /* -*- c-basic-offset: 3 -*- */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -30,6 +30,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Gareth Hughes <gareth@valinux.com> * Kevin E. Martin <martin@valinux.com> + * Michel Dänzer <michdaen@iiic.ethz.ch> * */ @@ -49,6 +50,7 @@ static struct { quad_func quad; } rast_tab[R128_MAX_TRIFUNC]; +#if X_BYTE_ORDER == X_LITTLE_ENDIAN #define R128_COLOR( to, from ) \ do { \ (to)[0] = (from)[2]; \ @@ -56,6 +58,15 @@ do { \ (to)[2] = (from)[0]; \ (to)[3] = (from)[3]; \ } while (0) +#else +#define R128_COLOR( to, from ) \ +do { \ + (to)[0] = (from)[3]; \ + (to)[1] = (from)[0]; \ + (to)[2] = (from)[1]; \ + (to)[3] = (from)[2]; \ +} while (0) +#endif static void r128_null_quad( GLcontext *ctx, GLuint v0, diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tris.h b/xc/lib/GL/mesa/src/drv/r128/r128_tris.h index 108c85075..a279af547 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_tris.h +++ b/xc/lib/GL/mesa/src/drv/r128/r128_tris.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.5 2001/03/21 16:14:24 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.6 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -56,7 +56,7 @@ static __inline void r128_draw_triangle( r128ContextPtr rmesa, r128VertexPtr v1, r128VertexPtr v2 ) { - int vertsize = rmesa->vertsize; + GLuint vertsize = rmesa->vertsize; CARD32 *vb = r128AllocVerticesInline( rmesa, 3 ); int j; @@ -80,15 +80,15 @@ static __inline void r128_draw_triangle( r128ContextPtr rmesa, : "memory" ); #else for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v0->ui[j]; + LE32_OUT( vb[j], v0->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v1->ui[j]; + LE32_OUT( vb[j], v1->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v2->ui[j]; + LE32_OUT( vb[j], v2->ui[j] ); #endif } @@ -98,7 +98,7 @@ static __inline void r128_draw_quad( r128ContextPtr rmesa, r128VertexPtr v2, r128VertexPtr v3 ) { - int vertsize = rmesa->vertsize; + GLuint vertsize = rmesa->vertsize; CARD32 *vb = r128AllocVerticesInline( rmesa, 6 ); int j; @@ -134,37 +134,37 @@ static __inline void r128_draw_quad( r128ContextPtr rmesa, : "memory" ); #else for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v0->ui[j]; + LE32_OUT( vb[j], v0->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v1->ui[j]; + LE32_OUT( vb[j], v1->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v3->ui[j]; + LE32_OUT( vb[j], v3->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v1->ui[j]; + LE32_OUT( vb[j], v1->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v2->ui[j]; + LE32_OUT( vb[j], v2->ui[j] ); vb += vertsize; for ( j = 0 ; j < vertsize ; j++ ) - vb[j] = v3->ui[j]; + LE32_OUT( vb[j], v3->ui[j] ); #endif } static __inline void r128_draw_line( r128ContextPtr rmesa, r128VertexPtr tmp0, r128VertexPtr tmp1, - float width ) + GLfloat width ) { #if 1 - int vertsize = rmesa->vertsize; + GLuint vertsize = rmesa->vertsize; CARD32 *vb = r128AllocVerticesInline( rmesa, 6 ); GLfloat hw, dx, dy, ix, iy; GLuint j; @@ -204,40 +204,40 @@ static __inline void r128_draw_line( r128ContextPtr rmesa, x1 += 0.5F; } - *(float *)&vb[0] = x0 - ix; - *(float *)&vb[1] = y0 - iy; + LE32_OUT_FLOAT( vb[0], x0 - ix ); + LE32_OUT_FLOAT( vb[1], y0 - iy ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp0->ui[j]; + LE32_OUT( vb[j], tmp0->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x1 + ix; - *(float *)&vb[1] = y1 + iy; + LE32_OUT_FLOAT( vb[0], x1 + ix ); + LE32_OUT_FLOAT( vb[1], y1 + iy ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp1->ui[j]; + LE32_OUT( vb[j], tmp1->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x0 + ix; - *(float *)&vb[1] = y0 + iy; + LE32_OUT_FLOAT( vb[0], x0 + ix ); + LE32_OUT_FLOAT( vb[1], y0 + iy ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp0->ui[j]; + LE32_OUT( vb[j], tmp0->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x0 - ix; - *(float *)&vb[1] = y0 - iy; + LE32_OUT_FLOAT( vb[0], x0 - ix ); + LE32_OUT_FLOAT( vb[1], y0 - iy ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp0->ui[j]; + LE32_OUT( vb[j], tmp0->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x1 - ix; - *(float *)&vb[1] = y1 - iy; + LE32_OUT_FLOAT( vb[0], x1 - ix ); + LE32_OUT_FLOAT( vb[1], y1 - iy ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp1->ui[j]; + LE32_OUT( vb[j], tmp1->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x1 + ix; - *(float *)&vb[1] = y1 + iy; + LE32_OUT_FLOAT( vb[0], x1 + ix ); + LE32_OUT_FLOAT( vb[1], y1 + iy ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp1->ui[j]; + LE32_OUT( vb[j], tmp1->ui[j] ); #else @@ -271,49 +271,50 @@ static __inline void r128_draw_line( r128ContextPtr rmesa, } static __inline void r128_draw_point( r128ContextPtr rmesa, - r128VertexPtr tmp, float sz ) + r128VertexPtr tmp, GLfloat sz ) { #if 1 - int vertsize = rmesa->vertsize; + GLuint vertsize = rmesa->vertsize; CARD32 *vb = r128AllocVerticesInline( rmesa, 6 ); int j; const float x = tmp->v.x + PNT_X_OFFSET; const float y = tmp->v.y + PNT_Y_OFFSET; - *(float *)&vb[0] = x - sz; - *(float *)&vb[1] = y - sz; + LE32_OUT_FLOAT( vb[0], x - sz ); + LE32_OUT_FLOAT( vb[1], y - sz ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp->ui[j]; + LE32_OUT( vb[j], tmp->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x + sz; - *(float *)&vb[1] = y - sz; + LE32_OUT_FLOAT( vb[0], x + sz ); + LE32_OUT_FLOAT( vb[1], y - sz ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp->ui[j]; + LE32_OUT( vb[j], tmp->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x + sz; - *(float *)&vb[1] = y + sz; + LE32_OUT_FLOAT( vb[0], x + sz ); + LE32_OUT_FLOAT( vb[1], y + sz ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp->ui[j]; + LE32_OUT( vb[j], tmp->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x + sz; - *(float *)&vb[1] = y + sz; + LE32_OUT_FLOAT( vb[0], x + sz ); + LE32_OUT_FLOAT( vb[1], y + sz ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp->ui[j]; + LE32_OUT( vb[j], tmp->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x - sz; - *(float *)&vb[1] = y + sz; + LE32_OUT_FLOAT( vb[0], x - sz ); + LE32_OUT_FLOAT( vb[1], y + sz ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp->ui[j]; + LE32_OUT( vb[j], tmp->ui[j] ); vb += vertsize; - *(float *)&vb[0] = x - sz; - *(float *)&vb[1] = y - sz; + LE32_OUT_FLOAT( vb[0], x - sz ); + LE32_OUT_FLOAT( vb[1], y - sz ); for (j = 2 ; j < vertsize ; j++) - vb[j] = tmp->ui[j]; + LE32_OUT( vb[j], tmp->ui[j] ); + #else int vertsize = rmesa->vertsize; diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_vb.h b/xc/lib/GL/mesa/src/drv/r128/r128_vb.h index 1a00d9eea..797c4c624 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_vb.h +++ b/xc/lib/GL/mesa/src/drv/r128/r128_vb.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.h,v 1.4 2001/01/08 01:07:24 martin Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.h,v 1.6 2001/04/10 17:53:07 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -30,6 +30,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Gareth Hughes <gareth@valinux.com> * Kevin E. Martin <martin@valinux.com> + * Michel Dänzer <michdaen@iiic.ethz.ch> * */ @@ -38,13 +39,22 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef GLX_DIRECT_RENDERING -/* FIXME: This is endian-specific */ +#include "X11/Xarch.h" +#if X_BYTE_ORDER == X_LITTLE_ENDIAN typedef struct { GLubyte blue; GLubyte green; GLubyte red; GLubyte alpha; } r128_color_t; +#else +typedef struct { + GLubyte alpha; + GLubyte red; + GLubyte green; + GLubyte blue; +} r128_color_t; +#endif /* The vertex structure. The final tu1/tv1 values are only used in * multitexture modes, and the rhw2 value is currently never used. diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_dd.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_dd.c index d55809fb8..e055a0241 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_dd.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_dd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_dd.c,v 1.5 2001/03/25 05:32:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_dd.c,v 1.6 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -46,7 +46,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "X86/common_x86_asm.h" #endif -#define RADEON_DATE "20010319" +#define RADEON_DATE "20010402" /* Return the width and height of the current color buffer. @@ -79,18 +79,22 @@ static const GLubyte *radeonDDGetString( GLcontext *ctx, GLenum name ) /* Append any chipset-specific information. None yet. */ - /* Append any AGP-specific information. + /* Append any AGP/PCI-specific information. */ - switch ( rmesa->radeonScreen->AGPMode ) { - case 1: - strncat( buffer, " AGP 1x", 7 ); - break; - case 2: - strncat( buffer, " AGP 2x", 7 ); - break; - case 4: - strncat( buffer, " AGP 4x", 7 ); - break; + if ( rmesa->radeonScreen->IsPCI ) { + strncat( buffer, " PCI", 4 ); + } else { + switch ( rmesa->radeonScreen->AGPMode ) { + case 1: + strncat( buffer, " AGP 1x", 7 ); + break; + case 2: + strncat( buffer, " AGP 2x", 7 ); + break; + case 4: + strncat( buffer, " AGP 4x", 7 ); + break; + } } /* Append any CPU-specific information. diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c index 550dcda3c..0889cc9d2 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v 1.3 2001/04/01 14:00:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v 1.4 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -386,7 +386,14 @@ static int radeonWaitForFrameCompletion( radeonContextPtr rmesa ) int i; while ( 1 ) { +#if defined(__alpha__) + /* necessary to preserve the Alpha paradigm */ + /* NOTE: this will not work on SPARSE machines */ + mem_barrier(); + frame = *(volatile CARD32 *)(void *)(RADEONMMIO + RADEON_LAST_FRAME_REG); +#else frame = INREG( RADEON_LAST_FRAME_REG ); +#endif if ( sarea->last_frame - frame <= RADEON_MAX_OUTSTANDING ) { break; } @@ -405,7 +412,7 @@ static int radeonWaitForFrameCompletion( radeonContextPtr rmesa ) */ void radeonSwapBuffers( radeonContextPtr rmesa ) { - GLint nbox = rmesa->numClipRects; + GLint nbox; GLint i; GLint ret; @@ -417,6 +424,8 @@ void radeonSwapBuffers( radeonContextPtr rmesa ) LOCK_HARDWARE( rmesa ); + nbox = rmesa->numClipRects; /* must be in locked region */ + /* Throttle the frame rate -- only allow one pending swap buffers * request at a time. */ @@ -607,7 +616,14 @@ static GLbitfield radeonDDClear( GLcontext *ctx, GLbitfield mask, } #else while ( 1 ) { +#if defined(__alpha__) + /* necessary to preserve the Alpha paradigm */ + /* NOTE: this will not work on SPARSE machines */ + mem_barrier(); + clear = *(volatile CARD32 *)(void *)(RADEONMMIO + RADEON_LAST_CLEAR_REG); +#else clear = INREG( RADEON_LAST_CLEAR_REG ); +#endif if ( sarea->last_clear - clear <= RADEON_MAX_CLEARS ) { break; } diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c index e506eea94..aec7677fa 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v 1.2 2001/03/21 16:14:24 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v 1.3 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -71,8 +71,8 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags ) */ XMESA_VALIDATE_DRAWABLE_INFO( rmesa->display, sPriv, dPriv ); - if ( rmesa->lastStamp != dPriv->lastStamp ) { - rmesa->lastStamp = dPriv->lastStamp; + if ( rmesa->lastStamp != *(dPriv->pStamp) ) { + rmesa->lastStamp = *(dPriv->pStamp); rmesa->new_state |= RADEON_NEW_WINDOW | RADEON_NEW_CLIP; rmesa->SetupDone = 0; } diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c index baa8201e1..917f8aa1d 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_span.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c,v 1.3 2001/03/21 16:14:25 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c,v 1.4 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -260,6 +260,7 @@ do { \ * Stencil buffer */ +#if 0 /* 24 bit depth, 8 bit stencil depthbuffer functions */ #define WRITE_STENCIL( _x, _y, d ) \ @@ -281,7 +282,7 @@ do { \ #define TAG(x) radeon##x##_24_8 #include "stenciltmp.h" - +#endif void radeonDDInitSpanFuncs( GLcontext *ctx ) diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c index cbef6fcf4..c022bfcd3 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c,v 1.1 2001/03/21 16:14:25 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c,v 1.2 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -323,12 +323,7 @@ static void radeonUploadSubImage( radeonContextPtr rmesa, GLint texelsPerDword = 0; GLint imageX, imageY, imageWidth, imageHeight; GLint blitX, blitY, blitWidth, blitHeight; - GLint imageRows, blitRows; - GLint remaining; - GLint format, dwords; - CARD32 pitch, offset; - drmBufPtr buffer; - CARD32 *dst; + GLuint format, pitch, offset; GLint ret; if ( RADEON_DEBUG & DEBUG_VERBOSE_TEXTURE ) { diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_texobj.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_texobj.h index 800f3cec4..8ed4ecdb9 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_texobj.h +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_texobj.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texobj.h,v 1.2 2001/03/21 16:14:25 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texobj.h,v 1.3 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -53,10 +53,10 @@ struct radeon_tex_obj { struct gl_texture_object *tObj; /* Mesa texture object */ PMemBlock memBlock; /* Memory block containing texture */ - CARD32 bufAddr; /* Offset to start of locally + GLuint bufAddr; /* Offset to start of locally shared texture block */ - CARD32 dirty_images; /* Flags for whether or not + GLuint dirty_images; /* Flags for whether or not images need to be uploaded to local or AGP texture space */ diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c index 8a02e3275..6db4d690a 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c,v 1.3 2001/03/21 16:14:25 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c,v 1.4 2001/04/10 16:07:53 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -82,7 +82,7 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DRM driver version is compatible */ if ( sPriv->drmMajor != 1 || - sPriv->drmMinor < 0 ) { + sPriv->drmMinor < 1 ) { char msg[128]; sprintf( msg, "RADEON DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); __driMesaMessage( msg ); diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c index ba3d3f390..aab9ad73d 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.2 2001/04/01 14:00:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.3 2001/04/10 16:07:54 dawes Exp $ */ /* * Original rewrite: @@ -47,7 +47,7 @@ #include "X86/common_x86_asm.h" #endif -#define TDFX_DATE "20010305" +#define TDFX_DATE "20010321" /* These are used in calls to FX_grColorMaskv() */ diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c index 64648887c..02c574bc5 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.1 2001/03/21 16:14:28 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.2 2001/04/10 16:07:54 dawes Exp $ */ /* * Original rewrite: @@ -863,20 +863,8 @@ void tdfxTMFreeTextureLocked( tdfxContextPtr fxMesa, int i; tdfxTMMoveOutTMLocked( fxMesa, tObj ); for ( i = 0 ; i < MAX_TEXTURE_LEVELS ; i++ ) { - if ( t->image[i].original.data ) { - FREE( t->image[i].original.data ); - t->image[i].original.data = NULL; - t->image[i].original.width = 0; - t->image[i].original.height = 0; - t->image[i].original.size = 0; - } - if ( t->image[i].rescaled.data ) { - FREE( t->image[i].rescaled.data ); - t->image[i].rescaled.data = NULL; - t->image[i].rescaled.width = 0; - t->image[i].rescaled.height = 0; - t->image[i].rescaled.size = 0; - } + if ( t->image[i].original.data ) FREE( t->image[i].original.data ); + if ( t->image[i].rescaled.data ) FREE( t->image[i].rescaled.data ); } FREE( t ); tObj->DriverData = NULL; diff --git a/xc/lib/GLU/libnurbs/internals/Imakefile b/xc/lib/GLU/libnurbs/internals/Imakefile index b04e8d99f..221ffe927 100644 --- a/xc/lib/GLU/libnurbs/internals/Imakefile +++ b/xc/lib/GLU/libnurbs/internals/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GLU/libnurbs/internals/Imakefile,v 1.4 2001/02/18 20:01:02 dawes Exp $ +XCOMM $XFree86: xc/lib/GLU/libnurbs/internals/Imakefile,v 1.5 2001/04/07 17:13:26 dawes Exp $ XCOMM License Applicability. Except to the extent portions of this file are XCOMM made subject to an alternative license as permitted in the SGI Free @@ -138,12 +138,15 @@ OBJS = \ INCLUDES = \ -I../nurbtess \ + -I../../libutil \ -I../../include \ -I$(TOP)/include \ -I$(TOP)/include/GL #if SystemV4 OSDEFINES = -DNEEDCEILF +#else +OSDEFINES = -D_EXTENSIONS_ #endif DEFINES = $(OSDEFINES) \ diff --git a/xc/lib/ICE/ICE-def.cpp b/xc/lib/ICE/ICE-def.cpp index df1d9ea58..fd571ed58 100644 --- a/xc/lib/ICE/ICE-def.cpp +++ b/xc/lib/ICE/ICE-def.cpp @@ -62,5 +62,13 @@ EXPORTS _IceWrite IceListenForWellKnownConnections _IceTransGetHostname + _IceTransSetOption + _IceTransConnect + _IceTransClose + _IceTransOpenCOTSClient + _IceTransGetConnectionNumber + _IceTransRead + _IceTransWrite + /* $Xorg: ICE-def.cpp,v 1.3 2000/08/21 16:42:31 coskrey Exp $ */ -/* $XFree86: xc/lib/ICE/ICE-def.cpp,v 1.4 2001/01/17 19:41:29 dawes Exp $ */ +/* $XFree86: xc/lib/ICE/ICE-def.cpp,v 1.5 2001/04/18 16:13:18 dawes Exp $ */ diff --git a/xc/lib/ICE/Imakefile b/xc/lib/ICE/Imakefile index 49b9f2fe2..e794e3551 100644 --- a/xc/lib/ICE/Imakefile +++ b/xc/lib/ICE/Imakefile @@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:11 cpqbld Exp $ -XCOMM $XFree86: xc/lib/ICE/Imakefile,v 3.4 2001/01/17 19:41:29 dawes Exp $ +XCOMM $XFree86: xc/lib/ICE/Imakefile,v 3.5 2001/04/23 16:17:06 tsi Exp $ #define DoNormalLib NormalLibICE #define DoSharedLib SharedLibICE @@ -34,7 +34,7 @@ CONN_DEFINES = $(CONNECTION_FLAGS) -DICE_t -DTRANS_CLIENT -DTRANS_SERVER SOCK_DEFINES = -DBSD44SOCKETS #endif -DEPEND_DEFINES = $(TRANS_INCLUDES) $(CONN_DEFINES) +DEPEND_DEFINES = $(TRANS_INCLUDES) $(CONN_DEFINES) DependDefines HEADERS = ICE.h \ ICEconn.h \ diff --git a/xc/lib/SM/Imakefile b/xc/lib/SM/Imakefile index b0f8fda1e..b395fc396 100644 --- a/xc/lib/SM/Imakefile +++ b/xc/lib/SM/Imakefile @@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:28 cpqbld Exp $ -XCOMM $XFree86: xc/lib/SM/Imakefile,v 1.3 2001/01/17 19:41:31 dawes Exp $ +XCOMM $XFree86: xc/lib/SM/Imakefile,v 1.4 2001/04/23 16:17:07 tsi Exp $ #define DoNormalLib NormalLibSM #define DoSharedLib SharedLibSM @@ -26,7 +26,7 @@ CONN_DEFINES = -DTCPCONN -DICE_t #else CONN_DEFINES = $(CONNECTION_FLAGS) -DICE_t #endif -DEPEND_DEFINES = $(CONN_DEFINES) +DEPEND_DEFINES = $(CONN_DEFINES) DependDefines HEADERS = SM.h \ SMproto.h \ diff --git a/xc/lib/X11/Imakefile b/xc/lib/X11/Imakefile index 7af7007c3..25d6abd7c 100644 --- a/xc/lib/X11/Imakefile +++ b/xc/lib/X11/Imakefile @@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:38 cpqbld Exp $ -XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.36 2001/03/21 17:36:44 dawes Exp $ +XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.37 2001/04/23 16:17:07 tsi Exp $ #define DoNormalLib NormalLibX11 #define DoSharedLib SharedLibX11 @@ -93,7 +93,7 @@ EXTRA_LIBRARIES = /**/ #endif DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES) OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS) - DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) + DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o AUTHSRCS = AuDispose.c AuGetBest.c AuFileName.c AuRead.c SRCS = $(SRCS1) $(SRCS2) $(SRCS3) /* try *.c if you have trouble */ diff --git a/xc/lib/X11/XlibInt.c b/xc/lib/X11/XlibInt.c index 61e5bc1f2..0ba68dd58 100644 --- a/xc/lib/X11/XlibInt.c +++ b/xc/lib/X11/XlibInt.c @@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/XlibInt.c,v 3.25 2001/01/25 16:21:44 keithp Exp $ */ +/* $XFree86: xc/lib/X11/XlibInt.c,v 3.26 2001/04/26 16:23:09 dawes Exp $ */ /* * XlibInt.c - Internal support routines for the C subroutine @@ -1815,7 +1815,13 @@ _XAsyncReply(dpy, rep, buf, lenp, discard) (void) _XSetLastRequestRead(dpy, &rep->generic); len = SIZEOF(xReply) + (rep->generic.length << 2); - + if (len < SIZEOF(xReply)) { + _XIOError (dpy); + buf += *lenp; + *lenp = 0; + return buf; + } + for (async = dpy->async_handlers; async; async = next) { next = async->next; if ((consumed = (*async->handler)(dpy, rep, buf, *lenp, async->data))) diff --git a/xc/lib/Xft/Imakefile b/xc/lib/Xft/Imakefile index 9b62f6212..6265bc53c 100644 --- a/xc/lib/Xft/Imakefile +++ b/xc/lib/Xft/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/Xft/Imakefile,v 1.12 2001/03/30 18:50:18 keithp Exp $ +XCOMM $XFree86: xc/lib/Xft/Imakefile,v 1.14 2001/04/27 14:55:22 tsi Exp $ #define DoNormalLib NormalLibXft #define DoSharedLib SharedLibXft @@ -63,6 +63,8 @@ YaccFilePrefix(xftgram,$(YFLAGS),XftConfig) SpecialCObjectRule(sharedlib,NullParameter,$(SHLIBDEF)) #endif +all:: XftConfig + CppFileTarget(XftConfig,XftConfig.cpp,$(CONFIG_DEFS),$(ICONFIGFILES)) #if InstallFSConfig @@ -71,6 +73,8 @@ InstallNonExecFile(XftConfig,$(XFTLIBDIR)) InstallNonExecFileNoClobber(XftConfig,$(XFTLIBDIR)) #endif +LinkConfFileLong(XftConfig,XftConfig,$(XFTLIBDIR),$(CONFDIR)) + MANSUFFIX = $(LIBMANSUFFIX) InstallManPage(Xft,$(LIBMANDIR)) DependTarget() diff --git a/xc/lib/Xft/XftConfig.cpp b/xc/lib/Xft/XftConfig.cpp index 515fd24f0..cf04051cd 100644 --- a/xc/lib/Xft/XftConfig.cpp +++ b/xc/lib/Xft/XftConfig.cpp @@ -1,28 +1,28 @@ -# $XFree86: xc/lib/Xft/XftConfig.cpp,v 1.5 2000/12/14 23:03:53 keithp Exp $ +XCOMM $XFree86: xc/lib/Xft/XftConfig.cpp,v 1.6 2001/04/27 14:55:22 tsi Exp $ dir XFT_TYPE1_DIR -# -# alias 'fixed' for 'mono' -# +XCOMM +XCOMM alias 'fixed' for 'mono' +XCOMM match any family == "fixed" edit family =+ "mono"; -# -# Check users config file -# +XCOMM +XCOMM Check users config file +XCOMM includeif "~/.xftconfig" -# -# Use Lucidux fonts for default faces -# +XCOMM +XCOMM Use Lucidux fonts for default faces +XCOMM match any family == "serif" edit family += "LuciduxSerif"; match any family == "sans" edit family += "LuciduxSans"; match any family == "mono" edit family += "LuciduxMono"; -# -# Alias between XLFD families and font file family name, prefer local -# fonts -# +XCOMM +XCOMM Alias between XLFD families and font file family name, prefer local +XCOMM fonts +XCOMM match any family == "charter" edit family += "bitstream charter"; match any family == "bitstream charter" edit family =+ "charter"; diff --git a/xc/lib/Xft/xftrender.c b/xc/lib/Xft/xftrender.c index d9233c57e..1be21a65a 100644 --- a/xc/lib/Xft/xftrender.c +++ b/xc/lib/Xft/xftrender.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftrender.c,v 1.6 2000/12/20 00:28:45 keithp Exp $ + * $XFree86: xc/lib/Xft/xftrender.c,v 1.7 2001/04/21 16:58:02 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -197,6 +197,9 @@ XftRenderExtents8 (Display *dpy, int l; XGlyphInfo *gi; int x, y; + int left, right, top, bottom; + int overall_left, overall_right; + int overall_top, overall_bottom; s = string; l = len; @@ -225,26 +228,39 @@ XftRenderExtents8 (Display *dpy, extents->xOff = 0; return; } - *extents = *gi; - x = gi->xOff; - y = gi->yOff; + x = 0; + y = 0; + overall_left = x - gi->x; + overall_top = y - gi->y; + overall_right = overall_left + (int) gi->width; + overall_bottom = overall_top + (int) gi->height; + x += gi->xOff; + y += gi->yOff; while (len--) { c = *string++; gi = c < font->nrealized ? font->realized[c] : 0; if (!gi) continue; - if (gi->x + x < extents->x) - extents->x = gi->x + x; - if (gi->y + y < extents->y) - extents->y = gi->y + y; - if (gi->width + x > extents->width) - extents->width = gi->width + x; - if (gi->height + y > extents->height) - extents->height = gi->height + y; + left = x - gi->x; + top = y - gi->y; + right = left + (int) gi->width; + bottom = top + (int) gi->height; + if (left < overall_left) + overall_left = left; + if (top < overall_top) + overall_top = top; + if (right > overall_right) + overall_right = right; + if (bottom > overall_bottom) + overall_bottom = bottom; x += gi->xOff; y += gi->yOff; } + extents->x = -overall_left; + extents->y = -overall_top; + extents->width = overall_right - overall_left; + extents->height = overall_bottom - overall_top; extents->xOff = x; extents->yOff = y; } diff --git a/xc/lib/Xmuu/Xmuu-def.cpp b/xc/lib/Xmuu/Xmuu-def.cpp new file mode 100644 index 000000000..607e5402f --- /dev/null +++ b/xc/lib/Xmuu/Xmuu-def.cpp @@ -0,0 +1,20 @@ +LIBRARY libXmuu +VERSION LIBRARY_VERSION +EXPORTS + + XmuClientWindow + XmuCursorNameToIndex + XmuPrintDefaultErrorMessage + XmuSimpleErrorHandler + XmuGetHostname + XmuCompareISOLatin1 + XmuCopyISOLatin1Lowered + XmuCopyISOLatin1Uppered + XmuNCopyISOLatin1Lowered + XmuNCopyISOLatin1Uppered + XmuSnprintf + _cygwin_dll_entry@12 + _cygwin_noncygwin_dll_entry@12 + dll_main@12 + +/* $XFree86: xc/lib/Xmuu/Xmuu-def.cpp,v 1.1 2001/04/18 17:14:00 dawes Exp $ */ diff --git a/xc/lib/dps/Imakefile b/xc/lib/dps/Imakefile index 0202c0eb0..8ddef11c9 100644 --- a/xc/lib/dps/Imakefile +++ b/xc/lib/dps/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/dps/Imakefile,v 1.12 2000/05/23 19:32:52 dawes Exp $ +XCOMM $XFree86: xc/lib/dps/Imakefile,v 1.13 2001/04/07 19:41:50 alanh Exp $ #define DoNormalLib NormalLibDps #define DoSharedLib SharedLibDps @@ -231,7 +231,7 @@ ProgramTargetName($(PSWRAP)): HEADERS = psops.h dpsops.h -depend :: $(HEADERS) +includes :: $(HEADERS) depend :: $(DPSOPSCFILES) $(PSOPSCFILES) #ifndef OS2Architecture diff --git a/xc/lib/dps/csconndi.c b/xc/lib/dps/csconndi.c index 88982770c..485720eb3 100644 --- a/xc/lib/dps/csconndi.c +++ b/xc/lib/dps/csconndi.c @@ -47,7 +47,7 @@ * * Author: Adobe Systems Incorporated and MIT X Consortium */ -/* $XFree86: xc/lib/dps/csconndi.c,v 1.5 2000/08/23 21:06:19 dawes Exp $ */ +/* $XFree86: xc/lib/dps/csconndi.c,v 1.6 2001/04/16 20:33:08 tsi Exp $ */ #if defined(sun) && !defined(SVR4) #define memmove(t,f,c) bcopy(f,t,c) @@ -482,7 +482,7 @@ static int MakeDECnetConnection (phostname, iagent, retries, #ifdef UNIXCONN -#ifndef __CYGWIN__ /* causes conflicts with cygwin headers */ +#ifndef X_NO_SYS_UN #include <sys/un.h> #endif diff --git a/xc/lib/font/fontfile/fontenc.c b/xc/lib/font/fontfile/fontenc.c index 08e53d8a5..ad2ed81a2 100644 --- a/xc/lib/font/fontfile/fontenc.c +++ b/xc/lib/font/fontfile/fontenc.c @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/font/fontfile/fontenc.c,v 1.10 2000/11/14 16:54:45 dawes Exp $ */ +/* $XFree86: xc/lib/font/fontfile/fontenc.c,v 1.11 2001/04/18 16:13:18 dawes Exp $ */ /* Backend-independent encoding code */ @@ -697,11 +697,12 @@ loadEncoding(const char *encoding_name, const char *filename) if(strcasecmp(encoding->name, encoding_name) == 0) { found = 1; } else { - for(alias=encoding->aliases; *alias; alias++) - if(!strcasecmp(*alias, encoding_name)) { - found = 1; - break; - } + if(encoding->aliases) + for(alias=encoding->aliases; *alias; alias++) + if(!strcasecmp(*alias, encoding_name)) { + found = 1; + break; + } } if(!found) { @@ -711,21 +712,24 @@ loadEncoding(const char *encoding_name, const char *filename) char *new_name; int numaliases = 0; - new_name = xalloc(strlen(encoding_name + 1)); + new_name = xalloc(strlen(encoding_name) + 1); if(new_name == NULL) return NULL; strcpy(new_name, encoding_name); - for(alias = encoding->aliases; *alias; alias++) - numaliases++; + if(encoding->aliases) + for(alias = encoding->aliases; *alias; alias++) + numaliases++; new_aliases = (char**)xalloc((numaliases+2)*sizeof(char*)); if(new_aliases == NULL) { xfree(new_name); return NULL; } - memcpy(new_aliases, encoding->aliases, numaliases*sizeof(char*)); + if(numaliases) + memcpy(new_aliases, encoding->aliases, numaliases*sizeof(char*)); new_aliases[numaliases] = new_name; new_aliases[numaliases+1] = NULL; - xfree(encoding->aliases); + if(encoding->aliases) + xfree(encoding->aliases); encoding->aliases = new_aliases; } diff --git a/xc/lib/lbxutil/image/dfaxg42d.c b/xc/lib/lbxutil/image/dfaxg42d.c index ca735365f..adeaa2539 100644 --- a/xc/lib/lbxutil/image/dfaxg42d.c +++ b/xc/lib/lbxutil/image/dfaxg42d.c @@ -22,11 +22,12 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/lbxutil/image/dfaxg42d.c,v 1.5 2001/01/17 19:43:35 dawes Exp $ */ +/* $XFree86: xc/lib/lbxutil/image/dfaxg42d.c,v 1.6 2001/04/23 20:31:05 dawes Exp $ */ #include <X11/Xos.h> #include <X11/Xfuncproto.h> #include <X11/Xfuncs.h> +#include <stdlib.h> #include "g3states.h" #include "lbxfax.h" #include "lbximage.h" diff --git a/xc/lib/lbxutil/image/efaxg42d.c b/xc/lib/lbxutil/image/efaxg42d.c index 9809f66cf..3dd115abb 100644 --- a/xc/lib/lbxutil/image/efaxg42d.c +++ b/xc/lib/lbxutil/image/efaxg42d.c @@ -22,10 +22,11 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/lbxutil/image/efaxg42d.c,v 1.4 2001/01/17 19:43:35 dawes Exp $ */ +/* $XFree86: xc/lib/lbxutil/image/efaxg42d.c,v 1.5 2001/04/23 20:31:05 dawes Exp $ */ #include <X11/Xos.h> #include <X11/Xfuncproto.h> +#include <stdlib.h> #include "lbxfax.h" #include "lbximage.h" #include "lbxbwcodes.h" |