#include "compiler/nir/nir_builtin_builder.h"
 #include "compiler/nir/nir_deref.h"
 #include "main/errors.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/shaderobj.h"
 #include "util/u_math.h"
          if (field->memory_restrict)
             qualifiers |= ACCESS_RESTRICT;
       }
-      
+
       parent_type = cur->type;
    }
 
 
 #include "util/u_string.h"
 #include "util/u_math.h"
 
-#include "util/imports.h"
+
 #include "main/shaderobj.h"
 #include "main/enums.h"
 #include "main/mtypes.h"
 
  */
 
 #include "nir.h"
-#include <util/imports.h>
 
 /**
  * SSA-based copy propagation
 
 #include <GL/glxproto.h>
 
 #include "xm_api.h"
-#include "util/imports.h"
 #include "main/errors.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #if !defined(X_GLXCreateContextAttribsARB) && \
      defined(X_GLXCreateContextAtrribsARB)
 #define X_GLXCreateContextAttribsARB X_GLXCreateContextAtrribsARB
-#endif 
+#endif
 
 /* This indicates the client-side GLX API and GLX encoder version. */
 #define CLIENT_MAJOR_VERSION 1
          return NULL;
       }
    }
-   
+
    return vis;
 }
 
 
 /*
  * Select an X visual which satisfies the RGBA flag and minimum depth.
- * Input:  dpy, 
+ * Input:  dpy,
  *         screen - X display and screen number
  *         min_depth - minimum visual depth
  *         preferred_class - preferred GLX visual class or DONT_CARE
       if (stencil_size > 0)
          stencil_size = 8;
 
-      if (accumRedSize > 0 || 
-          accumGreenSize > 0 || 
+      if (accumRedSize > 0 ||
+          accumGreenSize > 0 ||
           accumBlueSize > 0 ||
           accumAlphaSize > 0) {
 
-         accumRedSize = 
-            accumGreenSize = 
+         accumRedSize =
+            accumGreenSize =
             accumBlueSize = default_accum_bits();
 
          accumAlphaSize = alpha_flag ? accumRedSize : 0;
 
       if (no_rast && current == ctx)
          return True;
-          
+
       /* Now make current! */
       if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) {
          ctx->currentDpy = dpy;
 {
    if (dpy && config) {
       XMesaVisual xmvis = (XMesaVisual) config;
-#if 0      
+#if 0
       return xmvis->vishandle;
 #else
       /* create a new vishandle - the cached one may be stale */
 
 #include "hud/hud_context.h"
 
 #include "main/errors.h"
-#include "util/imports.h"
 
 #include "xm_public.h"
 #include <GL/glx.h>
 static GLuint
 choose_pixel_format(XMesaVisual v)
 {
-   boolean native_byte_order = (host_byte_order() == 
+   boolean native_byte_order = (host_byte_order() ==
                                 ImageByteOrder(v->display));
 
    if (   GET_REDMASK(v)   == 0x0000ff
 
 /**
  * Convert an X visual type to a GLX visual type.
- * 
+ *
  * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.)
  *        to be converted.
  * \return If \c visualType is a valid X visual type, a GLX visual type will
  *         be returned.  Otherwise \c GLX_NONE will be returned.
- * 
+ *
  * \note
  * This code was lifted directly from lib/GL/glx/glcontextmodes.c in the
  * DRI CVS tree.
 
    c->st->destroy(c->st);
 
-   /* FIXME: We should destroy the screen here, but if we do so, surfaces may 
+   /* FIXME: We should destroy the screen here, but if we do so, surfaces may
     * outlive it, causing segfaults
-   struct pipe_screen *screen = c->st->pipe->screen; 
+   struct pipe_screen *screen = c->st->pipe->screen;
    screen->destroy(screen);
    */
 
 
 #define BRW_EU_DEFINES_H
 
 #include <stdint.h>
+#include <stdlib.h>
 #include "util/macros.h"
 
 /* The following hunk, up-to "Execution Unit" is used by both the
 
  * test_eu_validate.cpp) will be rejected.
  */
 
+#include <stdlib.h>
 #include "brw_eu.h"
 
 /* We're going to do lots of string concatenation, so this should help. */
 
 # (C) Copyright Zack Rusin 2005. All Rights Reserved.
 # Copyright (C) 2015 Intel Corporation
 # Copyright (C) 2015 Broadcom Corporation
-# 
+#
 # 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
         print('#include <stdio.h>')
         print('#include "main/glheader.h"')
         print('#include "main/enums.h"')
-        print('#include "util/imports.h"')
         print('#include "main/mtypes.h"')
         print('')
         print('typedef struct PACKED {')
 
 #include "main/genmipmap.h"
 #include "main/hint.h"
 #include "main/histogram.h"
-#include "util/imports.h"
 #include "main/light.h"
 #include "main/lines.h"
 #include "main/matrix.h"
 
 
 #include "main/glheader.h"
 """)
+        print('#include "main/glheader.h"')
         return
 
 
 
 
 LOCAL_SRC_FILES := \
        main/extensions_table.c \
-       main/imports.c \
        program/symbol_table.c \
        program/dummy_errors.c
 
 
        main/histogram.h \
        main/image.c \
        main/image.h \
+       main/mesa_private.h \
        main/light.c \
        main/light.h \
        main/lines.c \
 
 
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/accum.h"
 #include "main/arrayobj.h"
 #include "main/context.h"
 
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "util/imports.h"
 #include "main/arbprogram.h"
 #include "main/arrayobj.h"
 #include "main/blend.h"
       _mesa_StencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
       _mesa_StencilFunc(GL_ALWAYS, 0, 255);
       _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
-  
+
       /* set stencil bits to 1 where needed */
       _mesa_StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
 
 
       /* render quad w/ texture into renderbuffer */
       _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
-      
+
       /* Restore texture object state, the texture binding will
        * be restored by _mesa_meta_end().
        */
 
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "util/imports.h"
 #include "main/arbprogram.h"
 #include "main/arrayobj.h"
 #include "main/blend.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 #include "i830_context.h"
 #include "main/api_exec.h"
 #include "main/extensions.h"
-#include "util/imports.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
 #include "tnl/tnl.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 #include "i915_context.h"
 #include "main/api_exec.h"
 #include "main/framebuffer.h"
 #include "main/extensions.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 #include <stdio.h>
+#include <assert.h>
+
+#include "main/glheader.h"
 
 #include "i915_reg.h"
 #include "i915_debug.h"
-#include "util/imports.h"
 #include "main/glheader.h"
 
 static const char *opcodes[0x20] = {
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/renderbuffer.h"
 #include "main/framebuffer.h"
 
 
 /* Pull apart the vertex format registers and figure out how large a
- * vertex is supposed to be. 
+ * vertex is supposed to be.
  */
 static bool
 i915_check_vertex_size(struct intel_context *intel, GLuint expected)
    }
 
    /* work out list of buffers to emit */
-   
+
    /* Do this here as we may have flushed the batchbuffer above,
     * causing more state to be dirty!
     */
    }
 
    /* Combine all the dirty texture state into a single command to
-    * avoid lockups on I915 hardware. 
+    * avoid lockups on I915 hardware.
     */
    if (dirty & I915_UPLOAD_TEX_ALL) {
       int nr = 0;
    i915->current_vertex_size = 0;
 }
 
-static void 
+static void
 i915_assert_not_dirty( struct intel_context *intel )
 {
    struct i915_context *i915 = i915_context(&intel->ctx);
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
 #include "main/extensions.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
-#include "util/imports.h"
 #include "main/points.h"
 #include "main/renderbuffer.h"
 
     __DRIscreen *const screen = intel->intelScreen->driScrnPriv;
 
     if (intel->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
-      if (flushFront(screen) && 
+      if (flushFront(screen) &&
           driDrawable &&
           driDrawable->loaderPrivate) {
          flushFront(screen)(driDrawable, driDrawable->loaderPrivate);
    if (driContextPriv) {
       struct gl_context *ctx = &intel->ctx;
       struct gl_framebuffer *fb, *readFb;
-      
+
       if (driDrawPriv == NULL && driReadPriv == NULL) {
         fb = _mesa_get_incomplete_framebuffer();
         readFb = _mesa_get_incomplete_framebuffer();
 
 /**************************************************************************
- * 
+ *
  * Copyright 2006 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
 #include "main/enums.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/fbobject.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 /*
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
 
 /*                          Render pipeline stage                     */
 /**********************************************************************/
 
-/* Heuristic to choose between the two render paths:  
+/* Heuristic to choose between the two render paths:
  */
 static bool
 choose_render(struct intel_context *intel, struct vertex_buffer *VB)
 
  * performance bottleneck, though.
  */
 
-#include "util/imports.h"
-
 #include "intel_context.h"
 #include "intel_batchbuffer.h"
 #include "intel_reg.h"
 
  * (GL_NV_conditional_render, GL_ARB_conditional_render_inverted) on Gen7+.
  */
 
-#include "util/imports.h"
 #include "main/condrender.h"
 
 #include "brw_context.h"
 
 #include "main/fbobject.h"
 #include "main/extensions.h"
 #include "main/glthread.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/points.h"
 #include "main/version.h"
 
  * The driver implementation of the GL_APPLE_object_purgeable extension.
  */
 
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/bufferobj.h"
 
  *
  */
 
-#include "util/imports.h"
 #include "main/bufferobj.h"
 #include "main/varray.h"
 #include "vbo/vbo.h"
 
   */
 
 #include <pthread.h>
-#include "util/imports.h"
 #include "main/glspirv.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 
  * big we throw out all of the cache data and let it get regenerated.
  */
 
-#include "util/imports.h"
 #include "main/streaming-load-memcpy.h"
 #include "x86/common_x86_asm.h"
 #include "intel_batchbuffer.h"
 
  * appropriately synced with the stage of the pipeline for our extensions'
  * needs.
  */
-#include "util/imports.h"
 #include "main/queryobj.h"
 
 #include "brw_context.h"
 
 
 #include <libsync.h> /* Requires Android or libdrm-2.4.72 */
 
-#include "util/imports.h"
-
 #include "brw_context.h"
 #include "intel_batchbuffer.h"
 
 
  * GL_EXT_transform_feedback, and friends) on platforms that support
  * hardware contexts (Gen6+).
  */
-#include "util/imports.h"
-
 #include "brw_context.h"
 #include "brw_defines.h"
 #include "brw_state.h"
 
  *
  * Support for query buffer objects (GL_ARB_query_buffer_object) on Haswell+.
  */
-#include "util/imports.h"
-
 #include "brw_context.h"
 #include "brw_defines.h"
 #include "intel_batchbuffer.h"
 
  * This provides core GL buffer object functionality.
  */
 
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/streaming-load-memcpy.h"
 
  */
 
 #include "main/enums.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/fbobject.h"
 
  * Batched upload via BOs.
  */
 
-#include "util/imports.h"
 #include "main/macros.h"
 #include "brw_bufmgr.h"
 #include "brw_context.h"
 
 #ifndef __NOUVEAU_DRIVER_H__
 #define __NOUVEAU_DRIVER_H__
 
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/formats.h"
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/context.h"
 #include "util/simple_list.h"
 }
 
 /* Fire a section of the retained (indexed_verts) buffer as a regular
- * primtive.  
+ * primtive.
  */
 void r200EmitVbufPrim( r200ContextPtr rmesa,
                        GLuint primitive,
    BATCH_LOCALS(&rmesa->radeon);
 
    assert(!(primitive & R200_VF_PRIM_WALK_IND));
-   
+
    radeonEmitState(&rmesa->radeon);
-   
+
    radeon_print(RADEON_RENDER|RADEON_SWRENDER,RADEON_VERBOSE,
            "%s cmd_used/4: %d prim %x nr %d\n", __func__,
            rmesa->store.cmd_used/4, primitive, vertex_nr);
- 
+
    BEGIN_BATCH(3);
    OUT_BATCH_PACKET3_CLIP(R200_CP_CMD_3D_DRAW_VBUF_2, 0);
    OUT_BATCH(primitive | R200_VF_PRIM_WALK_LIST | R200_VF_COLOR_ORDER_RGBA |
                BEGIN_BATCH(8+2);
                OUT_BATCH_PACKET3_CLIP(R200_CP_CMD_3D_DRAW_INDX_2, 0);
                OUT_BATCH(R200_VF_PRIM_WALK_IND |
-                         R200_VF_COLOR_ORDER_RGBA | 
+                         R200_VF_COLOR_ORDER_RGBA |
                          ((vertex_count + 0) << 16) |
                          type);
 
    radeon_print(RADEON_RENDER, RADEON_VERBOSE, "%s %d prim %x\n", __func__, min_nr, primitive);
 
    assert((primitive & R200_VF_PRIM_WALK_IND));
-   
+
    radeonEmitState(&rmesa->radeon);
 
    radeonAllocDmaRegion(&rmesa->radeon, &rmesa->radeon.tcl.elt_dma_bo,
 
    radeon_bo_map(rmesa->radeon.tcl.elt_dma_bo, 1);
    retval = rmesa->radeon.tcl.elt_dma_bo->ptr + rmesa->radeon.tcl.elt_dma_offset;
-   
+
    assert(!rmesa->radeon.dma.flush);
    rmesa->radeon.glCtx.Driver.NeedFlush |= FLUSH_STORED_VERTICES;
    rmesa->radeon.dma.flush = r200FlushElts;
    uint32_t voffset;
    int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
    int i;
-   
+
    radeon_print(RADEON_RENDER, RADEON_VERBOSE,
            "%s: nr=%d, ofs=0x%08x\n",
            __func__, nr, offset);
                   (rmesa->radeon.tcl.aos[i].stride << 8) |
                   (rmesa->radeon.tcl.aos[i + 1].components << 16) |
                   (rmesa->radeon.tcl.aos[i + 1].stride << 24));
-        
+
         voffset =  rmesa->radeon.tcl.aos[i + 0].offset +
            offset * 4 * rmesa->radeon.tcl.aos[i + 0].stride;
         OUT_BATCH(voffset);
            offset * 4 * rmesa->radeon.tcl.aos[i + 1].stride;
         OUT_BATCH(voffset);
       }
-      
+
       if (nr & 1) {
         OUT_BATCH((rmesa->radeon.tcl.aos[nr - 1].components << 0) |
                   (rmesa->radeon.tcl.aos[nr - 1].stride << 8));
 
 #include "main/api_arrayelt.h"
 #include "main/api_exec.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/extensions.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
 
    /* Try and go straight to t&l
     */
-   &_r200_tcl_stage,  
+   &_r200_tcl_stage,
 
    /* Catch any t&l fallbacks
     */
    &_tnl_texture_transform_stage,
    &_tnl_point_attenuation_stage,
    &_tnl_vertex_program_stage,
-   /* Try again to go to tcl? 
+   /* Try again to go to tcl?
     *     - no good for asymmetric-twoside (do with multipass)
     *     - no good for asymmetric-unfilled (do with multipass)
     *     - good for material
     *
     * - worth it/not worth it?
     */
-                       
+
    /* Else do them here.
     */
 /*    &_r200_render_stage,  */ /* FIXME: bugs with ut2003 */
 
    ctx->Const.StripTextureBorder = GL_TRUE;
 
-   /* FIXME: When no memory manager is available we should set this 
+   /* FIXME: When no memory manager is available we should set this
     * to some reasonable value based on texture memory pool size */
    ctx->Const.MaxTextureSize = 2048;
    ctx->Const.Max3DTextureLevels = 9;
    r200InitState( rmesa );
    r200InitSwtcl( ctx );
 
-   rmesa->prefer_gart_client_texturing = 
+   rmesa->prefer_gart_client_texturing =
       (getenv("R200_GART_CLIENT_TEXTURES") != 0);
 
    tcl_mode = driQueryOptioni(&rmesa->radeon.optionCache, "tcl_mode");
 
 #include <errno.h>
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/context.h"
 #include "swrast/swrast.h"
 
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/state.h"
 
 #endif
 
 /* Emit any changed arrays to new GART memory, re-emit a packet to
- * update the arrays.  
+ * update the arrays.
  */
 void r200EmitArrays( struct gl_context *ctx, GLubyte *vimap_rev )
 {
 
  *   Keith Whitwell <keithw@vmware.com>
  *
  */
- 
-#include <errno.h> 
+
+#include <errno.h>
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 
 #include "r200_context.h"
 #include "r200_sanity.h"
 
 /* New (1.3) state mechanism.  3 commands (packet, scalar, vector) in
  * 1.3 cmdbuffers allow all previous state to be updated as well as
- * the tcl scalar and vector areas.  
+ * the tcl scalar and vector areas.
  */
-static struct { 
-   int start; 
-   int len; 
+static struct {
+   int start;
+   int len;
    const char *name;
 } packet[RADEON_MAX_STATE_PACKETS] = {
    { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
    { R200_SE_VTE_CNTL, 1, "R200_SE_VTE_CNTL" },
    { R200_SE_TCL_OUTPUT_VTX_COMP_SEL, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
    { R200_PP_TAM_DEBUG3, 1, "R200_PP_TAM_DEBUG3" },
-   { R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" }, 
-   { R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" }, 
-   { R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" }, 
-   { R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" }, 
-   { R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" }, 
-   { R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" }, 
-   { R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" }, 
-   { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" }, 
-   { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" }, 
+   { R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" },
+   { R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" },
+   { R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" },
+   { R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" },
+   { R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" },
+   { R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" },
+   { R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" },
+   { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" },
+   { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" },
    { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
    { R200_PP_CUBIC_FACES_0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */
    { R200_PP_CUBIC_OFFSET_F1_0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */
 #define TOUCHED 4
 
 struct reg {
-   int idx; 
+   int idx;
    struct reg_names *closest;
    int flags;
    union fi current;
 {
    static char tmp[80];
 
-   if (reg->idx == reg->closest->idx) 
+   if (reg->idx == reg->closest->idx)
       return reg->closest->name;
 
-   
+
    if (reg->flags & ISVEC) {
       if (reg->idx/4 != reg->closest->idx)
-        sprintf(tmp, "%s+%d[%d]", 
-                reg->closest->name, 
+        sprintf(tmp, "%s+%d[%d]",
+                reg->closest->name,
                 (reg->idx/4) - reg->closest->idx,
                 reg->idx%4);
       else
 {
    int changed = (reg->current.i != data);
    int ever_seen = find_or_add_value( reg, data );
-   
+
    if (VERBOSE || (NORMAL && (changed || !ever_seen)))
        fprintf(stderr, "   %s <-- 0x%x", get_reg_name(reg), data);
-       
+
    if (NORMAL) {
-      if (!ever_seen) 
+      if (!ever_seen)
         fprintf(stderr, " *** BRAND NEW VALUE");
-      else if (changed) 
-        fprintf(stderr, " *** CHANGED"); 
+      else if (changed)
+        fprintf(stderr, " *** CHANGED");
    }
-   
+
    reg->current.i = data;
 
    if (VERBOSE || (NORMAL && (changed || !ever_seen)))
 {
    int i;
 
-   for (i = 0 ; i < ARRAY_SIZE(regs) ; i++) 
+   for (i = 0 ; i < ARRAY_SIZE(regs) ; i++)
       print_reg( ®s[i] );
 
-   for (i = 0 ; i < ARRAY_SIZE(scalars) ; i++) 
+   for (i = 0 ; i < ARRAY_SIZE(scalars) ; i++)
       print_reg( &scalars[i] );
 
-   for (i = 0 ; i < ARRAY_SIZE(vectors) ; i++) 
+   for (i = 0 ; i < ARRAY_SIZE(vectors) ; i++)
       print_reg( &vectors[i] );
 }
 
 
 
-static int radeon_emit_packets( 
+static int radeon_emit_packets(
    drm_radeon_cmd_header_t header,
    drm_radeon_cmd_buffer_t *cmdbuf )
 {
    int sz = packet[id].len;
    int *data = (int *)cmdbuf->buf;
    int i;
-   
+
    if (sz * sizeof(int) > cmdbuf->bufsz) {
-      fprintf(stderr, "Packet overflows cmdbuf\n");      
+      fprintf(stderr, "Packet overflows cmdbuf\n");
       return -EINVAL;
    }
 
       return -EINVAL;
    }
 
-   
-   if (VERBOSE) 
+
+   if (VERBOSE)
       fprintf(stderr, "Packet 0 reg %s nr %d\n", packet[id].name, sz );
 
    for ( i = 0 ; i < sz ; i++) {
 }
 
 
-static int radeon_emit_scalars( 
+static int radeon_emit_scalars(
    drm_radeon_cmd_header_t header,
    drm_radeon_cmd_buffer_t *cmdbuf )
 {
         total_changed++;
       total++;
    }
-        
+
    cmdbuf->buf += sz * sizeof(int);
    cmdbuf->bufsz -= sz * sizeof(int);
    return 0;
 }
 
 
-static int radeon_emit_scalars2( 
+static int radeon_emit_scalars2(
    drm_radeon_cmd_header_t header,
    drm_radeon_cmd_buffer_t *cmdbuf )
 {
         total_changed++;
       total++;
    }
-        
+
    cmdbuf->buf += sz * sizeof(int);
    cmdbuf->bufsz -= sz * sizeof(int);
    return 0;
 /* Check: inf/nan/extreme-size?
  * Check: table start, end, nr, etc.
  */
-static int radeon_emit_vectors( 
+static int radeon_emit_vectors(
    drm_radeon_cmd_header_t header,
    drm_radeon_cmd_buffer_t *cmdbuf )
 {
         total_changed += 4;
       total += 4;
    }
-        
+
 
    cmdbuf->buf += sz * sizeof(int);
    cmdbuf->bufsz -= sz * sizeof(int);
    return 0;
 }
 
-static int radeon_emit_veclinear( 
+static int radeon_emit_veclinear(
    drm_radeon_cmd_header_t header,
    drm_radeon_cmd_buffer_t *cmdbuf )
 {
              (vfmt & R200_VTX_W1) ? "w1," : "",
              (vfmt & R200_VTX_N1) ? "n1," : "");
 
-   
+
       if (!find_or_add_value( &others[V_VTXFMT], vfmt ))
         fprintf(stderr, " *** NEW VALUE");
 
 static int print_prim_and_flags( int prim )
 {
    int numverts;
-   
+
    if (NORMAL)
       fprintf(stderr, "   %s(%x): %s%s%s%s%s%s\n",
              "prim flags",
              (prim & R200_VF_TCL_OUTPUT_VTX_ENABLE) ? "TCL_OUT_VTX," : "");
 
    numverts = prim>>16;
-   
+
    if (NORMAL)
       fprintf(stderr, "   prim: %s numverts %d\n", primname[prim&0xf], numverts);
 
    default:
       fprintf(stderr, "Bad primitive\n");
       return -1;
-   }   
+   }
    return 0;
 }
 
       break;
    case R200_CP_CMD_HOSTDATA_BLT:
       if (NORMAL)
-        fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n", 
+        fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
              cmdsz);
       break;
    case R200_CP_CMD_POLYLINE:
       break;
    case R200_CP_CMD_POLYSCANLINES:
       if (NORMAL)
-        fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n", 
+        fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
              cmdsz);
       break;
    case R200_CP_CMD_PAINT_MULTI:
       if (NORMAL)
-        fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n", 
+        fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
              cmdsz);
       break;
    case R200_CP_CMD_BITBLT_MULTI:
       if (NORMAL)
-        fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n", 
+        fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
              cmdsz);
       break;
    case R200_CP_CMD_TRANS_BITBLT:
       if (NORMAL)
-        fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n", 
+        fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
              cmdsz);
       break;
    case R200_CP_CMD_3D_DRAW_VBUF_2:
       if (NORMAL)
-        fprintf(stderr, "R200_CP_CMD_3D_DRAW_VBUF_2, %d dwords\n", 
+        fprintf(stderr, "R200_CP_CMD_3D_DRAW_VBUF_2, %d dwords\n",
              cmdsz);
       if (print_prim_and_flags(cmd[1]))
         return -EINVAL;
       break;
    case R200_CP_CMD_3D_DRAW_IMMD_2:
       if (NORMAL)
-        fprintf(stderr, "R200_CP_CMD_3D_DRAW_IMMD_2, %d dwords\n", 
+        fprintf(stderr, "R200_CP_CMD_3D_DRAW_IMMD_2, %d dwords\n",
              cmdsz);
       if (print_prim_and_flags(cmd[1]))
         return -EINVAL;
       break;
    case R200_CP_CMD_3D_DRAW_INDX_2:
       if (NORMAL)
-        fprintf(stderr, "R200_CP_CMD_3D_DRAW_INDX_2, %d dwords\n", 
+        fprintf(stderr, "R200_CP_CMD_3D_DRAW_INDX_2, %d dwords\n",
              cmdsz);
       if (print_prim_and_flags(cmd[1]))
         return -EINVAL;
       fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz);
       break;
    }
-      
+
    cmdbuf->buf += cmdsz * 4;
    cmdbuf->bufsz -= cmdsz * 4;
    return 0;
 /* Check cliprects for bounds, then pass on to above:
  */
 static int radeon_emit_packet3_cliprect( drm_radeon_cmd_buffer_t *cmdbuf )
-{   
+{
    drm_clip_rect_t *boxes = (drm_clip_rect_t *)cmdbuf->boxes;
    int i = 0;
 
    cmdbuf.nbox = nbox;
 
    while ( cmdbuf.bufsz >= sizeof(header) ) {
-               
+
       header.i = *(int *)cmdbuf.buf;
       cmdbuf.buf += sizeof(header);
       cmdbuf.bufsz -= sizeof(header);
 
       switch (header.header.cmd_type) {
-      case RADEON_CMD_PACKET: 
+      case RADEON_CMD_PACKET:
         if (radeon_emit_packets( header, &cmdbuf )) {
            fprintf(stderr,"radeon_emit_packets failed\n");
            return -EINVAL;
         break;
 
       default:
-        fprintf(stderr,"bad cmd_type %d at %p\n", 
+        fprintf(stderr,"bad cmd_type %d at %p\n",
                   header.header.cmd_type,
                   cmdbuf.buf - sizeof(header));
         return -EINVAL;
       if (n == 10) {
         fprintf(stderr, "Bufs %d Total emitted %d real changes %d (%.2f%%)\n",
                 bufs,
-                total, total_changed, 
+                total, total_changed,
                 ((float)total_changed/(float)total*100.0));
         fprintf(stderr, "Total emitted per buf: %.2f\n",
                 (float)total/(float)bufs);
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/enums.h"
 #include "main/light.h"
 #include "main/framebuffer.h"
 
 
 #include "main/errors.h"
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/enums.h"
 #include "main/api_arrayelt.h"
 #include "main/state.h"
 /* =============================================================
  * State initialization
  */
-static int cmdpkt( r200ContextPtr rmesa, int id ) 
+static int cmdpkt( r200ContextPtr rmesa, int id )
 {
    return CP_PACKET0(packet[id].start, packet[id].len - 1);
 }
 
-static int cmdvec( int offset, int stride, int count ) 
+static int cmdvec( int offset, int stride, int count )
 {
    drm_radeon_cmd_header_t h;
    h.i = 0;
 
 /* warning: the count here is divided by 4 compared to other cmds
    (so it doesn't exceed the char size)! */
-static int cmdveclinear( int offset, int count ) 
+static int cmdveclinear( int offset, int count )
 {
    drm_radeon_cmd_header_t h;
    h.i = 0;
    return h.i;
 }
 
-static int cmdscl( int offset, int stride, int count ) 
+static int cmdscl( int offset, int stride, int count )
 {
    drm_radeon_cmd_header_t h;
    h.i = 0;
    return h.i;
 }
 
-static int cmdscl2( int offset, int stride, int count ) 
+static int cmdscl2( int offset, int stride, int count )
 {
    drm_radeon_cmd_header_t h;
    h.i = 0;
 
    rmesa->hw.ptp.emit = ptp_emit;
 
-   rmesa->hw.mtl[0].cmd[MTL_CMD_0] = 
+   rmesa->hw.mtl[0].cmd[MTL_CMD_0] =
       cmdvec( R200_VS_MAT_0_EMISS, 1, 16 );
-   rmesa->hw.mtl[0].cmd[MTL_CMD_1] = 
+   rmesa->hw.mtl[0].cmd[MTL_CMD_1] =
       cmdscl2( R200_SS_MAT_0_SHININESS, 1, 1 );
    rmesa->hw.mtl[1].cmd[MTL_CMD_0] =
       cmdvec( R200_VS_MAT_1_EMISS, 1, 16 );
    rmesa->hw.vpp[1].cmd[VPP_CMD_0] =
       cmdveclinear( R200_PVS_PARAM1, 96 );
 
-   rmesa->hw.grd.cmd[GRD_CMD_0] = 
+   rmesa->hw.grd.cmd[GRD_CMD_0] =
       cmdscl( R200_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
-   rmesa->hw.fog.cmd[FOG_CMD_0] = 
+   rmesa->hw.fog.cmd[FOG_CMD_0] =
       cmdvec( R200_VS_FOG_PARAM_ADDR, 1, 4 );
-   rmesa->hw.glt.cmd[GLT_CMD_0] = 
+   rmesa->hw.glt.cmd[GLT_CMD_0] =
       cmdvec( R200_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
-   rmesa->hw.eye.cmd[EYE_CMD_0] = 
+   rmesa->hw.eye.cmd[EYE_CMD_0] =
       cmdvec( R200_VS_EYE_VECTOR_ADDR, 1, 4 );
 
-   rmesa->hw.mat[R200_MTX_MV].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_MV].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_0_MV, 1, 16);
-   rmesa->hw.mat[R200_MTX_IMV].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_IMV].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_1_INV_MV, 1, 16);
-   rmesa->hw.mat[R200_MTX_MVP].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_MVP].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_2_MVP, 1, 16);
-   rmesa->hw.mat[R200_MTX_TEX0].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_TEX0].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_3_TEX0, 1, 16);
-   rmesa->hw.mat[R200_MTX_TEX1].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_TEX1].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_4_TEX1, 1, 16);
-   rmesa->hw.mat[R200_MTX_TEX2].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_TEX2].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_5_TEX2, 1, 16);
-   rmesa->hw.mat[R200_MTX_TEX3].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_TEX3].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_6_TEX3, 1, 16);
-   rmesa->hw.mat[R200_MTX_TEX4].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_TEX4].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_7_TEX4, 1, 16);
-   rmesa->hw.mat[R200_MTX_TEX5].cmd[MAT_CMD_0] = 
+   rmesa->hw.mat[R200_MTX_TEX5].cmd[MAT_CMD_0] =
       cmdvec( R200_VS_MATRIX_8_TEX5, 1, 16);
 
    for (i = 0 ; i < 8; i++) {
-      rmesa->hw.lit[i].cmd[LIT_CMD_0] = 
+      rmesa->hw.lit[i].cmd[LIT_CMD_0] =
         cmdvec( R200_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
-      rmesa->hw.lit[i].cmd[LIT_CMD_1] = 
+      rmesa->hw.lit[i].cmd[LIT_CMD_1] =
         cmdscl( R200_SS_LIGHT_DCD_ADDR + i, 8, 7 );
    }
 
    for (i = 0 ; i < 6; i++) {
-      rmesa->hw.ucp[i].cmd[UCP_CMD_0] = 
+      rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
         cmdvec( R200_VS_UCP_ADDR + i, 1, 4 );
    }
 
    rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] =
       rmesa->radeon.radeonScreen->depthOffset + rmesa->radeon.radeonScreen->fbLocation;
 
-   rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] = 
+   rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
       ((rmesa->radeon.radeonScreen->depthPitch &
        R200_DEPTHPITCH_MASK) |
        R200_DEPTH_ENDIAN_NO_SWAP);
-   
+
    if (rmesa->using_hyperz)
       rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] |= R200_DEPTH_HYPERZ;
 
         rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_HIERARCHY_ENABLE;*/
    }
 
-   rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (R200_ANTI_ALIAS_NONE 
+   rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (R200_ANTI_ALIAS_NONE
                                     | R200_TEX_BLEND_0_ENABLE);
 
    switch ( driQueryOptioni( &rmesa->radeon.optionCache, "dither_mode" ) ) {
    else
       rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= rmesa->radeon.state.color.roundEnable;
 
-   rmesa->hw.prf.cmd[PRF_PP_TRI_PERF] = R200_TRI_CUTOFF_MASK - R200_TRI_CUTOFF_MASK * 
+   rmesa->hw.prf.cmd[PRF_PP_TRI_PERF] = R200_TRI_CUTOFF_MASK - R200_TRI_CUTOFF_MASK *
                        driQueryOptionf (&rmesa->radeon.optionCache,"texture_blend_quality");
    rmesa->hw.prf.cmd[PRF_PP_PERF_CNTL] = 0;
 
 
    rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] = ((1 << 16) | 0xffff);
 
-   rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] = 
+   rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
       ((0 << R200_LINE_CURRENT_PTR_SHIFT) |
        (1 << R200_LINE_CURRENT_COUNT_SHIFT));
 
    rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
 
-   rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] = 
+   rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
       ((0x00 << R200_STENCIL_REF_SHIFT) |
        (0xff << R200_STENCIL_MASK_SHIFT) |
        (0xff << R200_STENCIL_WRITEMASK_SHIFT));
 
    rmesa->hw.tam.cmd[TAM_DEBUG3] = 0;
 
-   rmesa->hw.msc.cmd[MSC_RE_MISC] = 
+   rmesa->hw.msc.cmd[MSC_RE_MISC] =
       ((0 << R200_STIPPLE_X_OFFSET_SHIFT) |
        (0 << R200_STIPPLE_Y_OFFSET_SHIFT) |
        R200_STIPPLE_BIG_BIT_ORDER);
    rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_3] =
       (0x0A << R200_VTX_TEX_4_ADDR__SHIFT) |
       (0x0B << R200_VTX_TEX_5_ADDR__SHIFT);
-  
+
 
    rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE]  = 0x00000000;
    rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = 0x00000000;
 
    for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
       rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL;
-      rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] = 
+      rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
          ((i << R200_TXFORMAT_ST_ROUTE_SHIFT) |  /* <-- note i */
           (2 << R200_TXFORMAT_WIDTH_SHIFT) |
           (2 << R200_TXFORMAT_HEIGHT_SHIFT));
    rmesa->hw.tf.cmd[TF_TFACTOR_4] = 0;
    rmesa->hw.tf.cmd[TF_TFACTOR_5] = 0;
 
-   rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] = 
-      (R200_VAP_TCL_ENABLE | 
+   rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] =
+      (R200_VAP_TCL_ENABLE |
        (0x9 << R200_VAP_VF_MAX_VTX_NUM__SHIFT));
 
-   rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] = 
+   rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] =
       (R200_VPORT_X_SCALE_ENA |
        R200_VPORT_Y_SCALE_ENA |
        R200_VPORT_Z_SCALE_ENA |
        R200_VPORT_Y_OFFSET_ENA |
        R200_VPORT_Z_OFFSET_ENA |
 /* FIXME: Turn on for tex rect only */
-       R200_VTX_ST_DENORMALIZED |  
-       R200_VTX_W0_FMT); 
+       R200_VTX_ST_DENORMALIZED |
+       R200_VTX_W0_FMT);
 
 
    rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = 0;
    rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = 0;
-   rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] = 
+   rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] =
       ((R200_VTX_Z0 | R200_VTX_W0 |
-       (R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT))); 
+       (R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT)));
    rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] = 0;
    rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = (R200_OUTPUT_XYZW);
    rmesa->hw.vtx.cmd[VTX_STATE_CNTL] = R200_VSC_UPDATE_USER_COLOR_0_ENABLE;
-                                                  
+
 
    /* Matrix selection */
-   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_0] = 
+   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_0] =
       (R200_MTX_MV << R200_MODELVIEW_0_SHIFT);
-   
-   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_1] = 
+
+   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_1] =
        (R200_MTX_IMV << R200_IT_MODELVIEW_0_SHIFT);
 
-   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_2] = 
+   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_2] =
       (R200_MTX_MVP << R200_MODELPROJECT_0_SHIFT);
 
-   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_3] = 
+   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_3] =
       ((R200_MTX_TEX0 << R200_TEXMAT_0_SHIFT) |
        (R200_MTX_TEX1 << R200_TEXMAT_1_SHIFT) |
        (R200_MTX_TEX2 << R200_TEXMAT_2_SHIFT) |
        (R200_MTX_TEX3 << R200_TEXMAT_3_SHIFT));
 
-   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_4] = 
+   rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_4] =
       ((R200_MTX_TEX4 << R200_TEXMAT_4_SHIFT) |
        (R200_MTX_TEX5 << R200_TEXMAT_5_SHIFT));
 
 
    /* General TCL state */
-   rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] = 
+   rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] =
       (R200_SPECULAR_LIGHTS |
        R200_DIFFUSE_SPECULAR_COMBINE |
        R200_LOCAL_LIGHT_VEC_GL |
        R200_LM0_SOURCE_MATERIAL_0 << R200_FRONT_SHININESS_SOURCE_SHIFT |
        R200_LM0_SOURCE_MATERIAL_1 << R200_BACK_SHININESS_SOURCE_SHIFT);
 
-   rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] = 
+   rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] =
       ((R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
        (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
        (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
        (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_EMISSIVE_SOURCE_SHIFT) |
        (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_AMBIENT_SOURCE_SHIFT) |
        (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_DIFFUSE_SOURCE_SHIFT) |
-       (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_SPECULAR_SOURCE_SHIFT)); 
+       (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_SPECULAR_SOURCE_SHIFT));
 
    rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_0] = 0; /* filled in via callbacks */
    rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_1] = 0;
    rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_2] = 0;
    rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_3] = 0;
-   
-   rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] = 
+
+   rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
       (R200_UCP_IN_CLIP_SPACE |
        R200_CULL_FRONT_IS_CCW);
 
    /* Texgen/Texmat state */
    rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] = 0x00ffffff;
-   rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_3] = 
+   rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_3] =
       ((0 << R200_TEXGEN_0_INPUT_TEX_SHIFT) |
        (1 << R200_TEXGEN_1_INPUT_TEX_SHIFT) |
        (2 << R200_TEXGEN_2_INPUT_TEX_SHIFT) |
        (3 << R200_TEXGEN_3_INPUT_TEX_SHIFT) |
        (4 << R200_TEXGEN_4_INPUT_TEX_SHIFT) |
-       (5 << R200_TEXGEN_5_INPUT_TEX_SHIFT)); 
-   rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = 0; 
-   rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] =  
+       (5 << R200_TEXGEN_5_INPUT_TEX_SHIFT));
+   rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = 0;
+   rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] =
       ((0 << R200_TEXGEN_0_INPUT_SHIFT) |
        (1 << R200_TEXGEN_1_INPUT_SHIFT) |
        (2 << R200_TEXGEN_2_INPUT_SHIFT) |
        (3 << R200_TEXGEN_3_INPUT_SHIFT) |
        (4 << R200_TEXGEN_4_INPUT_SHIFT) |
-       (5 << R200_TEXGEN_5_INPUT_SHIFT)); 
+       (5 << R200_TEXGEN_5_INPUT_SHIFT));
    rmesa->hw.tcg.cmd[TCG_TEX_CYL_WRAP_CTL] = 0;
 
 
       ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
       ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
                           &l->ConstantAttenuation );
-      ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION, 
+      ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
                           &l->LinearAttenuation );
-      ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION, 
+      ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
                           &l->QuadraticAttenuation );
       *(float *)&(rmesa->hw.lit[i].cmd[LIT_ATTEN_XXX]) = 0.0;
    }
 
-   ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT, 
+   ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
                             ctx->Light.Model.Ambient );
 
    TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
    ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
    ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
    ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL );
-   
+
    rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
    rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
    rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
 
 #include "main/mtypes.h"
 #include "main/enums.h"
 #include "main/image.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/state.h"
 
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "main/enums.h"
 #include "main/light.h"
    0,                          /* e quad strip */
    0,                          /* f polygon */
 };
-   
+
 
 #define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx)
 #define ELT_TYPE  GLushort
 
 #define ALLOC_ELTS(nr) r200AllocElts( rmesa, nr )
 
-static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr ) 
+static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr )
 {
    if (rmesa->radeon.dma.flush == r200FlushElts &&
        rmesa->tcl.elt_used + nr*2 < R200_ELT_BUF_SZ) {
  * discrete and there are no intervening state changes.  (Somewhat
  * duplicates changes to DrawArrays code)
  */
-static void r200EmitPrim( struct gl_context *ctx, 
-                         GLenum prim, 
-                         GLuint hwprim, 
-                         GLuint start, 
-                         GLuint count) 
+static void r200EmitPrim( struct gl_context *ctx,
+                         GLenum prim,
+                         GLuint hwprim,
+                         GLuint start,
+                         GLuint count)
 {
    r200ContextPtr rmesa = R200_CONTEXT( ctx );
    r200TclPrimitive( ctx, prim, hwprim );
-   
+
    //   fprintf(stderr,"Emit prim %d\n", rmesa->radeon.tcl.aos_count);
 
    r200EmitAOS( rmesa,
                rmesa->radeon.tcl.aos_count,
                start );
-   
+
    /* Why couldn't this packet have taken an offset param?
     */
    r200EmitVbufPrim( rmesa,
 /*                          External entrypoints                     */
 /**********************************************************************/
 
-void r200EmitPrimitive( struct gl_context *ctx, 
+void r200EmitPrimitive( struct gl_context *ctx,
                          GLuint first,
                          GLuint last,
                          GLuint flags )
    tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
 }
 
-void r200EmitEltPrimitive( struct gl_context *ctx, 
+void r200EmitEltPrimitive( struct gl_context *ctx,
                             GLuint first,
                             GLuint last,
                             GLuint flags )
    tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
 }
 
-void r200TclPrimitive( struct gl_context *ctx, 
+void r200TclPrimitive( struct gl_context *ctx,
                         GLenum prim,
                         int hw_prim )
 {
    struct vertex_buffer *VB = &tnl->vb;
    GLuint i;
    GLubyte *vimap_rev;
-/* use hw fixed order for simplicity, pos 0, weight 1, normal 2, fog 3, 
+/* use hw fixed order for simplicity, pos 0, weight 1, normal 2, fog 3,
    color0 - color3 4-7, texcoord0 - texcoord5 8-13, pos 1 14. Must not use
    more than 12 of those at the same time. */
    GLubyte map_rev_fixed[15] = {255, 255, 255, 255, 255, 255, 255, 255,
                            255, 255, 255, 255, 255, 255, 255};
 
 
-   /* TODO: separate this from the swtnl pipeline 
+   /* TODO: separate this from the swtnl pipeline
     */
    if (rmesa->radeon.TclFallback)
       return GL_TRUE;  /* fallback to software t&l */
 
 
 
-/* Initial state for tcl stage.  
+/* Initial state for tcl stage.
  */
 const struct tnl_pipeline_stage _r200_tcl_stage =
 {
    r200ChooseVertexState( ctx );
    r200ChooseRenderState( ctx );
 
-   _tnl_validate_shine_tables( ctx ); 
+   _tnl_validate_shine_tables( ctx );
 
-   tnl->Driver.NotifyMaterialChange = 
+   tnl->Driver.NotifyMaterialChange =
       _tnl_validate_shine_tables;
 
    radeonReleaseArrays( ctx, ~0 );
 
    tnl->Driver.NotifyMaterialChange = r200UpdateMaterial;
 
-   if ( rmesa->radeon.dma.flush )                      
-      rmesa->radeon.dma.flush( &rmesa->radeon.glCtx ); 
+   if ( rmesa->radeon.dma.flush )
+      rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
 
    rmesa->radeon.dma.flush = NULL;
-   
+
    R200_STATECHANGE( rmesa, vap );
    rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] |= R200_VAP_TCL_ENABLE;
    rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] &= ~R200_VAP_FORCE_W_TO_ONE;
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/image.h"
 
 /**
  * Set the texture wrap modes.
- * 
+ *
  * \param t Texture object whose wrap modes are to be set
  * \param swrap Wrap mode for the \a s texture coordinate
  * \param twrap Wrap mode for the \a t texture coordinate
 
 /**
  * Set the texture magnification and minification modes.
- * 
+ *
  * \param t Texture whose filter modes are to be set
  * \param minf Texture minification mode
  * \param magf Texture magnification mode
       const int fixed_one = R200_LOD_BIAS_FIXED_ONE;
 
       /* The R200's LOD bias is a signed 2's complement value with a
-       * range of -16.0 <= bias < 16.0. 
+       * range of -16.0 <= bias < 16.0.
        *
        * NOTE: Add a small bias to the bias for conform mipsel.c test.
        */
       bias = CLAMP( bias, min, 16.0 );
       b = ((int)(bias * fixed_one)
                + R200_LOD_BIAS_CORRECTION) & R200_LOD_BIAS_MASK;
-      
+
       if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] & R200_LOD_BIAS_MASK) != b ) {
         R200_STATECHANGE( rmesa, tex[unit] );
         rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] &= ~R200_LOD_BIAS_MASK;
            rmesa->hw.tex[i].dirty = GL_FALSE;
            rmesa->hw.cube[i].dirty = GL_FALSE;
         }
-      }      
+      }
    }
 
    radeon_miptree_unreference(&t->mt);
    _mesa_delete_texture_object(ctx, texObj);
 }
 
-/* Need:  
+/* Need:
  *  - Same GEN_MODE for all active bits
  *  - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
  *  - STRQ presumably all supported (matrix means incoming R values
  *    can end up in STQ, this has implications for vertex support,
  *    presumably ok if maos is used, though?)
- *  
+ *
  * Basically impossible to do this on the fly - just collect some
  * basic info & do the checks from ValidateState().
  */
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/state.h"
         break;
       case GL_ADD:
         color_combine = (R200_TXC_ARG_B_ZERO |
-                         R200_TXC_COMP_ARG_B | 
+                         R200_TXC_COMP_ARG_B |
                          R200_TXC_OP_MADD);
         R200_COLOR_ARG( 0, A );
         R200_COLOR_ARG( 1, C );
         break;
       case GL_SUBTRACT:
         color_combine = (R200_TXC_ARG_B_ZERO |
-                         R200_TXC_COMP_ARG_B | 
+                         R200_TXC_COMP_ARG_B |
                          R200_TXC_NEG_ARG_C |
                          R200_TXC_OP_MADD);
         R200_COLOR_ARG( 0, A );
            continue;
          }
         currentnext = j;
- 
+
         const GLuint numColorArgs = texUnit->_CurrentCombine->_NumArgsRGB;
         const GLuint numAlphaArgs = texUnit->_CurrentCombine->_NumArgsA;
         const GLboolean isdot3rgba = (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) ||
                                 R200_VOLUME_FILTER_MASK)
 
 
-static void disable_tex_obj_state( r200ContextPtr rmesa, 
+static void disable_tex_obj_state( r200ContextPtr rmesa,
                                   int unit )
 {
-   
+
    R200_STATECHANGE( rmesa, vtx );
    rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
 
 
 }
 
-static void set_texgen_matrix( r200ContextPtr rmesa, 
+static void set_texgen_matrix( r200ContextPtr rmesa,
                               GLuint unit,
                               const GLfloat *s_plane,
                               const GLfloat *t_plane,
 
 
 /*
- * Returns GL_FALSE if fallback required.  
+ * Returns GL_FALSE if fallback required.
  */
 static GLboolean r200_validate_texgen( struct gl_context *ctx, GLuint unit )
-{  
+{
    r200ContextPtr rmesa = R200_CONTEXT(ctx);
    const struct gl_fixedfunc_texture_unit *texUnit =
       &ctx->Texture.FixedFuncUnit[unit];
    tgcm = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] & ~(R200_TEXGEN_COMP_MASK <<
                                                    (unit * 4));
 
-   if (0) 
+   if (0)
       fprintf(stderr, "%s unit %d\n", __func__, unit);
 
    if (texUnit->TexGenEnabled & S_BIT) {
       }
 
       tgi |= R200_TEXGEN_INPUT_OBJ << inputshift;
-      set_texgen_matrix( rmesa, unit, 
+      set_texgen_matrix( rmesa, unit,
         (texUnit->TexGenEnabled & S_BIT) ? texUnit->GenS.ObjectPlane : I,
         (texUnit->TexGenEnabled & T_BIT) ? texUnit->GenT.ObjectPlane : I + 4,
         (texUnit->TexGenEnabled & R_BIT) ? texUnit->GenR.ObjectPlane : I + 8,
       tgi |= R200_TEXGEN_INPUT_EYE_REFLECT << inputshift;
       /* pretty weird, must only negate when lighting is enabled? */
       if (ctx->Light.Enabled)
-        set_texgen_matrix( rmesa, unit, 
+        set_texgen_matrix( rmesa, unit,
            (texUnit->TexGenEnabled & S_BIT) ? reflect : I,
            (texUnit->TexGenEnabled & T_BIT) ? reflect + 4 : I + 4,
            (texUnit->TexGenEnabled & R_BIT) ? reflect + 8 : I + 8,
    rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
    rmesa->TexGenCompSel |= R200_OUTPUT_TEX_0 << unit;
 
-   if (tgi != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] || 
+   if (tgi != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] ||
        tgcm != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2])
    {
       R200_STATECHANGE(rmesa, tcg);
 #else
         const struct tx_table *table = tx_table_be;
 #endif
-        
+
         t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK |
                             R200_TXFORMAT_ALPHA_IN_MAP);
         t->pp_txfilter &= ~R200_YUV_TO_RGB;
-        
+
         t->pp_txformat |= table[ firstImage->TexFormat ].format;
         t->pp_txfilter |= table[ firstImage->TexFormat ].filter;
 
                       R200_TXFORMAT_F5_HEIGHT_MASK);
    t->pp_txformat |= (((log2Width + extra_size) << R200_TXFORMAT_WIDTH_SHIFT) |
                      ((log2Height + extra_size)<< R200_TXFORMAT_HEIGHT_SHIFT));
-   
+
    t->tile_bits = 0;
-   
+
    t->pp_txformat_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK
                   | R200_MIN_MIP_LEVEL_MASK);
 
       set_re_cntl_d3d( ctx, unit, GL_TRUE );
    R200_STATECHANGE( rmesa, ctx );
    rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << unit;
-   
+
    R200_STATECHANGE( rmesa, vtx );
    rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
    rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] |= 4 << (unit * 3);
 
  *
  */
 
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/bufferobj.h"
 #include "util/u_memory.h"
 
 
 #include <errno.h>
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/fbobject.h"
 
 #include "main/api_exec.h"
 #include "main/context.h"
 #include "util/simple_list.h"
-#include "util/imports.h"
 #include "main/extensions.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
 
    /* Try and go straight to t&l
     */
-   &_radeon_tcl_stage,  
+   &_radeon_tcl_stage,
 
    /* Catch any t&l fallbacks
     */
 static void r100_vtbl_pre_emit_state(radeonContextPtr radeon)
 {
    r100ContextPtr rmesa = (r100ContextPtr)radeon;
-   
+
    /* r100 always needs to emit ZBS to avoid TCL lockups */
    rmesa->hw.zbs.dirty = 1;
    radeon->hw.is_dirty = 1;
 
    ctx->Const.StripTextureBorder = GL_TRUE;
 
-   /* FIXME: When no memory manager is available we should set this 
+   /* FIXME: When no memory manager is available we should set this
     * to some reasonable value based on texture memory pool size */
    ctx->Const.MaxTextureSize = 2048;
    ctx->Const.Max3DTextureLevels = 9;
     * fit in a single dma buffer for indexed rendering of quad strips,
     * etc.
     */
-   ctx->Const.MaxArrayLockSize = 
-      MIN2( ctx->Const.MaxArrayLockSize, 
-           RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE ); 
+   ctx->Const.MaxArrayLockSize =
+      MIN2( ctx->Const.MaxArrayLockSize,
+           RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE );
 
    rmesa->boxes = 0;
 
    radeonInitState( rmesa );
    radeonInitSwtcl( ctx );
 
-   _mesa_vector4f_alloc( &rmesa->tcl.ObjClean, 0, 
+   _mesa_vector4f_alloc( &rmesa->tcl.ObjClean, 0,
                         ctx->Const.MaxArrayLockSize, 32 );
 
    fthrottle_mode = driQueryOptioni(&rmesa->radeon.optionCache, "fthrottle_mode");
 
 /**************************************************************************
- * 
+ *
  * Copyright 2008 Red Hat 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
     }
 
     radeon_bo_unmap(rrb->bo);
-                  
+
     *out_map = rrb->map_buffer;
     *out_stride = rrb->map_pitch;
 }
        rrb->map_bo = radeon_bo_open(rmesa->radeonScreen->bom, 0,
                                    rrb->map_pitch * h, 4,
                                    RADEON_GEM_DOMAIN_GTT, 0);
-       
+
        ok = rmesa->vtbl.blit(ctx, rrb->bo, rrb->draw_offset,
                             rb->Format, rrb->pitch / rrb->cpp,
                             rb->Width, rb->Height,
        int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
 
        radeon_bo_map(rrb->bo, 1);
-       
+
        tiled_s8z24_map = rrb->bo->ptr;
 
        for (uint32_t pix_y = 0; pix_y < rrb->map_h; pix_y++) {
        int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
 
        radeon_bo_map(rrb->bo, 1);
-       
+
        tiled_z16_map = rrb->bo->ptr;
 
        for (uint32_t pix_y = 0; pix_y < rrb->map_h; pix_y++) {
 }
 
 static GLboolean
-radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb, 
+radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb,
                     struct gl_texture_image *texImage)
 {
        struct gl_renderbuffer *rb = &rrb->base.Base;
          radeon_image_target_renderbuffer_storage;
 }
 
-  
+
 void radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
                                struct radeon_bo *bo)
 {
 
 
 #include "c99_math.h"
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/context.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
 
 #include "swrast/swrast.h"
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "util/simple_list.h"
 
 #include "radeon_context.h"
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 
 
 
 /* Emit any changed arrays to new GART memory, re-emit a packet to
- * update the arrays.  
+ * update the arrays.
  */
 void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
 {
    GLuint vfmt = 0;
    GLuint count = VB->Count;
    GLuint vtx, unit;
-   
+
 #if 0
    if (RADEON_DEBUG & RADEON_VERTS)
       _tnl_print_vert_flags( __func__, inputs );
 #endif
 
    if (1) {
-      if (!rmesa->tcl.obj.buf) 
-       rcommon_emit_vector( ctx, 
+      if (!rmesa->tcl.obj.buf)
+       rcommon_emit_vector( ctx,
                             &(rmesa->tcl.aos[nr]),
                             (char *)VB->AttribPtr[_TNL_ATTRIB_POS]->data,
                             VB->AttribPtr[_TNL_ATTRIB_POS]->size,
       }
       nr++;
    }
-   
+
 
    if (inputs & VERT_BIT_NORMAL) {
       if (!rmesa->tcl.norm.buf)
-        rcommon_emit_vector( ctx, 
+        rcommon_emit_vector( ctx,
                              &(rmesa->tcl.aos[nr]),
                              (char *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data,
                              3,
 
    vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
          ~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1|RADEON_TCL_VTX_Q2));
-      
+
    for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
       if (inputs & VERT_BIT_TEX(unit)) {
         if (!rmesa->tcl.tex[unit].buf)
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/state.h"
 
 
 
 /***********************************************************************
- *                         Initialization 
+ *                         Initialization
  ***********************************************************************/
 
 
       rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
    }
 
-   for (i = 0 ; i < RADEON_TCL_MAX_SETUP ; i++) 
-      if ((setup_tab[i].vertex_format & req) == req) 
+   for (i = 0 ; i < RADEON_TCL_MAX_SETUP ; i++)
+      if ((setup_tab[i].vertex_format & req) == req)
         break;
 
    if (rmesa->tcl.vertex_format == setup_tab[i].vertex_format &&
    radeonAllocDmaRegion( &rmesa->radeon,
                         &rmesa->radeon.tcl.aos[0].bo,
                         &rmesa->radeon.tcl.aos[0].offset,
-                        VB->Count * setup_tab[i].vertex_size * 4, 
+                        VB->Count * setup_tab[i].vertex_size * 4,
                         4);
 
    /* The vertex code expects Obj to be clean to element 3.  To fix
     * this, add more vertex code (for obj-2, obj-3) or preferably move
-    * to maos.  
+    * to maos.
     */
    if (VB->AttribPtr[_TNL_ATTRIB_POS]->size < 3 ||
        (VB->AttribPtr[_TNL_ATTRIB_POS]->size == 3 &&
 
 
    radeon_bo_map(rmesa->radeon.tcl.aos[0].bo, 1);
-   setup_tab[i].emit( ctx, 0, VB->Count, 
+   setup_tab[i].emit( ctx, 0, VB->Count,
                      rmesa->radeon.tcl.aos[0].bo->ptr + rmesa->radeon.tcl.aos[0].offset);
    radeon_bo_unmap(rmesa->radeon.tcl.aos[0].bo);
    //   rmesa->radeon.tcl.aos[0].size = setup_tab[i].vertex_size;
 
 #include "radeon_queryobj.h"
 #include "radeon_debug.h"
 
-#include "util/imports.h"
+
 #include "main/queryobj.h"
 
 #include <inttypes.h>
 
  *
  */
 
-#include "util/imports.h"
 #include "util/simple_list.h"
 #include "radeon_common_context.h"
 
 
 
 #include <errno.h>
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
            MESA_FORMAT_X8R8G8B8_UNORM;
 #endif
     else
-        rgbFormat = 
+        rgbFormat =
 #if UTIL_ARCH_LITTLE_ENDIAN
            MESA_FORMAT_B8G8R8A8_UNORM;
 #else
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/enums.h"
 #include "main/light.h"
 #include "main/context.h"
 
 
 #include "main/errors.h"
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/api_arrayelt.h"
 
 #include "swrast/swrast.h"
 /* =============================================================
  * State initialization
  */
-static int cmdpkt( r100ContextPtr rmesa, int id ) 
+static int cmdpkt( r100ContextPtr rmesa, int id )
 {
    return CP_PACKET0(packet[id].start, packet[id].len - 1);
 }
 
-static int cmdvec( int offset, int stride, int count ) 
+static int cmdvec( int offset, int stride, int count )
 {
    drm_radeon_cmd_header_t h;
    h.i = 0;
    return h.i;
 }
 
-static int cmdscl( int offset, int stride, int count ) 
+static int cmdscl( int offset, int stride, int count )
 {
    drm_radeon_cmd_header_t h;
    h.i = 0;
    r100ContextPtr r100 = R100_CONTEXT(ctx);
    BATCH_LOCALS(&r100->radeon);
    uint32_t dwords = atom->check(ctx, atom);
-   
+
    BEGIN_BATCH(dwords);
    OUT_SCL(atom->cmd[0], atom->cmd+1);
    END_BATCH();
         depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z;
      atom->cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_DEPTH_FORMAT_MASK;
      atom->cmd[CTX_RB3D_ZSTENCILCNTL] |= depth_fmt;
-     
+
    }
 
    BEGIN_BATCH(dwords);
    rmesa->hw.cube[2].cmd[CUBE_CMD_1] = cmdpkt(rmesa, RADEON_EMIT_PP_CUBIC_OFFSETS_T2);
    rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_SE_ZBIAS_FACTOR);
    rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT);
-   rmesa->hw.mtl.cmd[MTL_CMD_0] = 
+   rmesa->hw.mtl.cmd[MTL_CMD_0] =
       cmdpkt(rmesa, RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED);
    rmesa->hw.txr[0].cmd[TXR_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_PP_TEX_SIZE_0);
    rmesa->hw.txr[1].cmd[TXR_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_PP_TEX_SIZE_1);
    rmesa->hw.txr[2].cmd[TXR_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_PP_TEX_SIZE_2);
-   rmesa->hw.grd.cmd[GRD_CMD_0] = 
+   rmesa->hw.grd.cmd[GRD_CMD_0] =
       cmdscl( RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
-   rmesa->hw.fog.cmd[FOG_CMD_0] = 
+   rmesa->hw.fog.cmd[FOG_CMD_0] =
       cmdvec( RADEON_VS_FOG_PARAM_ADDR, 1, 4 );
-   rmesa->hw.glt.cmd[GLT_CMD_0] = 
+   rmesa->hw.glt.cmd[GLT_CMD_0] =
       cmdvec( RADEON_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
-   rmesa->hw.eye.cmd[EYE_CMD_0] = 
+   rmesa->hw.eye.cmd[EYE_CMD_0] =
       cmdvec( RADEON_VS_EYE_VECTOR_ADDR, 1, 4 );
 
    for (i = 0 ; i < 6; i++) {
-      rmesa->hw.mat[i].cmd[MAT_CMD_0] = 
+      rmesa->hw.mat[i].cmd[MAT_CMD_0] =
         cmdvec( RADEON_VS_MATRIX_0_ADDR + i*4, 1, 16);
    }
 
    for (i = 0 ; i < 8; i++) {
-      rmesa->hw.lit[i].cmd[LIT_CMD_0] = 
+      rmesa->hw.lit[i].cmd[LIT_CMD_0] =
         cmdvec( RADEON_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
-      rmesa->hw.lit[i].cmd[LIT_CMD_1] = 
+      rmesa->hw.lit[i].cmd[LIT_CMD_1] =
         cmdscl( RADEON_SS_LIGHT_DCD_ADDR + i, 8, 6 );
    }
 
    for (i = 0 ; i < 6; i++) {
-      rmesa->hw.ucp[i].cmd[UCP_CMD_0] = 
+      rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
         cmdvec( RADEON_VS_UCP_ADDR + i, 1, 4 );
    }
 
 /*      rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_HIERARCHY_ENABLE;*/
         /* need this otherwise get lots of lockups with q3 ??? */
         rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_FORCE_Z_DIRTY;
-      } 
+      }
    }
 
    rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (RADEON_SCISSOR_ENABLE |
 
    rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] = ((1 << 16) | 0xffff);
 
-   rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] = 
+   rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
       ((0 << RADEON_LINE_CURRENT_PTR_SHIFT) |
        (1 << RADEON_LINE_CURRENT_COUNT_SHIFT));
 
    rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
 
-   rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] = 
+   rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
       ((0x00 << RADEON_STENCIL_REF_SHIFT) |
        (0xff << RADEON_STENCIL_MASK_SHIFT) |
        (0xff << RADEON_STENCIL_WRITEMASK_SHIFT));
    rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = RADEON_ROP_COPY;
    rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = 0xffffffff;
 
-   rmesa->hw.msc.cmd[MSC_RE_MISC] = 
+   rmesa->hw.msc.cmd[MSC_RE_MISC] =
       ((0 << RADEON_STIPPLE_X_OFFSET_SHIFT) |
        (0 << RADEON_STIPPLE_Y_OFFSET_SHIFT) |
        RADEON_STIPPLE_BIG_BIT_ORDER);
 
    for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
       rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL;
-      rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] = 
+      rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
          (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
           RADEON_TXFORMAT_PERSPECTIVE_ENABLE |
           (i << 24) | /* This is one of RADEON_TXFORMAT_ST_ROUTE_STQ[012] */
       //         rmesa->radeon.radeonScreen->texOffset[RADEON_LOCAL_TEX_HEAP];
 
       rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0;
-      rmesa->hw.tex[i].cmd[TEX_PP_TXCBLEND] =  
+      rmesa->hw.tex[i].cmd[TEX_PP_TXCBLEND] =
          (RADEON_COLOR_ARG_A_ZERO |
           RADEON_COLOR_ARG_B_ZERO |
           RADEON_COLOR_ARG_C_CURRENT_COLOR |
           RADEON_BLEND_CTL_ADD |
           RADEON_SCALE_1X |
           RADEON_CLAMP_TX);
-      rmesa->hw.tex[i].cmd[TEX_PP_TXABLEND] = 
+      rmesa->hw.tex[i].cmd[TEX_PP_TXABLEND] =
          (RADEON_ALPHA_ARG_A_ZERO |
           RADEON_ALPHA_ARG_B_ZERO |
           RADEON_ALPHA_ARG_C_CURRENT_ALPHA |
    /* Can only add ST1 at the time of doing some multitex but can keep
     * it after that.  Errors if DIFFUSE is missing.
     */
-   rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = 
+   rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] =
       (RADEON_TCL_VTX_Z0 |
        RADEON_TCL_VTX_W0 |
        RADEON_TCL_VTX_PK_DIFFUSE
         );     /* need to keep this uptodate */
-                                                  
+
    rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] =
       ( RADEON_TCL_COMPUTE_XYZW        |
        (RADEON_TCL_TEX_INPUT_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT) |
 
 
    /* XXX */
-   rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_0] = 
+   rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_0] =
       ((MODEL << RADEON_MODELVIEW_0_SHIFT) |
        (MODEL_IT << RADEON_IT_MODELVIEW_0_SHIFT));
 
-   rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_1] = 
+   rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_1] =
       ((MODEL_PROJ << RADEON_MODELPROJECT_0_SHIFT) |
        (TEXMAT_0 << RADEON_TEXMAT_0_SHIFT) |
        (TEXMAT_1 << RADEON_TEXMAT_1_SHIFT) |
        (TEXMAT_2 << RADEON_TEXMAT_2_SHIFT));
 
-   rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] = 
+   rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
       (RADEON_UCP_IN_CLIP_SPACE |
        RADEON_CULL_FRONT_IS_CCW);
 
-   rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = 0; 
+   rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = 0;
 
-   rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = 
+   rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] =
       (RADEON_SPECULAR_LIGHTS |
        RADEON_DIFFUSE_SPECULAR_COMBINE |
        RADEON_LOCAL_LIGHT_VEC_GL |
       ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
       ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
                           &l->ConstantAttenuation );
-      ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION, 
+      ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
                           &l->LinearAttenuation );
-      ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION, 
+      ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
                     &l->QuadraticAttenuation );
       *(float *)&(rmesa->hw.lit[i].cmd[LIT_ATTEN_XXX]) = 0.0;
    }
 
-   ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT, 
+   ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
                             ctx->Light.Model.Ambient );
 
    TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
    ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
    ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
    ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL );
-   
+
    rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
    rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
    rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
    radeon_init_query_stateobj(&rmesa->radeon, R100_QUERYOBJ_CMDSIZE);
    rmesa->radeon.query.queryobj.cmd[R100_QUERYOBJ_CMD_0] = CP_PACKET0(RADEON_RB3D_ZPASS_DATA, 0);
    rmesa->radeon.query.queryobj.cmd[R100_QUERYOBJ_DATA_0] = 0;
-     
+
    rmesa->radeon.hw.all_dirty = GL_TRUE;
 
    rcommonInitCmdBuf(&rmesa->radeon);
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/state.h"
 
 #define RADEON_MAX_TNL_VERTEX_SIZE (15 * sizeof(GLfloat))      /* for mesa _tnl stage */
 
 /***********************************************************************
- *                         Initialization 
+ *                         Initialization
  ***********************************************************************/
 
 #define EMIT_ATTR( ATTR, STYLE, F0 )                                   \
    if ( !rmesa->swtcl.needproj ||
         (index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX))) {
       /* for projtex */
-      EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F, 
+      EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F,
                 RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_Z | RADEON_CP_VC_FRMT_W0 );
       offset = 4;
    }
    else {
-      EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F, 
+      EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F,
                 RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_Z );
       offset = 3;
    }
 
    rmesa->swtcl.coloroffset = offset;
-#if MESA_LITTLE_ENDIAN 
-   EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA, 
+#if MESA_LITTLE_ENDIAN
+   EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA,
              RADEON_CP_VC_FRMT_PKCOLOR );
 #else
    EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ABGR,
    if (index_bitset &
        (BITFIELD64_BIT(_TNL_ATTRIB_COLOR1) | BITFIELD64_BIT(_TNL_ATTRIB_FOG))) {
 
-#if MESA_LITTLE_ENDIAN 
+#if MESA_LITTLE_ENDIAN
       if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) {
         rmesa->swtcl.specoffset = offset;
         EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB,
       rmesa->swtcl.vertex_format = fmt_0;
       rmesa->radeon.swtcl.vertex_size =
          _tnl_install_attrs( ctx,
-                             rmesa->radeon.swtcl.vertex_attrs, 
+                             rmesa->radeon.swtcl.vertex_attrs,
                              rmesa->radeon.swtcl.vertex_attr_count,
                              NULL, 0 );
       rmesa->radeon.swtcl.vertex_size /= 4;
    GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
                          ctx->Polygon.BackMode != GL_FILL);
    GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
-   
+
    se_coord_fmt &= ~(RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
                     RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
                     RADEON_VTX_W0_IS_NOT_1_OVER_W0);
     * bigger one.
     */
 
-   if ((0 == (tnl->render_inputs_bitset & 
+   if ((0 == (tnl->render_inputs_bitset &
         (BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX)
          | BITFIELD64_BIT(_TNL_ATTRIB_COLOR1))))
        || twosided
                        rmesa->radeon.swtcl.bo,
                        current_offset);
 
-                     
+
    radeonEmitVbufPrim( rmesa,
                       rmesa->swtcl.vertex_format,
                       rmesa->radeon.swtcl.hw_primitive,
 
       radeon_print(RADEON_SWRENDER, RADEON_NORMAL,
          "radeon_render.c: prim %s %d..%d\n",
-                _mesa_enum_to_string(prim & PRIM_MODE_MASK), 
+                _mesa_enum_to_string(prim & PRIM_MODE_MASK),
                 start, start+length);
 
       if (length)
    r100ContextPtr rmesa = R100_CONTEXT(ctx);           \
    const char *radeonverts = (char *)rmesa->radeon.swtcl.verts;
 #define VERT(x) (radeonVertex *)(radeonverts + ((x) * (vertsize) * sizeof(int)))
-#define VERTEX radeonVertex 
+#define VERTEX radeonVertex
 #undef TAG
 #define TAG(x) radeon_##x
 #include "tnl_dd/t_dd_triemit.h"
                          ctx->Polygon.BackMode != GL_FILL);
    GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
 
-   if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback) 
+   if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback)
       return;
 
    if (twosided)
                          ctx->Polygon.BackMode != GL_FILL);
 
    rmesa->radeon.swtcl.render_primitive = prim;
-   if (prim < GL_TRIANGLES || !unfilled) 
+   if (prim < GL_TRIANGLES || !unfilled)
       radeonRasterPrimitive( ctx, reduced_hw_prim[prim] );
 }
 
    tnl->Driver.Render.CopyPV = _tnl_copy_pv;
    tnl->Driver.Render.Interp = _tnl_interp;
 
-   _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, 
+   _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
                       RADEON_MAX_TNL_VERTEX_SIZE);
-   
+
    rmesa->radeon.swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf;
    rmesa->radeon.swtcl.RenderIndex = ~0;
    rmesa->radeon.swtcl.render_primitive = GL_TRIANGLES;
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/light.h"
 #include "main/enums.h"
    0,
    0,
 };
-   
+
 
 #define LOCAL_VARS r100ContextPtr rmesa = R100_CONTEXT(ctx)
 #define ELT_TYPE  GLushort
 
 #define ALLOC_ELTS(nr) radeonAllocElts( rmesa, nr )
 
-static GLushort *radeonAllocElts( r100ContextPtr rmesa, GLuint nr ) 
+static GLushort *radeonAllocElts( r100ContextPtr rmesa, GLuint nr )
 {
       if (rmesa->radeon.dma.flush)
         rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
  * discrete and there are no intervening state changes.  (Somewhat
  * duplicates changes to DrawArrays code)
  */
-static void radeonEmitPrim( struct gl_context *ctx, 
-                      GLenum prim, 
-                      GLuint hwprim, 
-                      GLuint start, 
-                      GLuint count)    
+static void radeonEmitPrim( struct gl_context *ctx,
+                      GLenum prim,
+                      GLuint hwprim,
+                      GLuint start,
+                      GLuint count)
 {
    r100ContextPtr rmesa = R100_CONTEXT( ctx );
    radeonTclPrimitive( ctx, prim, hwprim );
-   
+
    radeonEmitAOS( rmesa,
                  rmesa->radeon.tcl.aos_count,
                  start );
-   
+
    /* Why couldn't this packet have taken an offset param?
     */
    radeonEmitVbufPrim( rmesa,
 /*                          External entrypoints                     */
 /**********************************************************************/
 
-void radeonEmitPrimitive( struct gl_context *ctx, 
+void radeonEmitPrimitive( struct gl_context *ctx,
                          GLuint first,
                          GLuint last,
                          GLuint flags )
    tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
 }
 
-void radeonEmitEltPrimitive( struct gl_context *ctx, 
+void radeonEmitEltPrimitive( struct gl_context *ctx,
                             GLuint first,
                             GLuint last,
                             GLuint flags )
    tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
 }
 
-void radeonTclPrimitive( struct gl_context *ctx, 
+void radeonTclPrimitive( struct gl_context *ctx,
                         GLenum prim,
                         int hw_prim )
 {
    se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
    se_cntl &= ~RADEON_FLAT_SHADE_VTX_LAST;
 
-   if (prim == GL_POLYGON && ctx->Light.ShadeModel == GL_FLAT) 
+   if (prim == GL_POLYGON && ctx->Light.ShadeModel == GL_FLAT)
       se_cntl |= RADEON_FLAT_SHADE_VTX_0;
    else
       se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
    GLuint i;
    GLuint emit_end;
 
-   /* TODO: separate this from the swtnl pipeline 
+   /* TODO: separate this from the swtnl pipeline
     */
    if (rmesa->radeon.TclFallback)
       return GL_TRUE;  /* fallback to software t&l */
 
 
 
-/* Initial state for tcl stage.  
+/* Initial state for tcl stage.
  */
 const struct tnl_pipeline_stage _radeon_tcl_stage =
 {
    radeonChooseVertexState( ctx );
    radeonChooseRenderState( ctx );
 
-   _tnl_validate_shine_tables( ctx ); 
+   _tnl_validate_shine_tables( ctx );
 
-   tnl->Driver.NotifyMaterialChange = 
+   tnl->Driver.NotifyMaterialChange =
       _tnl_validate_shine_tables;
 
    radeonReleaseArrays( ctx, ~0 );
 
    se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
    se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
-        
+
    if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
       RADEON_STATECHANGE( rmesa, set );
       rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
 
    tnl->Driver.NotifyMaterialChange = radeonUpdateMaterial;
 
-   if ( rmesa->radeon.dma.flush )                      
-      rmesa->radeon.dma.flush( &rmesa->radeon.glCtx ); 
+   if ( rmesa->radeon.dma.flush )
+      rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
 
    rmesa->radeon.dma.flush = NULL;
    rmesa->swtcl.vertex_format = 0;
-   
-   //   if (rmesa->swtcl.indexed_verts.buf) 
-   //      radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, 
+
+   //   if (rmesa->swtcl.indexed_verts.buf)
+   //      radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
    //                        __func__ );
 
    if (RADEON_DEBUG & RADEON_FALLBACKS)
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/image.h"
 
 /**
  * Set the texture wrap modes.
- * 
+ *
  * \param t Texture object whose wrap modes are to be set
  * \param swrap Wrap mode for the \a s texture coordinate
  * \param twrap Wrap mode for the \a t texture coordinate
 
 /**
  * Set the texture magnification and minification modes.
- * 
+ *
  * \param t Texture whose filter modes are to be set
  * \param minf Texture minification mode
  * \param magf Texture magnification mode
    _mesa_delete_texture_object(ctx, texObj);
 }
 
-/* Need:  
+/* Need:
  *  - Same GEN_MODE for all active bits
  *  - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
  *  - STRQ presumably all supported (matrix means incoming R values
  *    can end up in STQ, this has implications for vertex support,
  *    presumably ok if maos is used, though?)
- *  
+ *
  * Basically impossible to do this on the fly - just collect some
  * basic info & do the checks from ValidateState().
  */
    t->pp_txfilter = RADEON_BORDER_MODE_OGL;
    t->pp_txformat = (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
                     RADEON_TXFORMAT_PERSPECTIVE_ENABLE);
-   
+
    radeonSetTexWrap( t, t->base.Sampler.WrapS, t->base.Sampler.WrapT );
    radeonSetTexMaxAnisotropy( t, t->base.Sampler.MaxAnisotropy );
    radeonSetTexFilter( t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter );
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/teximage.h"
            break;
         case GL_TEXTURE0:
         case GL_TEXTURE1:
-        case GL_TEXTURE2: {    
+        case GL_TEXTURE2: {
            GLuint txunit = srcAi - GL_TEXTURE0;
            if (texture_base_format(ctx->Texture.Unit[txunit]._Current) == GL_LUMINANCE)
               alpha_arg[i] = radeon_zero_alpha[op+1];
                               RADEON_TXFORMAT_NON_POWER2)
 
 
-static void disable_tex_obj_state( r100ContextPtr rmesa, 
+static void disable_tex_obj_state( r100ContextPtr rmesa,
                                   int unit )
 {
    RADEON_STATECHANGE( rmesa, tex[unit] );
    RADEON_STATECHANGE( rmesa, tcl );
    rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~(RADEON_ST_BIT(unit) |
                                             RADEON_Q_BIT(unit));
-   
+
    if (rmesa->radeon.TclFallback & (RADEON_TCL_FALLBACK_TEXGEN_0<<unit)) {
      TCL_FALLBACK( &rmesa->radeon.glCtx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), GL_FALSE);
      rmesa->recheck_texgen[unit] = GL_TRUE;
       rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<<unit);
       rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<<inputshift);
       rmesa->TexGenNeedNormals[unit] = 0;
-      rmesa->TexGenEnabled |= 
+      rmesa->TexGenEnabled |=
        (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
 
       if (tmp != rmesa->TexGenEnabled) {
 }
 
 
-static void set_texgen_matrix( r100ContextPtr rmesa, 
+static void set_texgen_matrix( r100ContextPtr rmesa,
                               GLuint unit,
                               const GLfloat *s_plane,
                               const GLfloat *t_plane,
 
         t->pp_txformat &= ~(RADEON_TXFORMAT_FORMAT_MASK |
                             RADEON_TXFORMAT_ALPHA_IN_MAP);
-        t->pp_txfilter &= ~RADEON_YUV_TO_RGB;   
-        
+        t->pp_txfilter &= ~RADEON_YUV_TO_RGB;
+
         t->pp_txformat |= table[ firstImage->TexFormat ].format;
         t->pp_txfilter |= table[ firstImage->TexFormat ].filter;
       } else {
 
    t->pp_txfilter &= ~RADEON_MAX_MIP_LEVEL_MASK;
    t->pp_txfilter |= (t->maxLod - t->minLod) << RADEON_MAX_MIP_LEVEL_SHIFT;
-       
+
    t->pp_txformat &= ~(RADEON_TXFORMAT_WIDTH_MASK |
                       RADEON_TXFORMAT_HEIGHT_MASK |
                       RADEON_TXFORMAT_CUBIC_MAP_ENABLE |
       return GL_FALSE;
 
    RADEON_STATECHANGE( rmesa, ctx );
-   rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= 
+   rmesa->hw.ctx.cmd[CTX_PP_CNTL] |=
      (RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit;
    RADEON_STATECHANGE( rmesa, tcl );
    rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_ST_BIT(unit);
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/mipmap.h"
                return GL_FALSE;
 
        teximage_assign_miptree(rmesa, texobj, timage);
-                               
+
        return GL_TRUE;
 }
 
        } else if (likely(mt)) {
                void *base;
                radeon_mipmap_level *lvl = &image->mt->levels[texImage->Level];
-                      
+
                radeon_bo_map(mt->bo, write);
                base = mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
 
 
        return  radeon_miptree_create(rmesa, texObj->Target,
                                      texImage->TexFormat, firstLevel, lastLevel - firstLevel + 1,
-                                     width, height, depth, 
+                                     width, height, depth,
                                      t->tile_bits);
-}                                   
+}
 
 #include "main/fbobject.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
-#include "util/imports.h"
 #include "main/renderbuffer.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
 
 #include "main/extensions.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mipmap.h"
 #include "main/mtypes.h"
             free(osmesa);
             return NULL;
          }
-       
+
         _swsetup_Wakeup( ctx );
 
          /* use default TCL pipeline */
 
    osmesa->DataType = type;
 
-   /* Set renderbuffer fields.  Set width/height = 0 to force 
+   /* Set renderbuffer fields.  Set width/height = 0 to force
     * osmesa_renderbuffer_storage() being called by _mesa_resize_framebuffer()
     */
    osmesa->srb->Buffer = buffer;
 
 #include "main/context.h"
 #include "main/config.h"
 #include "main/macros.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/version.h"
 #include "xfonts.h"
          stencil_size = 8;
       if (accumRedSize > 0 || accumGreenSize > 0 || accumBlueSize > 0 ||
           accumAlphaSize > 0) {
-         accumRedSize = 
-         accumGreenSize = 
+         accumRedSize =
+         accumGreenSize =
          accumBlueSize = default_accum_bits();
          accumAlphaSize = alpha_flag ? accumRedSize : 0;
       }
 
 #include <stdio.h>
 #include "glxheader.h"
 #include "main/context.h"
-#include "util/imports.h"
 #include "xfonts.h"
 
 
 
 #include "main/context.h"
 #include "main/extensions.h"
 #include "main/framebuffer.h"
-#include "util/imports.h"
 #include "main/macros.h"
 #include "main/renderbuffer.h"
 #include "main/teximage.h"
 
 #include "glxheader.h"
 #include "xmesaP.h"
 #include "main/errors.h"
-#include "util/imports.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
 #define XMESA_RENDERBUFFER 0x1234
 
 
-#if defined(USE_XSHM) 
+#if defined(USE_XSHM)
 static volatile int mesaXErrorFlag = 0;
 
 /**
    if (b->db_mode == BACK_XIMAGE) {
       /* Deallocate the old backxrb->ximage, if any */
       if (b->backxrb->ximage) {
-#if defined(USE_XSHM) 
+#if defined(USE_XSHM)
         if (b->shm) {
            XShmDetach(b->xm_visual->display, &b->shminfo);
            XDestroyImage(b->backxrb->ximage);
    if (fb->Visual.doubleBufferMode) {
       /* free back ximage/pixmap/shmregion */
       if (b->backxrb->ximage) {
-#if defined(USE_XSHM) 
+#if defined(USE_XSHM)
          if (b->shm) {
             XShmDetach( b->display, &b->shminfo );
             XDestroyImage( b->backxrb->ximage );
 
 #include "main/macros.h"
 #include "main/mipmap.h"
 #include "main/image.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/pbo.h"
 #include "main/texformat.h"
 
       if (swrast->NewState)
          _swrast_validate_derived( ctx );
-      
+
       if ((swrast->_RasterMask & ~CLIP_BIT) == 0) /* no blend, z-test, etc */ {
          struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
          if (rb) {
 
       if (swrast->NewState)
          _swrast_validate_derived( ctx );
-      
+
       if ((swrast->_RasterMask & ~CLIP_BIT) == 0) /* no blend, z-test, etc */ {
          struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
          if (rb) {
 
       if (swrast->NewState)
          _swrast_validate_derived( ctx );
-      
+
       if (unpack->BufferObj) {
          /* unpack from PBO */
          GLubyte *buf;
 
 
 #include <stdio.h>
 #include "c99_math.h"
-#include "util/imports.h"
 #include "main/mtypes.h"
 #include "glxheader.h"
 #include "xmesaP.h"
       return (swrast_tri_func) NULL;
    if (swrast->_RasterMask & MULTI_DRAW_BIT)
       return (swrast_tri_func) NULL;
-   if (ctx->Polygon.CullFlag && 
+   if (ctx->Polygon.CullFlag &&
        ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
       return (swrast_tri_func) NULL;
 
 
 #include "format_unpack.h"
 #include "format_pack.h"
 #include "framebuffer.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "state.h"
 #include "mtypes.h"
 
       for (j = 0; j < height; j++) {
          GLshort *row = (GLshort *) accMap;
-         
+
          for (i = 0; i < width; i++) {
             row[i * 4 + 0] = clearR;
             row[i * 4 + 1] = clearG;
 }
 
 
-void 
+void
 _mesa_init_accum( struct gl_context *ctx )
 {
    /* Accumulate buffer group */
 
 #include "api_arrayelt.h"
 #include "bufferobj.h"
 #include "context.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "mtypes.h"
 #include "main/dispatch.h"
 
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/hash.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/arbprogram.h"
  * \note Not compiled into display lists.
  * \note Called by both glDeleteProgramsNV and glDeleteProgramsARB.
  */
-void GLAPIENTRY 
+void GLAPIENTRY
 _mesa_DeleteProgramsARB(GLsizei n, const GLuint *ids)
 {
    GLint i;
 GLboolean GLAPIENTRY
 _mesa_IsProgramARB(GLuint id)
 {
-   struct gl_program *prog = NULL; 
+   struct gl_program *prog = NULL;
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
 
 _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index,
                                GLdouble x, GLdouble y, GLdouble z, GLdouble w)
 {
-   _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, 
+   _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
                                  (GLfloat) z, (GLfloat) w);
 }
 
 _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
                                 const GLdouble *params)
 {
-   _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0], 
-                                 (GLfloat) params[1], (GLfloat) params[2], 
+   _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0],
+                                 (GLfloat) params[1], (GLfloat) params[2],
                                  (GLfloat) params[3]);
 }
 
 
 
 void GLAPIENTRY
-_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, 
+_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index,
                                   GLfloat *params)
 {
    GLfloat *param;
                                  GLdouble x, GLdouble y,
                                  GLdouble z, GLdouble w)
 {
-   _mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, 
+   _mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
                                     (GLfloat) z, (GLfloat) w);
 }
 
 
 #include "glheader.h"
 #include "hash.h"
 #include "image.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "bufferobj.h"
 #include "arrayobj.h"
          if (ctx->Array._DrawVAO == obj)
             _mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
 
-         /* Unreference the array object. 
+         /* Unreference the array object.
           * If refcount hits zero, the object will be deleted.
           */
          _mesa_reference_vao(ctx, &obj, NULL);
 
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/hash.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/enums.h"
 #include "main/mtypes.h"
    return ret_str;
 }
 
-static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI", 
+static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI",
                            "AlphaFragmentOp1ATI", "AlphaFragmentOp2ATI", "AlphaFragmentOp3ATI" };
 
 static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst,
   char *op_name;
 
   op_name = atifs_ops[(arg_count-1)+(optype?3:0)];
-  
+
   fprintf(stderr, "%s(%s, %s", op_name, _mesa_enum_to_string(op),
              _mesa_enum_to_string(dst));
   if (optype == ATI_FRAGMENT_SHADER_COLOR_OP)
     fprintf(stderr, ", %d", dstMask);
-  
+
   fprintf(stderr, ", %s", create_dst_mod_str(dstMod));
-  
+
   fprintf(stderr, ", %s, %s, %d", _mesa_enum_to_string(arg1),
              _mesa_enum_to_string(arg1Rep), arg1Mod);
   if (arg_count>1)
 
  */
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "accum.h"
 #include "arrayobj.h"
 #include "attrib.h"
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "accum.h"
 #include "api_exec.h"
 #include "api_loopback.h"
 
 
 
 #include "errors.h"
-#include "util/imports.h"
+
 #include "extensions.h"
 #include "mtypes.h"
 #include "vbo/vbo.h"
 
 /** \name Visual-related functions */
 /*@{*/
- 
+
 extern struct gl_config *
 _mesa_create_visual( GLboolean dbFlag,
                      GLboolean stereoFlag,
 /**
  * Macro to assert that the API call was made outside the
  * glBegin()/glEnd() pair, with return value.
- * 
+ *
  * \param ctx GL context.
  * \param retval value to return in case the assertion fails.
  */
 /**
  * Macro to assert that the API call was made outside the
  * glBegin()/glEnd() pair.
- * 
+ *
  * \param ctx GL context.
  */
 #define ASSERT_OUTSIDE_BEGIN_END(ctx)                                  \
 
  */
 
 
-#include "util/imports.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
 #include "main/cpuinfo.h"
 
 
 
 #include "enums.h"
 #include "formats.h"
 #include "hash.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "debug.h"
 #include "get.h"
 /**
  * Initialize debugging variables from env vars.
  */
-void 
+void
 _mesa_init_debug( struct gl_context *ctx )
 {
    set_debug_flags(getenv("MESA_DEBUG"));
    char s[100];
    GLenum format, type;
 
-   if (rb->_BaseFormat == GL_RGB || 
+   if (rb->_BaseFormat == GL_RGB ||
        rb->_BaseFormat == GL_RGBA) {
       format = GL_RGBA;
       type = GL_UNSIGNED_BYTE;
 
 #include "context.h"
 #include "debug_output.h"
 #include "enums.h"
-#include "util/imports.h"
+
 #include "hash.h"
 #include "mtypes.h"
 #include "version.h"
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "depth.h"
 #include "enums.h"
 
 
 #include "c99_math.h"
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "api_arrayelt.h"
 #include "api_exec.h"
 #include "api_loopback.h"
 
 #include "arrayobj.h"
 #include "bufferobj.h"
 #include "context.h"
-#include "util/imports.h"
+
 #include "mtypes.h"
 #include "pipelineobj.h"
 #include "enums.h"
 
 #include "main/errors.h"
 #include "main/drawtex.h"
 #include "main/state.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 
 
 #include <stdio.h>
 #include "errors.h"
 #include "enums.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "debug_output.h"
 
       fflush(LogFile);
 
 #if defined(_WIN32)
-      /* stderr from windows applications without console is not usually 
-       * visible, so communicate with the debugger instead */ 
+      /* stderr from windows applications without console is not usually
+       * visible, so communicate with the debugger instead */
       {
          char buf[4096];
          snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
 
 #include "context.h"
 #include "depth.h"
 #include "fog.h"
-#include "util/imports.h"
+
 #include "light.h"
 #include "lines.h"
 #include "matrix.h"
 
 
 
 #include <stdio.h>
-#include "util/imports.h"
 #include "main/glheader.h"
 #include "execmem.h"
 #include "c11/threads.h"
 
    if (!exec_heap)
       exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE );
-   
+
    if (!exec_mem)
       exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,
                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 
    if (block)
       addr = exec_mem + block->ofs;
-   else 
+   else
       printf("_mesa_exec_malloc failed\n");
 
 bail:
    mtx_unlock(&exec_mutex);
-   
+
    return addr;
 }
 
- 
-void 
+
+void
 _mesa_exec_free(void *addr)
 {
    mtx_lock(&exec_mutex);
 
    if (exec_heap) {
       struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
-   
+
       if (block)
         u_mmFreeMem(block);
    }
    return malloc( size );
 }
 
- 
-void 
+
+void
 _mesa_exec_free(void *addr)
 {
    free(addr);
 
 #ifndef EXECMEM_H
 #define EXECMEM_H
 
+#include "glheader.h"
 
 extern void *
 _mesa_exec_malloc(unsigned size);
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "extensions.h"
 #include "macros.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, Inc.
  * All Rights Reserved.
  * Copyright 2009 VMware, Inc.  All Rights Reserved.
  * Copyright © 2010-2011 Intel Corporation
- * 
+ *
  * 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/samplerobj.h"
 #include "main/shaderobj.h"
            return GL_FALSE;
         }
         break;
-      default: 
+      default:
         return GL_FALSE;       /* impossible */
       }
    }
    case TEXENV_MODE_ADD_PRODUCTS_SIGNED_NV:
       return add(add(mul(src[0], src[1]), mul(src[2], src[3])),
                 new(p->mem_ctx) ir_constant(-0.5f));
-   default: 
+   default:
       assert(0);
       return src[0];
    }
    if (!key->unit[unit].enabled) {
       return get_source(p, TEXENV_SRC_PREVIOUS, 0);
    }
-   
+
    switch (key->unit[unit].ModeRGB) {
    case TEXENV_MODE_DOT3_RGB_EXT:
       alpha_shift = key->unit[unit].ScaleShiftA;
       alpha_shift = key->unit[unit].ScaleShiftA;
       break;
    }
-   
+
    /* If we'll do rgb/alpha shifting don't saturate in emit_combine().
     * We don't want to clamp twice.
     */
    case TEXENV_SRC_TEXTURE7:
       load_texture(p, src - TEXENV_SRC_TEXTURE0);
       break;
-      
+
    default:
       /* not a texture src - do nothing */
       break;
 
  */
 
 #include <stdint.h>
+#include <stdlib.h>
 
 #include "format_unpack.h"
 #include "format_utils.h"
 
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include <stdlib.h>
+
 #include "errors.h"
 #include "format_utils.h"
 #include "glformats.h"
 
 #define FORMAT_UTILS_H
 
 #include "formats.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "util/rounding.h"
 #include "util/half_float.h"
 
 
 
 #include "errors.h"
-#include "util/imports.h"
+
 #include "formats.h"
 #include "macros.h"
 #include "glformats.h"
 bool
 _mesa_is_format_signed(mesa_format format)
 {
-   if (format == MESA_FORMAT_R11G11B10_FLOAT || 
+   if (format == MESA_FORMAT_R11G11B10_FLOAT ||
        format == MESA_FORMAT_R9G9B9E5_FLOAT) {
       /* these packed float formats only store unsigned values */
       return false;
 
 
 #include <stdio.h>
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "blend.h"
 #include "buffers.h"
 #include "context.h"
 
 /**
  * \file hash.h
- * Generic hash table. 
+ * Generic hash table.
  */
 
 /*
 #define HASH_H
 
 
+#include <stdbool.h>
+#include <stdint.h>
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "c11/threads.h"
 
 /**
 
 #include "enums.h"
 #include "context.h"
 #include "hint.h"
-#include "util/imports.h"
+
 #include "mtypes.h"
 
 
 
 #include "colormac.h"
 #include "glformats.h"
 #include "image.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "mtypes.h"
 
  * \param width image width.
  * \param format pixel format.
  * \param type pixel data type.
- * 
+ *
  * \return the stride in bytes for the given parameters, or -1 if error
  */
 GLint
 
 #include "util/macros.h"
 #include "util/u_math.h"
 #include "util/rounding.h"
-#include "util/imports.h"
+#include "util/compiler.h"
 #include "main/glheader.h"
+#include "mesa_private.h"
 
 
 /**
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "enums.h"
 #include "macros.h"
  * Pop the current matrix stack.
  *
  * \sa glPopMatrix().
- * 
+ *
  * Flushes the vertices, verifies the current matrix stack is not empty, and
  * moves the stack head down.
  * Marks __struct gl_contextRec::NewState with the dirty stack flag.
  *
  * Calls _math_matrix_analyse() with the top-matrix of the projection matrix
  * stack, and recomputes user clip positions if necessary.
- * 
+ *
  * \note This routine references __struct gl_contextRec::Tranform attribute
  * values to compute userclip positions in clip space, but is only called on
  * _NEW_PROJECTION.  The _mesa_ClipPlane() function keeps these values up to
  * \param stack matrix stack.
  * \param maxDepth maximum stack depth.
  * \param dirtyFlag dirty flag.
- * 
+ *
  * Allocates an array of \p maxDepth elements for the matrix stack and calls
  * _math_matrix_ctr() for each element to initialize it.
  */
 
 /**
  * Free matrix stack.
- * 
+ *
  * \param stack matrix stack.
- * 
+ *
  * Calls _math_matrix_dtr() for each element of the matrix stack and
  * frees the array.
  */
 
 /**
  * Free the context matrix data.
- * 
+ *
  * \param ctx GL context.
  *
  * Frees each of the matrix stacks and the combined modelview-projection
 }
 
 
-/** 
+/**
  * Initialize the context transform attribute group.
  *
  * \param ctx GL context.
 
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice 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
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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.
+ */
+
+/**
+ * \file mesa_private.h
+ * Contains mesa internal values
+ *
+ */
+
+#ifndef MESA_PRIVATE_H
+#define MESA_PRIVATE_H
+
+#include "glheader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * Sometimes we treat floats as ints.  On x86 systems, moving a float
+ * as an int (thereby using integer registers instead of FP registers) is
+ * a performance win.  Typically, this can be done with ordinary casts.
+ * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
+ * these casts generate warnings.
+ * The following union typedef is used to solve that.
+ */
+typedef union { float f; int i; unsigned u; } fi_type;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MESA_PRIVATE_H */
 
  */
 
 #include "errors.h"
-#include "util/imports.h"
+
 #include "formats.h"
 #include "glformats.h"
 #include "mipmap.h"
       GLubyte *dstImgRow = imgDst;
 
       for (row = 0; row < dstHeightNB; row++) {
-         do_row_3D(datatype, comps, srcWidthNB, 
+         do_row_3D(datatype, comps, srcWidthNB,
                    srcImgARowA, srcImgARowB,
                    srcImgBRowA, srcImgBRowB,
                    dstWidthNB, dstImgRow);
 
 #include "glheader.h"
 #include "enums.h"
 #include "hash.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "bufferobj.h"
 #include "fbobject.h"
 
 #include "glheader.h"
 #include "enums.h"
 #include "image.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "mtypes.h"
 #include "pack.h"
 #include "pixeltransfer.h"
-#include "util/imports.h"
+
 #include "glformats.h"
 #include "format_utils.h"
 #include "format_pack.h"
                   for (i = 0; i < width; i++) {
                      if (*s & srcMask) {
                         *d |= dstMask;
-                     }      
+                     }
                      if (srcMask == 128) {
                         srcMask = 1;
                         s++;
                      }
                      else {
                         dstMask = dstMask >> 1;
-                     }      
+                     }
                   }
                }
             }
 
 #include "program/program.h"
 #include "program/prog_parameter.h"
 #include "util/ralloc.h"
+#include "util/bitscan.h"
 
 /**
  * Delete a pipeline object.
 
 #include "glheader.h"
 #include "macros.h"
 #include "pixeltransfer.h"
-#include "util/imports.h"
+
 #include "mtypes.h"
 #include "util/rounding.h"
 
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "image.h"
 #include "enums.h"
 
 #include "context.h"
 #include "enums.h"
 #include "hash.h"
-#include "util/imports.h"
+
 #include "queryobj.h"
 #include "mtypes.h"
 #include "util/u_memory.h"
 
  */
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "blend.h"
 #include "bufferobj.h"
 #include "context.h"
 
  */
 
 #include <stdbool.h>
+#include <string.h>
 #include "remap.h"
-#include "util/imports.h"
+
 #include "glapi/glapi.h"
 
 #define MAX_ENTRY_POINTS 16
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "fbobject.h"
 #include "formats.h"
 
  * Shared-context state
  */
 
-#include "util/imports.h"
+
 #include "mtypes.h"
 #include "hash.h"
 #include "atifragshader.h"
  *
  * \param ctx GL context.
  * \param shared shared state pointer.
- * 
+ *
  * Frees the display lists, the texture objects (calling the driver texture
  * deletion callback to free its private data) and the vertex programs, as well
  * as their hash tables.
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "macros.h"
 #include "stencil.h"
  * \param zfail action to take when stencil test passes, but depth test fails.
  * \param zpass action to take when stencil test passes and the depth test
  * passes (or depth testing is not enabled).
- * 
+ *
  * \sa glStencilOp().
- * 
+ *
  * Verifies the parameters and updates the respective fields in
  * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies
  * the driver via the dd_function_table::StencilOp callback.
 
 #ifndef STREAMING_LOAD_MEMCPY_H
 #define STREAMING_LOAD_MEMCPY_H
 
+#include <stdlib.h>
+
 void
 _mesa_streaming_load_memcpy(void *restrict dst, void *restrict src, size_t len);
 
 
 
 #include <inttypes.h>
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "macros.h"
 #include "get.h"
 
 
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "context.h"
 #include "formats.h"
 #include "mtypes.h"
 
 #include "macros.h"
 #include "util/half_float.h"
 #include <stdio.h>
+#include <cstdlib>  // for abort() on windows
 
 static bool VERBOSE_DECODE = false;
 static bool VERBOSE_WRITE = false;
 
 #include "glheader.h"
 #include "context.h"
 #include "mtypes.h"
-#include "util/imports.h"
+
 #include "pixelstore.h"
 #include "texcompress_cpal.h"
 #include "teximage.h"
 
 
 #include "errors.h"
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "image.h"
 #include "macros.h"
 #include "mipmap.h"
            }
            sumL += sum;
        }
-       
+
        nn_comp--;
    }
 
          lolo <<= 2;
          lolo |= texel;
       }
-      
+
       cc[0] = lolo;
    }
 
          }
          lolo = ~lolo;
       }
-      
+
       cc[0] = lolo;
    }
 
 
 /*
  * Copyright (C) 2011 Red Hat Inc.
- * 
+ *
  * block compression parts are:
  * Copyright (C) 2004  Roland Scheidegger   All Rights Reserved.
  *
  * GL_EXT_texture_compression_rgtc support.
  */
 
+#include <stdlib.h>
 
 #include "config.h"
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "image.h"
 #include "macros.h"
 #include "mipmap.h"
 
  */
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "image.h"
 #include "macros.h"
 #include "mtypes.h"
 
 #include "framebuffer.h"
 #include "hash.h"
 #include "image.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "mipmap.h"
 #include "multisample.h"
 
 #include "fbobject.h"
 #include "formats.h"
 #include "hash.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "shaderimage.h"
 #include "teximage.h"
 
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "teximage.h"
 #include "texobj.h"
                           GLsizei width)
 {
    GET_CURRENT_CONTEXT(ctx);
-   /* 'texture' must always be initialized, even if the call to 
+   /* 'texture' must always be initialized, even if the call to
     * glTextureStorage1DEXT will generate an error.
     */
    if (!_mesa_lookup_or_create_texture(ctx, target, texture, false, true,
                           GLsizei width, GLsizei height)
 {
    GET_CURRENT_CONTEXT(ctx);
-   /* 'texture' must always be initialized, even if the call to 
+   /* 'texture' must always be initialized, even if the call to
     * glTextureStorage2DEXT will generate an error.
     */
    if (!_mesa_lookup_or_create_texture(ctx, target, texture, false, true,
                           GLsizei width, GLsizei height, GLsizei depth)
 {
    GET_CURRENT_CONTEXT(ctx);
-   /* 'texture' must always be initialized, even if the call to 
+   /* 'texture' must always be initialized, even if the call to
     * glTextureStorage3DEXT will generate an error.
     */
    if (!_mesa_lookup_or_create_texture(ctx, target, texture, false, true,
 
 #include "mtypes.h"
 #include "pack.h"
 #include "pbo.h"
-#include "util/imports.h"
+
 #include "texcompress.h"
 #include "texcompress_fxt1.h"
 #include "texcompress_rgtc.h"
 
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "util/imports.h"
+
 #include "hash.h"
 #include "mtypes.h"
 #include "shaderimage.h"
 
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "util/imports.h"
+
 #include "macros.h"
 #include "teximage.h"
 #include "texobj.h"
 
 #include <inttypes.h>  /* for PRId64 macro */
 
 #include "glheader.h"
-#include "util/imports.h"
+
 #include "bufferobj.h"
 #include "context.h"
 #include "enable.h"
 
 
 #include <stdio.h>
 #include "context.h"
-#include "util/imports.h"
+
 #include "mtypes.h"
 #include "version.h"
 #include "git_sha1.h"
 
 #include "glheader.h"
 #include "api_arrayelt.h"
 #include "context.h"
-#include "util/imports.h"
+
 #include "mtypes.h"
 #include "vtxfmt.h"
 #include "eval.h"
 
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 
 #include "m_matrix.h"
 #include "m_xform.h"
 
   'main/histogram.h',
   'main/image.c',
   'main/image.h',
+  'main/mesa_private.h',
   'main/light.c',
   'main/light.h',
   'main/lines.c',
 
 
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/mtypes.h"
 #include "arbprogparse.h"
 
    ralloc_free(program->String);
 
-   /* Copy the relevant contents of the arb_program struct into the 
+   /* Copy the relevant contents of the arb_program struct into the
     * vertex_program struct.
     */
    program->String          = prog.String;
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "util/imports.h"
+
 #include "main/shaderobj.h"
 #include "program/prog_cache.h"
 #include "program/program.h"
 {
    struct cache_item *c, *next;
    GLuint i;
-   
+
    cache->last = NULL;
 
    for (i = 0; i < cache->size; i++) {
    if (cache->n_items > cache->size * 1.5) {
       if (cache->size < 1000)
         rehash(cache);
-      else 
+      else
         clear_cache(ctx, cache, GL_FALSE);
    }
 
 
 
 
 #include <stdio.h>
+#include <assert.h>
+
 #include "main/glheader.h"
-#include "util/imports.h"
 #include "prog_instruction.h"
 #include "prog_parameter.h"
 
 
  */
 
 
-#include "util/imports.h"
+
 #include "prog_noise.h"
 
 #define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) )
 
  * \author Brian Paul
  */
 
-
 #include "main/glheader.h"
 #include "main/macros.h"
 #include "util/u_memory.h"
 
 #ifndef PROG_PARAMETER_H
 #define PROG_PARAMETER_H
 
+#include <stdbool.h>
+#include <stdint.h>
 #include "prog_statevars.h"
 
 #include <string.h>
 
  * \author Ian Romanick <ian.d.romanick@intel.com>
  */
 
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "prog_parameter.h"
 #include "prog_parameter_layout.h"
         j = dst->NumParameters;
       } else {
         for (j = 0; j < dst->NumParameters; j++) {
-           if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes, 
+           if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes,
                       sizeof(curr->StateIndexes)) == 0) {
               return -1;
            }
            inst->Base.SrcReg[i].Index =
               _mesa_add_unnamed_constant(layout, v, p->Size, & swizzle);
 
-           inst->Base.SrcReg[i].Swizzle = 
+           inst->Base.SrcReg[i].Swizzle =
               _mesa_combine_swizzles(swizzle, inst->Base.SrcReg[i].Swizzle);
            break;
         }
 
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "prog_instruction.h"
 #include "prog_parameter.h"
 #include "prog_print.h"
 #include "prog_statevars.h"
+#include "util/bitscan.h"
 
 
 
           reg_string((gl_register_file) dstReg->File,
                      dstReg->Index, mode, dstReg->RelAddr, prog),
           _mesa_writemask_string(dstReg->WriteMask));
-   
+
 #if 0
    fprintf(f, "%s[%d]%s",
           _mesa_register_file_name((gl_register_file) dstReg->File),
 
 static void
 fprint_src_reg(FILE *f,
-               const struct prog_src_register *srcReg, 
+               const struct prog_src_register *srcReg,
                gl_prog_print_mode mode,
                const struct gl_program *prog)
 {
       const GLfloat *p = prog->LocalParams[i];
       fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
    }
-#endif 
+#endif
    _mesa_print_parameter_list(prog->Parameters);
 }
 
 
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/blend.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/fbobject.h"
          return;
 
       case STATE_NORMAL_SCALE:
-         ASSIGN_4V(value, 
-                   ctx->_ModelViewInvScale, 
-                   ctx->_ModelViewInvScale, 
-                   ctx->_ModelViewInvScale, 
+         ASSIGN_4V(value,
+                   ctx->_ModelViewInvScale,
+                   ctx->_ModelViewInvScale,
+                   ctx->_ModelViewInvScale,
                    1);
          return;
 
          }
          return;
 
-      /* XXX: make sure new tokens added here are also handled in the 
+      /* XXX: make sure new tokens added here are also handled in the
        * _mesa_program_state_flags() switch, below.
        */
       default:
 
 #include "compiler/nir/nir.h"
 #include "compiler/nir/nir_builder.h"
 #include "compiler/glsl/list.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "util/ralloc.h"
 
 
 #endif
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "program/prog_instruction.h"
 #include "program/prog_statevars.h"
 #include "program/symbol_table.h"
    const unsigned s = swiz_from_char(yytext[1]);
    yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s);
    yylval->swiz_mask.mask = mask_from_char(yytext[1]);
-   return MASK1; 
+   return MASK1;
 }
 
 "."[xyzw]{4}              {
 
 
 #include "main/errors.h"
 #include "main/mtypes.h"
-#include "util/imports.h"
+
 #include "program/program.h"
 #include "program/prog_parameter.h"
 #include "program/prog_parameter_layout.h"
 %token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE
 %token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT
 %token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT
-%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D 
+%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D
 %token VERTEX VTXATTRIB
 
 %token <string> IDENTIFIER USED_IDENTIFIER
 %type <integer> statePointProperty
 
 %type <integer> stateOptMatModifier stateMatModifier stateMatrixRowNum
-%type <integer> stateOptModMatNum stateModMatNum statePaletteMatNum 
+%type <integer> stateOptModMatNum stateModMatNum statePaletteMatNum
 %type <integer> stateProgramMatNum
 
 %type <integer> ambDiffSpecProperty
        }
        | paramSingleItemUse
        {
-           gl_register_file file = ($1.name != NULL) 
+           gl_register_file file = ($1.name != NULL)
              ? $1.param_binding_type
              : PROGRAM_CONSTANT;
            set_src_reg_swz(& $$, file, $1.param_binding_begin,
        |              { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
        ;
 
-optionalMask: MASK4 | MASK3 | MASK2 | MASK1 
+optionalMask: MASK4 | MASK3 | MASK2 | MASK1
        |              { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
        ;
 
        {
           if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) {
              free($2);
-             yyerror(& @4, state, 
+             yyerror(& @4, state,
                      "parameter array size and number of bindings must match");
              YYERROR;
           } else {
        }
        ;
 
-stateOptMatModifier: 
+stateOptMatModifier:
        {
           $$ = 0;
        }
        }
        ;
 
-stateMatModifier: INVERSE 
+stateMatModifier: INVERSE
        {
           $$ = STATE_MATRIX_INVERSE;
        }
-       | TRANSPOSE 
+       | TRANSPOSE
        {
           $$ = STATE_MATRIX_TRANSPOSE;
        }
 
 optResultColorType:
        {
-          $$ = 0; 
+          $$ = 0;
        }
        | PRIMARY
        {
 
 int
 initialize_symbol_from_state(struct gl_program *prog,
-                            struct asm_symbol *param_var, 
+                            struct asm_symbol *param_var,
                             const gl_state_index16 tokens[STATE_LENGTH])
 {
    int idx = -1;
 
 int
 initialize_symbol_from_param(struct gl_program *prog,
-                            struct asm_symbol *param_var, 
+                            struct asm_symbol *param_var,
                             const gl_state_index16 tokens[STATE_LENGTH])
 {
    int idx = -1;
  */
 int
 initialize_symbol_from_const(struct gl_program *prog,
-                            struct asm_symbol *param_var, 
+                            struct asm_symbol *param_var,
                             const struct asm_vector *vec,
                              GLboolean allowSwizzle)
 {
    }
 
 
-   
+
    /* Add one instruction to store the "END" instruction.
     */
    state->prog->arb.Instructions =
 
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "util/imports.h"
+
 #include "main/errors.h"
 #include "symbol_table.h"
-#include "../../util/hash_table.h"
+#include "util/hash_table.h"
 #include "util/u_string.h"
 
 struct symbol {
 struct scope_level {
     /** Link to next (inner) scope level. */
     struct scope_level *next;
-    
+
     /** Linked list of symbols with the same scope. */
     struct symbol *symbols;
 };
 
  *
  **************************************************************************/
 
-#include "util/imports.h"
+
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 #include "compiler/glsl/ir_uniform.h"
 
  *   Brian Paul
  */
 
-#include "util/imports.h"
+
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 #include "main/shaderapi.h"
 
  *
  **************************************************************************/
 
-#include "util/imports.h"
+
 #include "main/shaderimage.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 /**
  *   Brian Paul
  */
 
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "main/framebuffer.h"
 #include "main/state.h"
 
    st_reference_prog(st, &st->vp, stvp);
 
-   cso_set_vertex_shader_handle(st->cso_context, 
+   cso_set_vertex_shader_handle(st->cso_context,
                                 st->vp_variant->base.driver_shader);
 }
 
 
  *
  **************************************************************************/
 
-#include "util/imports.h"
+
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 #include "compiler/glsl/ir_uniform.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
  /*
   */
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/image.h"
 #include "main/bufferobj.h"
 #include "main/dlist.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
  /*
   *   Brian Paul
   */
 
-#include "util/imports.h"
+
 #include "main/image.h"
 #include "main/macros.h"
 
       /* get src/dst depth surfaces */
       struct st_renderbuffer *srcDepthRb =
          st_renderbuffer(readFB->Attachment[BUFFER_DEPTH].Renderbuffer);
-      struct st_renderbuffer *dstDepthRb = 
+      struct st_renderbuffer *dstDepthRb =
          st_renderbuffer(drawFB->Attachment[BUFFER_DEPTH].Renderbuffer);
       struct pipe_surface *dstDepthSurf =
          dstDepthRb ? dstDepthRb->surface : NULL;
 
 #include <inttypes.h>  /* for PRId64 macro */
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "main/arrayobj.h"
 #include "main/bufferobj.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2009 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
  */
 
 
-#include "util/imports.h"
+
 #include "main/context.h"
 
 #include "pipe/p_context.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
  /*
   */
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/image.h"
 #include "main/bufferobj.h"
 #include "main/blit.h"
       y = ctx->DrawBuffer->Height - y - height;
    }
 
-   if (format == GL_STENCIL_INDEX && 
+   if (format == GL_STENCIL_INDEX &&
        _mesa_is_format_packed_depth_stencil(strb->Base.Format)) {
       /* writing stencil to a combined depth+stencil buffer */
       usage = PIPE_TRANSFER_READ_WRITE;
 
 /**************************************************************************
- * 
+ *
  * Copyright 2008 VMware, Inc.
  * All Rights Reserved.
  *
 
 
 
-#include "util/imports.h"
+
 #include "main/image.h"
 #include "main/macros.h"
 #include "main/teximage.h"
 
  */
 
 
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 /**
  *   Brian Paul
  */
 
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/feedback.h"
 #include "main/varray.h"
 
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "main/externalobjects.h"
 
  **************************************************************************/
 
 #include "main/bufferobj.h"
-#include "util/imports.h"
+
 #include "main/framebuffer.h"
 
 #include "state_tracker/st_cb_msaa.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
  */
 
 
-#include "util/imports.h"
 #include "util/compiler.h"
 #include "main/context.h"
 #include "main/queryobj.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 /**
  */
 
 
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/arrayobj.h"
 #include "main/feedback.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 #include "main/bufferobj.h"
 #include "main/image.h"
 #include "main/pbo.h"
-#include "util/imports.h"
+
 #include "main/readpix.h"
 #include "main/enums.h"
 #include "main/framebuffer.h"
 
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "main/context.h"
 
 
 #include "main/format_utils.h"
 #include "main/glformats.h"
 #include "main/image.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/mipmap.h"
 #include "main/pack.h"
 
  */
 
 
-#include "util/imports.h"
+
 #include "main/context.h"
 
 #include "pipe/p_context.h"
 
  *
  **************************************************************************/
 
-#include "util/imports.h"
+
 #include "main/accum.h"
 #include "main/api_exec.h"
 #include "main/context.h"
 
 
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/image.h"
 #include "main/bufferobj.h"
 #include "main/macros.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
-#include "util/imports.h"
+
 #include "main/arrayobj.h"
 #include "main/image.h"
 #include "main/macros.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, Inc.
  * Copyright (c) 2008 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 #include "compiler/nir/nir.h"
 
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/spirv_extensions.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, Inc.
  * Copyright (c) 2008-2010 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
  * \author Brian Paul
  */
 
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/formats.h"
 
 /**************************************************************************
- * 
+ *
  * Copyright 2008 VMware, 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
  * 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.
  * 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.
- * 
+ *
  **************************************************************************/
 
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/mipmap.h"
 #include "main/teximage.h"
 
 
 /**************************************************************************
- * 
+ *
  * Copyright 2007 VMware, 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
  * 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.
  * 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:
 
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/hash.h"
 #include "main/mtypes.h"
 #include "program/prog_parameter.h"
 
 #include "main/condrender.h"
 #include "main/format_pack.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "s_context.h"
 
  */
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/bufferobj.h"
 #include "main/mtypes.h"
 #include "main/samplerobj.h"
                               _NEW_TEXTURE))
          _swrast_update_active_attribs(ctx);
 
-      if (swrast->NewState & (_NEW_FOG | 
+      if (swrast->NewState & (_NEW_FOG |
                               _NEW_PROGRAM |
                               _NEW_LIGHT |
                               _NEW_TEXTURE))
       swrast->Driver.SpanRenderStart( ctx );
    swrast->PointSpan.end = 0;
 }
- 
+
 void
 _swrast_render_finish( struct gl_context *ctx )
 {
 
 #include "main/macros.h"
 #include "main/blit.h"
 #include "main/pixeltransfer.h"
-#include "util/imports.h"
+
 
 #include "s_context.h"
 #include "s_depth.h"
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    struct gl_renderbuffer *rb;
-      
+
    if (!_mesa_check_conditional_render(ctx))
       return; /* don't copy */
 
 
 #include "main/format_unpack.h"
 #include "main/format_pack.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 
 #include "s_context.h"
 #include "s_depth.h"
    /* Convert floating point values in [0,1] to device Z coordinates in
     * [0, DepthMax].
     * ex: If the Z buffer has 24 bits, DepthMax = 0xffffff.
-    * 
+    *
     * XXX this all falls apart if we have 31 or more bits of Z because
     * the triangle rasterization code produces unsigned Z values.  Negative
     * vertex Z values come out as large fragment Z uints.
 
 #include "main/format_utils.h"
 #include "main/glformats.h"
 #include "main/image.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/pack.h"
 #include "main/pbo.h"
          return;
       }
    }
-   
+
    depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
    stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
    assert(depthRb);
 
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 
 #include "s_context.h"
 
 
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/fbobject.h"
 #include "main/formats.h"
 
    assert(srb->Map);
 }
- 
+
 
 static void
 unmap_attachment(struct gl_context *ctx,
       }
    }
 }
- 
- 
+
+
 /**
  * Unmap renderbuffers after rendering.
  */
 
 #include "main/format_pack.h"
 #include "main/format_unpack.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/image.h"
 #include "main/samplerobj.h"
 #include "main/state.h"
       if (ctx->DrawBuffer->Visual.depthBits <= 16)
          span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F);
       else {
-         GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; 
+         GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax;
          tmpf = MIN2(tmpf, depthMax);
          span->z = (GLint)tmpf;
       }
 
    if (ctx->DrawBuffer->Visual.depthBits <= 16) {
       GLfixed zval = span->z;
-      GLuint *z = span->array->z; 
+      GLuint *z = span->array->z;
       for (i = 0; i < n; i++) {
          z[i] = FixedToInt(zval);
          zval += span->zStep;
    {
       const GLuint numBuffers = fb->_NumColorDrawBuffers;
       const struct gl_program *fp = ctx->FragmentProgram._Current;
-      const GLboolean multiFragOutputs = 
+      const GLboolean multiFragOutputs =
          _swrast_use_fragment_program(ctx)
          && fp->info.outputs_written >= (1 << FRAG_RESULT_DATA0);
       /* Save srcColorType because convert_color_type() can change it */
 
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/format_pack.h"
 #include "main/format_unpack.h"
 #include "main/stencil.h"
       put_s8_values(ctx, rb, count, span->array->x, span->array->y,
                     stencilBuf);
    }
-   
+
    span->writeAll = GL_FALSE;
-   
+
    return GL_TRUE;  /* one or more fragments passed both tests */
 }
 
 
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/pixeltransfer.h"
 #include "main/samplerobj.h"
  * \param unit         the texture combiner unit
  * \param primary_rgba incoming fragment color array
  * \param texelBuffer  pointer to texel colors for all texture units
- * 
+ *
  * \param span         two fields are used in this function:
  *                       span->end: number of fragments to process
  *                       span->array->rgba: incoming/result fragment colors
 
 #include "c99_math.h"
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/samplerobj.h"
 #include "main/teximage.h"
  * Optimized 2-D texture sampling:
  *    S and T wrap mode == GL_REPEAT
  *    GL_NEAREST min/mag filter
- *    No border, 
+ *    No border,
  *    RowStride == Width,
  *    Format = GL_RGB
  */
    GLfloat uy = dudy * scaling;
    GLfloat vy = dvdy * scaling;
 
-   /* compute ellipse coefficients to bound the region: 
+   /* compute ellipse coefficients to bound the region:
     * A*x*x + B*x*y + C*y*y = F.
     */
    GLfloat A = vx*vx+vy*vy+1;
    }
    if (u >= maxUnit)
       u = 0; /* not found, use 1st one; should never happen */
-   
+
    return u;
 }
 
    const struct swrast_texture_image *swImg = swrast_texture_image_const(tImg);
    const GLfloat maxEccentricity =
       samp->MaxAnisotropy * samp->MaxAnisotropy;
-   
+
    /* re-calculate the lambda values so that they are usable with anisotropic
     * filtering
     */
    /* based on interpolate_texcoords(struct gl_context *ctx, SWspan *span)
     * in swrast/s_span.c
     */
-   
+
    /* find the texture unit index by looking up the current texture object
     * from the context list of available texture objects.
     */
       || (samp->MinLod != -1000.0F || samp->MaxLod != 1000.0F);
 
    GLuint i;
-   
+
    /* on first access create the lookup table containing the filter weights. */
    if (!weightLut) {
       create_filter_table();
 
    for (i = 0; i < n; i++) {
       const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
-      
+
       GLfloat dudx = texW * ((s + dsdx) / (q + dqdx) - s * invQ);
       GLfloat dvdx = texH * ((t + dtdx) / (q + dqdx) - t * invQ);
       GLfloat dudy = texW * ((s + dsdy) / (q + dqdy) - s * invQ);
       GLfloat dvdy = texH * ((t + dtdy) / (q + dqdy) - t * invQ);
-      
-      /* note: instead of working with Px and Py, we will use the 
+
+      /* note: instead of working with Px and Py, we will use the
        * squared length instead, to avoid sqrt.
        */
       GLfloat Px2 = dudx * dudx + dvdx * dvdx;
       s += dsdx;
       t += dtdx;
       q += dqdx;
-      
+
       if (Px2 < Py2) {
          Pmax2 = Py2;
          Pmin2 = Px2;
          Pmax2 = Px2;
          Pmin2 = Py2;
       }
-      
+
       /* if the eccentricity of the ellipse is too big, scale up the shorter
        * of the two vectors to limit the maximum amount of work per pixel
        */
             Pmin2 *= s; */
          Pmin2 = Pmax2 / maxEccentricity;
       }
-      
+
       /* note: we need to have Pmin=sqrt(Pmin2) here, but we can avoid
        * this since 0.5*log(x) = log(sqrt(x))
        */
       lod = 0.5f * util_fast_log2(Pmin2);
-      
+
       if (adjustLOD) {
          /* from swrast/s_texcombine.c _swrast_texture_span */
          if (texUnit->LodBias + samp->LodBias != 0.0F) {
             }
          }
       }
-      
+
       /* If the ellipse covers the whole image, we can
        * simply return the average of the whole image.
        */
       }
    }
 
-   { 
+   {
       const float ima = 1.0F / ma;
       newCoord[0] = ( sc * ima + 1.0F ) * 0.5F;
       newCoord[1] = ( tc * ima + 1.0F ) * 0.5F;
       else {
         swImg->FetchTexel(swImg, i1, j1, array, t11);
       }
-      
+
       /* trilinear interpolation of samples */
       lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11);
    }
       case GL_LINEAR_MIPMAP_LINEAR:
          sample_2d_array_linear_mipmap_linear(ctx, samp, tObj, m,
                                               texcoords + minStart,
-                                              lambda + minStart, 
+                                              lambda + minStart,
                                               rgba + minStart);
          break;
       default:
                                                 lambda + minStart, rgba + minStart);
          break;
       case GL_LINEAR_MIPMAP_NEAREST:
-         sample_1d_array_linear_mipmap_nearest(ctx, samp, tObj, m, 
+         sample_1d_array_linear_mipmap_nearest(ctx, samp, tObj, m,
                                                texcoords + minStart,
                                                lambda + minStart,
                                                rgba + minStart);
                                                lambda + minStart, rgba + minStart);
          break;
       case GL_LINEAR_MIPMAP_LINEAR:
-         sample_1d_array_linear_mipmap_linear(ctx, samp, tObj, m, 
+         sample_1d_array_linear_mipmap_linear(ctx, samp, tObj, m,
                                               texcoords + minStart,
-                                              lambda + minStart, 
+                                              lambda + minStart,
                                               rgba + minStart);
          break;
       default:
 
          nearest_texcoord(samp, tObj, level, texcoords[i], &col, &row, &slice);
 
-         if (col >= 0 && row >= 0 && col < width && row < height && 
+         if (col >= 0 && row >= 0 && col < width && row < height &&
              slice >= 0 && slice < depth) {
             swImg->FetchTexel(swImg, col, row, slice, &depthSample);
          }
 
 #include "main/teximage.h"
 #include "main/texobj.h"
 #include "util/u_memory.h"
+#include "util/u_math.h"
 #include "swrast/swrast.h"
 #include "swrast/s_context.h"
 
 
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/state.h"
       }
       break;
    }
-   
+
    assert(span->arrayMask & SPAN_RGBA);
    _swrast_write_rgba_span(ctx, span);
 
 
 #include "main/errors.h"
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/format_pack.h"
 
 #include "s_context.h"
 
  */
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/state.h"
 #include "tnl/tnl.h"
    swsetup->NewState = ~0;
    _swsetup_trifuncs_init( ctx );
 
-   _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, 
+   _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
                       sizeof(SWvertex) );
 
 
 /**
  * Populate a swrast SWvertex from an attrib-style vertex.
  */
-void 
+void
 _swsetup_Translate( struct gl_context *ctx, const void *vertex, SWvertex *dest )
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
 
 
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
       tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_FOG);
    }
 
-   if (ctx->Polygon.FrontMode != GL_FILL || 
+   if (ctx->Polygon.FrontMode != GL_FILL ||
        ctx->Polygon.BackMode != GL_FILL)
       tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_EDGEFLAG);
 
 
 #if 0
    if (ctx->Light.ColorMaterialEnabled) {
-      _mesa_update_color_material( ctx, 
+      _mesa_update_color_material( ctx,
                                   ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
    }
 #endif
 
 #define _T_CONTEXT_H
 
 #include "main/glheader.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "math/m_vector.h"
     * such as backface color or eye-space coordinates, they are stored
     * here.
     */
-   GLuint      *Elts;                          
+   GLuint      *Elts;
    GLvector4f  *EyePtr;                                /* _TNL_BIT_POS */
    GLvector4f  *ClipPtr;                       /* _TNL_BIT_POS */
    GLvector4f  *NdcPtr;                         /* _TNL_BIT_POS */
    GLvector4f  *BackfaceColorPtr;
    GLvector4f  *BackfaceSecondaryColorPtr;
 
-   const struct _mesa_prim  *Primitive;                      
-   GLuint      PrimitiveCount;       
+   const struct _mesa_prim  *Primitive;
+   GLuint      PrimitiveCount;
 
    /* Inputs to the vertex program stage */
    GLvector4f *AttribPtr[_TNL_ATTRIB_MAX];
 
 
 /** Contains the array of all pipeline stages.
- * The default values are defined at the end of t_pipeline.c 
+ * The default values are defined at the end of t_pipeline.c
  */
 struct tnl_pipeline {
-   
+
    GLuint last_attrib_stride[_TNL_ATTRIB_MAX];
    GLuint last_attrib_size[_TNL_ATTRIB_MAX];
    GLuint input_changes;
 struct tnl_clipspace;
 struct tnl_clipspace_attr;
 
-typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a, 
-                                 GLfloat *out, 
+typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a,
+                                 GLfloat *out,
                                  const GLubyte *v );
 
-typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a, 
-                                GLubyte *v, 
+typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a,
+                                GLubyte *v,
                                 const GLfloat *in );
 
-typedef void (*tnl_emit_func)( struct gl_context *ctx, 
-                              GLuint count, 
+typedef void (*tnl_emit_func)( struct gl_context *ctx,
+                              GLuint count,
                               GLubyte *dest );
 
 
 struct tnl_clipspace
 {
    GLboolean need_extras;
-   
+
    GLuint new_inputs;
 
    GLubyte *vertex_buf;
    /* Parameters and constants for codegen:
     */
    GLboolean need_viewport;
-   GLfloat vp_scale[4];                
+   GLfloat vp_scale[4];
    GLfloat vp_xlate[4];
    GLfloat chan_scale[4];
    GLfloat identity[4];
 
    struct tnl_clipspace_fastpath *fastpath;
-   
+
    void (*codegen_emit)( struct gl_context *ctx );
 };
 
    void (*RunPipeline)(struct gl_context *ctx);
    /* Replaces PipelineStart/PipelineFinish -- intended to allow
     * drivers to wrap _tnl_run_pipeline() with code to validate state
-    * and grab/release hardware locks.  
+    * and grab/release hardware locks.
     */
 
    void (*NotifyMaterialChange)(struct gl_context *ctx);
        *
        * This function is called only from _tnl_render_stage in tnl/t_render.c.
        */
-      
+
 
       GLboolean (*Multipass)( struct gl_context *ctx, GLuint passno );
       /* Driver may request additional render passes by returning GL_TRUE
 
    GLvector4f tmp_inputs[VERT_ATTRIB_MAX];
 
-   /* Temp storage for t_draw.c: 
+   /* Temp storage for t_draw.c:
     */
    GLubyte *block[VERT_ATTRIB_MAX];
    GLuint nr_blocks;
 
 #include "main/bufferobj.h"
 #include "main/condrender.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/enums.h"
 
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "t_context.h"
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    GLuint i;
-   
+
    for (i = 0; i <= _TNL_LAST_MAT; i++) {
       if (tnl->vb.AttribPtr[i]->size != tnl->pipeline.last_attrib_size[i] ||
          tnl->vb.AttribPtr[i]->stride != tnl->pipeline.last_attrib_stride[i]) {
 {
 #if 0
    TNLcontext *tnl = TNL_CONTEXT(ctx);
-   
+
    for (i = 0; i < VARYING_SLOT_MAX; i++) {
       if (tnl->vb.ResultPtr[i]->size != tnl->last_result_size[i] ||
          tnl->vb.ResultPtr[i]->stride != tnl->last_result_stride[i]) {
       }
    }
 
-   if (tnl->pipeline.output_changes) 
+   if (tnl->pipeline.output_changes)
       tnl->Driver.NotifyOutputChanges( ctx, tnl->pipeline.output_changes );
-   
+
    return tnl->pipeline.output_changes;
 #else
    return ~0;
         if (s->validate)
            s->validate( ctx, s );
       }
-      
+
       tnl->pipeline.new_state = 0;
       tnl->pipeline.input_changes = 0;
-      
+
       /* Pipeline can only change its output in response to either a
        * statechange or an input size/stride change.  No other changes
        * are allowed.
    &_tnl_texgen_stage,
    &_tnl_texture_transform_stage,
    &_tnl_point_attenuation_stage,
-   &_tnl_vertex_program_stage, 
+   &_tnl_vertex_program_stage,
    &_tnl_fog_coordinate_stage,
    &_tnl_render_stage,
-   NULL 
+   NULL
 };
 
 const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = {
 
 
 #include "main/glheader.h"
 #include "main/bufferobj.h"
-#include "util/imports.h"
+
 #include "main/glformats.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 
 #include "main/errors.h"
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
 
 #include "main/glheader.h"
 #include "main/light.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "util/simple_list.h"
 #include "main/mtypes.h"
 
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    GLfloat shininess;
-   
+
    shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
    if (!tnl->_ShineTable[0] || tnl->_ShineTable[0]->shininess != shininess)
       validate_shine_table( ctx, 0, shininess );
       /* increment src vertex color pointer */
       STRIDE_F(store->mat[i].ptr, store->mat[i].stride);
    }
-      
+
    /* recompute derived light/material values */
    _mesa_update_material( ctx, store->mat_bitmask );
    /* XXX we should only call this if we're tracking/changing the specular
                   struct vertex_buffer *VB, struct light_stage_data *store)
 {
    GLuint i;
-   
+
    store->mat_count = 0;
    store->mat_bitmask = 0;
 
 }
 
 
-static GLboolean run_lighting( struct gl_context *ctx, 
+static GLboolean run_lighting( struct gl_context *ctx,
                               struct tnl_pipeline_stage *stage )
 {
    struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
          */
         _mesa_vector4f_clean_elem(&store->Input, VB->Count, 2);
       }
-        
+
       if (input->size <= 1) {
         /* Clean y.
          */
 
       input = &store->Input;
    }
-   
+
    idx = 0;
 
    if (prepare_materials( ctx, VB, store ))
       idx |= LIGHT_TWOSIDE;
 
    /* The individual functions know about replaying side-effects
-    * vs. full re-execution. 
+    * vs. full re-execution.
     */
    store->light_func_tab[idx]( ctx, VB, stage, input );
 
 
 
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "main/dd.h"
-#include "util/imports.h"
+
 #include "t_context.h"
 #include "t_pipeline.h"
 
 
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 #include "math/m_xform.h"
 #include "util/bitscan.h"
       clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
    }
    else {
-      tab = (VB->Elts ? 
-            tnl->Driver.Render.PrimTabElts : 
+      tab = (VB->Elts ?
+            tnl->Driver.Render.PrimTabElts :
             tnl->Driver.Render.PrimTabVerts);
    }
 
 
         assert((prim & PRIM_MODE_MASK) <= GL_POLYGON);
 
-        if (MESA_VERBOSE & VERBOSE_PRIMS) 
-           _mesa_debug(NULL, "MESA prim %s %d..%d\n", 
-                       _mesa_enum_to_string(prim & PRIM_MODE_MASK), 
+        if (MESA_VERBOSE & VERBOSE_PRIMS)
+           _mesa_debug(NULL, "MESA prim %s %d..%d\n",
+                       _mesa_enum_to_string(prim & PRIM_MODE_MASK),
                        start, start+length);
 
         if (length)
 
 #include "main/errors.h"
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
    out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
    out->count = VB->Count;
    out->size = MAX2(in->size, 3);
-   if (in->size == 4) 
+   if (in->size == 4)
       _mesa_copy_tab[0x8]( out, in );
 }
 
    out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
    out->count = count;
    out->size = MAX2(in->size, 3);
-   if (in->size == 4) 
+   if (in->size == 4)
       _mesa_copy_tab[0x8]( out, in );
 }
 
    struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
    GLuint i;
 
-   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) 
+   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current)
       return GL_TRUE;
 
    for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) {
    struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
    GLuint i;
 
-   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) 
+   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current)
       return;
 
    for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) {
 
 
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "util/imports.h"
+
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
    GLuint i;
 
-   if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Current) 
+   if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Current)
       return GL_TRUE;
 
    /* ENABLE_TEXMAT implies that the texture matrix is not the
 
 #define VBO_EXEC_H
 
 #include "main/dd.h"
-#include "util/imports.h"
+#include "main/mesa_private.h"
 #include "vbo.h"
 #include "vbo_attrib.h"
 
 
  */
 
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "main/macros.h"
 #include "main/varray.h"
 
 
 #include "main/glheader.h"
 #include "main/bufferobj.h"
 #include "main/context.h"
-#include "util/imports.h"
+#include "main/mesa_private.h"
 #include "main/macros.h"
 #include "main/light.h"
 #include "main/state.h"
 
 #include "main/context.h"
 #include "main/glheader.h"
 #include "main/enums.h"
-#include "util/imports.h"
+#include "main/mesa_private.h"
 #include "main/dispatch.h"
 #include "glapi/glapi.h"
 
 
 #endif
 #endif
 
+#include <stdlib.h>
+
 #include "main/errors.h"
-#include "util/imports.h"
+
 #include "common_x86_asm.h"
 
 
    }
 #elif defined(_WIN32)
    LPTOP_LEVEL_EXCEPTION_FILTER oldFilter;
-   
+
    /* Install our ExceptionFilter */
    oldFilter = SetUnhandledExceptionFilter( ExceptionFilter );
-   
+
    if ( cpu_has_xmm ) {
       _mesa_debug(NULL, "Testing OS support for SSE...\n");
 
 
 #if defined(__i386__) || defined(__386__)
 
 #include <stdio.h>
+#include <string.h>
+#include <assert.h>
 
-#include "util/imports.h"
 #include "main/execmem.h"
 #include "x86sse.h"
 
 /* Build a modRM byte + possible displacement.  No treatment of SIB
  * indexing.  BZZT - no way to encode an absolute address.
  */
-static void emit_modrm( struct x86_function *p, 
-                       struct x86_reg reg, 
+static void emit_modrm( struct x86_function *p,
+                       struct x86_reg reg,
                        struct x86_reg regmem )
 {
    unsigned char val = 0;
-   
+
    assert(reg.mod == mod_REG);
-   
+
    val |= regmem.mod << 6;             /* mod field */
    val |= reg.idx << 3;                /* reg field */
    val |= regmem.idx;          /* r/m field */
-   
+
    emit_1ub(p, val);
 
    /* Oh-oh we've stumbled into the SIB thing.
  * the arguments presented.
  */
 static void emit_op_modrm( struct x86_function *p,
-                          unsigned char op_dst_is_reg, 
+                          unsigned char op_dst_is_reg,
                           unsigned char op_dst_is_mem,
                           struct x86_reg dst,
                           struct x86_reg src )
-{  
+{
    switch (dst.mod) {
    case mod_REG:
       emit_1ub(p, op_dst_is_reg);
              unsigned char *label )
 {
    int offset = label - (x86_get_label(p) + 2);
-   
+
    if (offset <= 127 && offset >= -128) {
       emit_1ub(p, 0x70 + cc);
       emit_1b(p, (char) offset);
                   struct x86_reg dst,
                   struct x86_reg src )
 {
-   assert(dst.file == file_MMX && 
+   assert(dst.file == file_MMX &&
          (src.file == file_XMM || src.mod != mod_REG));
 
    p->need_emms = 1;
 void sse_shufps( struct x86_function *p,
                 struct x86_reg dest,
                 struct x86_reg arg0,
-                unsigned char shuf) 
+                unsigned char shuf)
 {
    emit_2ub(p, X86_TWOB, 0xC6);
    emit_modrm(p, dest, arg0);
-   emit_1ub(p, shuf); 
+   emit_1ub(p, shuf);
 }
 
 void sse_cmpps( struct x86_function *p,
                struct x86_reg dest,
                struct x86_reg arg0,
-               unsigned char cc) 
+               unsigned char cc)
 {
    emit_2ub(p, X86_TWOB, 0xC2);
    emit_modrm(p, dest, arg0);
-   emit_1ub(p, cc); 
+   emit_1ub(p, cc);
 }
 
 void sse_pmovmskb( struct x86_function *p,
 void sse2_pshufd( struct x86_function *p,
                  struct x86_reg dest,
                  struct x86_reg arg0,
-                 unsigned char shuf) 
+                 unsigned char shuf)
 {
    emit_3ub(p, 0x66, X86_TWOB, 0x70);
    emit_modrm(p, dest, arg0);
-   emit_1ub(p, shuf); 
+   emit_1ub(p, shuf);
 }
 
 void sse2_cvttps2dq( struct x86_function *p,
    assert(dst.file == file_x87);
 
    if (arg.file == file_x87) {
-      if (dst.idx == 0) 
+      if (dst.idx == 0)
         emit_2ub(p, dst0ub0, dst0ub1+arg.idx);
-      else if (arg.idx == 0) 
+      else if (arg.idx == 0)
         emit_2ub(p, arg0ub0, arg0ub1+arg.idx);
       else
         assert(0);
 
 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
 {
-   x87_arith_op(p, dst, arg, 
+   x87_arith_op(p, dst, arg,
                0xd8, 0xc8,
                0xdc, 0xc8,
                4);
 
 void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
 {
-   x87_arith_op(p, dst, arg, 
+   x87_arith_op(p, dst, arg,
                0xd8, 0xe0,
                0xdc, 0xe8,
                4);
 
 void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
 {
-   x87_arith_op(p, dst, arg, 
+   x87_arith_op(p, dst, arg,
                0xd8, 0xe8,
                0xdc, 0xe0,
                5);
 
 void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
 {
-   x87_arith_op(p, dst, arg, 
+   x87_arith_op(p, dst, arg,
                0xd8, 0xc0,
                0xdc, 0xc0,
                0);
 
 void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
 {
-   x87_arith_op(p, dst, arg, 
+   x87_arith_op(p, dst, arg,
                0xd8, 0xf0,
                0xdc, 0xf8,
                6);
 
 void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
 {
-   x87_arith_op(p, dst, arg, 
+   x87_arith_op(p, dst, arg,
                0xd8, 0xf8,
                0xdc, 0xf0,
                7);
 /* st1 = st1 * log2(st0 + 1.0);
  * pop_stack;
  *
- * A fast operation, with restrictions: -.29 < st0 < .29 
+ * A fast operation, with restrictions: -.29 < st0 < .29
  */
 void x87_fyl2xp1( struct x86_function *p )
 {
 
 void x87_fld( struct x86_function *p, struct x86_reg arg )
 {
-   if (arg.file == file_x87) 
+   if (arg.file == file_x87)
       emit_2ub(p, 0xd9, 0xc0 + arg.idx);
    else {
       emit_1ub(p, 0xd9);
 
 void x87_fst( struct x86_function *p, struct x86_reg dst )
 {
-   if (dst.file == file_x87) 
+   if (dst.file == file_x87)
       emit_2ub(p, 0xdd, 0xd0 + dst.idx);
    else {
       emit_1ub(p, 0xd9);
 
 void x87_fstp( struct x86_function *p, struct x86_reg dst )
 {
-   if (dst.file == file_x87) 
+   if (dst.file == file_x87)
       emit_2ub(p, 0xdd, 0xd8 + dst.idx);
    else {
       emit_1ub(p, 0xd9);
 
 void x87_fcom( struct x86_function *p, struct x86_reg dst )
 {
-   if (dst.file == file_x87) 
+   if (dst.file == file_x87)
       emit_2ub(p, 0xd8, 0xd0 + dst.idx);
    else {
       emit_1ub(p, 0xd8);
 
 void x87_fcomp( struct x86_function *p, struct x86_reg dst )
 {
-   if (dst.file == file_x87) 
+   if (dst.file == file_x87)
       emit_2ub(p, 0xd8, 0xd8 + dst.idx);
    else {
       emit_1ub(p, 0xd8);
    assert(dst.file == file_REG32);
 
    if (dst.idx == reg_AX &&
-       dst.mod == mod_REG) 
+       dst.mod == mod_REG)
       emit_2ub(p, 0xdf, 0xe0);
    else {
       emit_1ub(p, 0xdd);
                   struct x86_reg dst,
                   struct x86_reg src )
 {
-   assert(dst.file == file_MMX && 
+   assert(dst.file == file_MMX &&
          (src.file == file_MMX || src.mod != mod_REG));
 
    p->need_emms = 1;
                   struct x86_reg dst,
                   struct x86_reg src )
 {
-   assert(dst.file == file_MMX && 
+   assert(dst.file == file_MMX &&
          (src.file == file_MMX || src.mod != mod_REG));
 
    p->need_emms = 1;
 struct x86_reg x86_fn_arg( struct x86_function *p,
                           unsigned arg )
 {
-   return x86_make_disp(x86_make_reg(file_REG32, reg_SP), 
+   return x86_make_disp(x86_make_reg(file_REG32, reg_SP),
                        p->stack_offset + arg * 4);     /* ??? */
 }
 
 
   'glsl_util',
   files(
     'mesa/main/extensions_table.c',
-    'mesa/program/prog_parameter.c', 'mesa/program/symbol_table.c',
+    'mesa/program/prog_parameter.c',
+    'mesa/program/symbol_table.c',
     'mesa/program/dummy_errors.c',
   ),
   include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
 
 #include "main/mtypes.h"
 #include "compiler/glsl/glsl_to_nir.h"
 #include "compiler/nir_types.h"
-#include "util/imports.h"
 #include "compiler/nir/nir_builder.h"
 
 #include "disassemble.h"
                         { 0 },
                         { 0 }, { 1 }, { 2}
                 },
-                .store_channels = nr, 
+                .store_channels = nr,
         };
 
         for (unsigned i = 0; i < nr; ++i)
 
 #include "main/mtypes.h"
 #include "compiler/glsl/glsl_to_nir.h"
 #include "compiler/nir_types.h"
-#include "util/imports.h"
 #include "compiler/nir/nir_builder.h"
 #include "util/half_float.h"
 #include "util/u_math.h"
 {
         /* TODO: types */
 
-        midgard_instruction ins; 
+        midgard_instruction ins;
 
         if (is_read)
                 ins = m_ld_int4(srcdest, 0);
         case nir_intrinsic_get_buffer_size:
                 emit_sysval_read(ctx, &instr->instr, 1, 8);
                 break;
- 
+
         case nir_intrinsic_load_viewport_scale:
         case nir_intrinsic_load_viewport_offset:
         case nir_intrinsic_load_num_work_groups:
 
        half_float.h \
        hash_table.c \
        hash_table.h \
-        imports.c \
-        imports.h \
        list.h \
        macros.h \
        mesa-sha1.c \
 
+++ /dev/null
-/**
- * \file imports.c
- * Standard C library function wrappers.
- *
- * Imports are services which the device driver or window system or
- * operating system provides to the core renderer.  The core renderer (Mesa)
- * will call these functions in order to do memory allocation, simple I/O,
- * etc.
- *
- * Some drivers will want to override/replace this file with something
- * specialized, but that'll be rare.
- *
- * Eventually, I want to move roll the glheader.h file into this.
- *
- * \todo Functions still needed:
- * - scanf
- * - qsort
- * - rand and RAND_MAX
- */
-
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice 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
- * THE AUTHORS OR COPYRIGHT HOLDERS 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.
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include "c99_math.h"
-#include "imports.h"
-
-#ifdef _GNU_SOURCE
-#include <locale.h>
-#ifdef __APPLE__
-#include <xlocale.h>
-#endif
-#endif
-
-
-#ifdef _WIN32
-#define vsnprintf _vsnprintf
-#elif defined(__IBMC__) || defined(__IBMCPP__)
-extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
-#endif
 
+++ /dev/null
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice 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
- * THE AUTHORS OR COPYRIGHT HOLDERS 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.
- */
-
-
-/**
- * \file imports.h
- * Standard C library function wrappers.
- *
- * This file provides wrappers for all the standard C library functions
- * like malloc(), free(), printf(), getenv(), etc.
- */
-
-
-#ifndef IMPORTS_H
-#define IMPORTS_H
-
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include "util/compiler.h"
-#include "util/bitscan.h"
-#include "util/u_memory.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * Sometimes we treat floats as ints.  On x86 systems, moving a float
- * as an int (thereby using integer registers instead of FP registers) is
- * a performance win.  Typically, this can be done with ordinary casts.
- * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
- * these casts generate warnings.
- * The following union typedef is used to solve that.
- */
-typedef union { float f; int i; unsigned u; } fi_type;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* IMPORTS_H */
 
   'half_float.h',
   'hash_table.c',
   'hash_table.h',
-  'imports.c',
-  'imports.h',
   'list.h',
   'macros.h',
   'mesa-sha1.c',
 
  */
 
 #include <stdbool.h>
-#include <limits.h>
+#include <stdlib.h>
 
 #include "ralloc.h"
-#include "util/imports.h"
+#include "main/macros.h"
 #include "util/bitset.h"
 #include "u_math.h"
 #include "register_allocate.h"