aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2018-09-14 12:57:32 -0700
committerDylan Baker <[email protected]>2020-04-21 11:09:04 -0700
commit8e3696137f2cb7b4f5a3824f26186ecbb06f9282 (patch)
tree4494df8d138aaf2bab2feafa832f68e9fdf9bfb1 /src/mesa/main
parent289f02d1d5990e052e21eb250f6d40b47d6eb12f (diff)
remove final imports.h and imports.c bits
This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/accum.c6
-rw-r--r--src/mesa/main/api_arrayelt.c2
-rw-r--r--src/mesa/main/arbprogram.c16
-rw-r--r--src/mesa/main/arrayobj.c4
-rw-r--r--src/mesa/main/atifragshader.c10
-rw-r--r--src/mesa/main/attrib.c2
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/context.h8
-rw-r--r--src/mesa/main/cpuinfo.c5
-rw-r--r--src/mesa/main/debug.c6
-rw-r--r--src/mesa/main/debug_output.c2
-rw-r--r--src/mesa/main/depth.c2
-rw-r--r--src/mesa/main/dlist.c2
-rw-r--r--src/mesa/main/draw_validate.c2
-rw-r--r--src/mesa/main/drawtex.c2
-rw-r--r--src/mesa/main/errors.c6
-rw-r--r--src/mesa/main/es1_conversion.c2
-rw-r--r--src/mesa/main/execmem.c17
-rw-r--r--src/mesa/main/execmem.h1
-rw-r--r--src/mesa/main/extensions.c2
-rw-r--r--src/mesa/main/ff_fragment_shader.cpp22
-rw-r--r--src/mesa/main/format_unpack.py1
-rw-r--r--src/mesa/main/format_utils.c2
-rw-r--r--src/mesa/main/format_utils.h2
-rw-r--r--src/mesa/main/formats.c4
-rw-r--r--src/mesa/main/framebuffer.c2
-rw-r--r--src/mesa/main/hash.h6
-rw-r--r--src/mesa/main/hint.c2
-rw-r--r--src/mesa/main/image.c4
-rw-r--r--src/mesa/main/macros.h3
-rw-r--r--src/mesa/main/matrix.c16
-rw-r--r--src/mesa/main/mesa_private.h56
-rw-r--r--src/mesa/main/mipmap.c4
-rw-r--r--src/mesa/main/objectpurge.c2
-rw-r--r--src/mesa/main/pack.c8
-rw-r--r--src/mesa/main/pipelineobj.c1
-rw-r--r--src/mesa/main/pixeltransfer.c2
-rw-r--r--src/mesa/main/polygon.c2
-rw-r--r--src/mesa/main/queryobj.c2
-rw-r--r--src/mesa/main/readpix.c2
-rw-r--r--src/mesa/main/remap.c3
-rw-r--r--src/mesa/main/renderbuffer.c2
-rw-r--r--src/mesa/main/shared.c4
-rw-r--r--src/mesa/main/stencil.c6
-rw-r--r--src/mesa/main/streaming-load-memcpy.h2
-rw-r--r--src/mesa/main/syncobj.c2
-rw-r--r--src/mesa/main/texcompress.c2
-rw-r--r--src/mesa/main/texcompress_astc.cpp1
-rw-r--r--src/mesa/main/texcompress_cpal.c2
-rw-r--r--src/mesa/main/texcompress_fxt1.c8
-rw-r--r--src/mesa/main/texcompress_rgtc.c5
-rw-r--r--src/mesa/main/texcompress_s3tc.c2
-rw-r--r--src/mesa/main/teximage.c2
-rw-r--r--src/mesa/main/texobj.c2
-rw-r--r--src/mesa/main/texstorage.c8
-rwxr-xr-xsrc/mesa/main/texstore.c2
-rw-r--r--src/mesa/main/texturebindless.c2
-rw-r--r--src/mesa/main/textureview.c2
-rw-r--r--src/mesa/main/varray.c2
-rw-r--r--src/mesa/main/version.c2
-rw-r--r--src/mesa/main/vtxfmt.c2
61 files changed, 188 insertions, 117 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 86d19c57d92..ff1168afc45 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -29,7 +29,7 @@
#include "format_unpack.h"
#include "format_pack.h"
#include "framebuffer.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "state.h"
#include "mtypes.h"
@@ -99,7 +99,7 @@ _mesa_clear_accum_buffer(struct gl_context *ctx)
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;
@@ -441,7 +441,7 @@ accum(struct gl_context *ctx, GLenum op, GLfloat value)
}
-void
+void
_mesa_init_accum( struct gl_context *ctx )
{
/* Accumulate buffer group */
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index bc74cede5fe..5df7b05fbd8 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -39,7 +39,7 @@
#include "api_arrayelt.h"
#include "bufferobj.h"
#include "context.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "mtypes.h"
#include "main/dispatch.h"
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 25de173784c..67162946015 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -32,7 +32,7 @@
#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"
@@ -158,7 +158,7 @@ _mesa_BindProgramARB(GLenum target, GLuint id)
* \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;
@@ -256,7 +256,7 @@ _mesa_GenProgramsARB(GLsizei n, GLuint *ids)
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);
@@ -487,7 +487,7 @@ void GLAPIENTRY
_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);
}
@@ -500,8 +500,8 @@ void GLAPIENTRY
_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]);
}
@@ -602,7 +602,7 @@ _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index,
void GLAPIENTRY
-_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index,
+_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index,
GLfloat *params)
{
GLfloat *param;
@@ -746,7 +746,7 @@ _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index,
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);
}
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index bbb79fb03e7..dd410c345cc 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -43,7 +43,7 @@
#include "glheader.h"
#include "hash.h"
#include "image.h"
-#include "util/imports.h"
+
#include "context.h"
#include "bufferobj.h"
#include "arrayobj.h"
@@ -1053,7 +1053,7 @@ delete_vertex_arrays(struct gl_context *ctx, GLsizei n, const GLuint *ids)
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);
diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c
index 4d9ddcc56ef..44f6bb46484 100644
--- a/src/mesa/main/atifragshader.c
+++ b/src/mesa/main/atifragshader.c
@@ -24,7 +24,7 @@
#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"
@@ -110,7 +110,7 @@ create_dst_mod_str(GLuint mod)
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,
@@ -122,14 +122,14 @@ 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)
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index d2bcdb8373f..35231335813 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -24,7 +24,7 @@
*/
#include "glheader.h"
-#include "util/imports.h"
+
#include "accum.h"
#include "arrayobj.h"
#include "attrib.h"
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 16283febef1..cc6d55d555a 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -77,7 +77,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "accum.h"
#include "api_exec.h"
#include "api_loopback.h"
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index a816131742e..f2feb7f9ed4 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -50,7 +50,7 @@
#include "errors.h"
-#include "util/imports.h"
+
#include "extensions.h"
#include "mtypes.h"
#include "vbo/vbo.h"
@@ -66,7 +66,7 @@ struct _glapi_table;
/** \name Visual-related functions */
/*@{*/
-
+
extern struct gl_config *
_mesa_create_visual( GLboolean dbFlag,
GLboolean stereoFlag,
@@ -257,7 +257,7 @@ do { \
/**
* 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.
*/
@@ -272,7 +272,7 @@ do { \
/**
* Macro to assert that the API call was made outside the
* glBegin()/glEnd() pair.
- *
+ *
* \param ctx GL context.
*/
#define ASSERT_OUTSIDE_BEGIN_END(ctx) \
diff --git a/src/mesa/main/cpuinfo.c b/src/mesa/main/cpuinfo.c
index c085d3430d4..1623a20892e 100644
--- a/src/mesa/main/cpuinfo.c
+++ b/src/mesa/main/cpuinfo.c
@@ -23,7 +23,10 @@
*/
-#include "util/imports.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
#include "main/cpuinfo.h"
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index a646d4426ef..5d00cc0a8c7 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -30,7 +30,7 @@
#include "enums.h"
#include "formats.h"
#include "hash.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "debug.h"
#include "get.h"
@@ -210,7 +210,7 @@ set_debug_flags(const char *str)
/**
* Initialize debugging variables from env vars.
*/
-void
+void
_mesa_init_debug( struct gl_context *ctx )
{
set_debug_flags(getenv("MESA_DEBUG"));
@@ -307,7 +307,7 @@ _mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb)
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;
diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c
index e212ed965b9..3f1ca8bf340 100644
--- a/src/mesa/main/debug_output.c
+++ b/src/mesa/main/debug_output.c
@@ -28,7 +28,7 @@
#include "context.h"
#include "debug_output.h"
#include "enums.h"
-#include "util/imports.h"
+
#include "hash.h"
#include "mtypes.h"
#include "version.h"
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index f37d175b888..278a4ce40fa 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -24,7 +24,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "depth.h"
#include "enums.h"
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index bd2ce8f5053..a780100e456 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -31,7 +31,7 @@
#include "c99_math.h"
#include "glheader.h"
-#include "util/imports.h"
+
#include "api_arrayelt.h"
#include "api_exec.h"
#include "api_loopback.h"
diff --git a/src/mesa/main/draw_validate.c b/src/mesa/main/draw_validate.c
index 4b624af1e2f..5a1f6d2a194 100644
--- a/src/mesa/main/draw_validate.c
+++ b/src/mesa/main/draw_validate.c
@@ -28,7 +28,7 @@
#include "arrayobj.h"
#include "bufferobj.h"
#include "context.h"
-#include "util/imports.h"
+
#include "mtypes.h"
#include "pipelineobj.h"
#include "enums.h"
diff --git a/src/mesa/main/drawtex.c b/src/mesa/main/drawtex.c
index 304c74879b5..e7c76d1b044 100644
--- a/src/mesa/main/drawtex.c
+++ b/src/mesa/main/drawtex.c
@@ -24,7 +24,7 @@
#include "main/errors.h"
#include "main/drawtex.h"
#include "main/state.h"
-#include "util/imports.h"
+
#include "main/mtypes.h"
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index b3487efb522..91988f183f8 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -32,7 +32,7 @@
#include <stdio.h>
#include "errors.h"
#include "enums.h"
-#include "util/imports.h"
+
#include "context.h"
#include "debug_output.h"
@@ -82,8 +82,8 @@ output_if_debug(const char *prefixString, const char *outputString,
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" : "");
diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c
index 020d891ae33..38d8bdaa399 100644
--- a/src/mesa/main/es1_conversion.c
+++ b/src/mesa/main/es1_conversion.c
@@ -9,7 +9,7 @@
#include "context.h"
#include "depth.h"
#include "fog.h"
-#include "util/imports.h"
+
#include "light.h"
#include "lines.h"
#include "matrix.h"
diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c
index 37a043a0b3a..b2018b5e767 100644
--- a/src/mesa/main/execmem.c
+++ b/src/mesa/main/execmem.c
@@ -32,7 +32,6 @@
#include <stdio.h>
-#include "util/imports.h"
#include "main/glheader.h"
#include "execmem.h"
#include "c11/threads.h"
@@ -80,7 +79,7 @@ init_heap(void)
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);
@@ -107,24 +106,24 @@ _mesa_exec_malloc(unsigned size)
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);
}
@@ -145,8 +144,8 @@ _mesa_exec_malloc(unsigned size)
return malloc( size );
}
-
-void
+
+void
_mesa_exec_free(void *addr)
{
free(addr);
diff --git a/src/mesa/main/execmem.h b/src/mesa/main/execmem.h
index f9479b96379..d98cad7135b 100644
--- a/src/mesa/main/execmem.h
+++ b/src/mesa/main/execmem.h
@@ -26,6 +26,7 @@
#ifndef EXECMEM_H
#define EXECMEM_H
+#include "glheader.h"
extern void *
_mesa_exec_malloc(unsigned size);
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 6c1551687b2..2d780c0743c 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -31,7 +31,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "extensions.h"
#include "macros.h"
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index 9ae86f4ee13..05633d0d7d4 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1,10 +1,10 @@
/**************************************************************************
- *
+ *
* 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
@@ -12,11 +12,11 @@
* 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.
@@ -24,12 +24,12 @@
* 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"
@@ -503,7 +503,7 @@ static GLboolean args_match( const struct state_key *key, GLuint unit )
return GL_FALSE;
}
break;
- default:
+ default:
return GL_FALSE; /* impossible */
}
}
@@ -587,7 +587,7 @@ emit_combine(texenv_fragment_program *p,
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];
}
@@ -606,7 +606,7 @@ emit_texenv(texenv_fragment_program *p, GLuint unit)
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;
@@ -621,7 +621,7 @@ emit_texenv(texenv_fragment_program *p, GLuint unit)
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.
*/
@@ -869,7 +869,7 @@ load_texenv_source(texenv_fragment_program *p,
case TEXENV_SRC_TEXTURE7:
load_texture(p, src - TEXENV_SRC_TEXTURE0);
break;
-
+
default:
/* not a texture src - do nothing */
break;
diff --git a/src/mesa/main/format_unpack.py b/src/mesa/main/format_unpack.py
index e3c86bbf4bc..161a4021567 100644
--- a/src/mesa/main/format_unpack.py
+++ b/src/mesa/main/format_unpack.py
@@ -42,6 +42,7 @@ string = """/*
*/
#include <stdint.h>
+#include <stdlib.h>
#include "format_unpack.h"
#include "format_utils.h"
diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 732e2424cbb..1ac1cf36bc8 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -22,6 +22,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <stdlib.h>
+
#include "errors.h"
#include "format_utils.h"
#include "glformats.h"
diff --git a/src/mesa/main/format_utils.h b/src/mesa/main/format_utils.h
index c298d0477ad..9b6d1c39be7 100644
--- a/src/mesa/main/format_utils.h
+++ b/src/mesa/main/format_utils.h
@@ -32,7 +32,7 @@
#define FORMAT_UTILS_H
#include "formats.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "util/rounding.h"
#include "util/half_float.h"
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 53f01ffc18a..114ea5218be 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -25,7 +25,7 @@
#include "errors.h"
-#include "util/imports.h"
+
#include "formats.h"
#include "macros.h"
#include "glformats.h"
@@ -574,7 +574,7 @@ _mesa_is_format_unsigned(mesa_format format)
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;
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index ae961689901..5061c179ee9 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -31,7 +31,7 @@
#include <stdio.h>
#include "glheader.h"
-#include "util/imports.h"
+
#include "blend.h"
#include "buffers.h"
#include "context.h"
diff --git a/src/mesa/main/hash.h b/src/mesa/main/hash.h
index 040c6cb5824..0a3996a7d00 100644
--- a/src/mesa/main/hash.h
+++ b/src/mesa/main/hash.h
@@ -1,6 +1,6 @@
/**
* \file hash.h
- * Generic hash table.
+ * Generic hash table.
*/
/*
@@ -32,8 +32,10 @@
#define HASH_H
+#include <stdbool.h>
+#include <stdint.h>
#include "glheader.h"
-#include "util/imports.h"
+
#include "c11/threads.h"
/**
diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c
index 5a09a7362a9..890be7b39c8 100644
--- a/src/mesa/main/hint.c
+++ b/src/mesa/main/hint.c
@@ -28,7 +28,7 @@
#include "enums.h"
#include "context.h"
#include "hint.h"
-#include "util/imports.h"
+
#include "mtypes.h"
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 0ec1d09853e..4358503e3ca 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -34,7 +34,7 @@
#include "colormac.h"
#include "glformats.h"
#include "image.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "mtypes.h"
@@ -288,7 +288,7 @@ _mesa_image_address3d( const struct gl_pixelstore_attrib *packing,
* \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
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 3e1227328e1..caa310fd021 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -34,8 +34,9 @@
#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"
/**
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 58a48ed9933..eba3e8b3317 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -36,7 +36,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "enums.h"
#include "macros.h"
@@ -382,7 +382,7 @@ pop_matrix( struct gl_context *ctx, struct gl_matrix_stack *stack )
* 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.
@@ -896,7 +896,7 @@ _mesa_MatrixMultTransposedEXT( GLenum matrixMode, const GLdouble *m )
*
* 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
@@ -982,7 +982,7 @@ void _mesa_update_modelview_project( struct gl_context *ctx, GLuint new_state )
* \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.
*/
@@ -1002,9 +1002,9 @@ init_matrix_stack(struct gl_matrix_stack *stack,
/**
* Free matrix stack.
- *
+ *
* \param stack matrix stack.
- *
+ *
* Calls _math_matrix_dtr() for each element of the matrix stack and
* frees the array.
*/
@@ -1060,7 +1060,7 @@ void _mesa_init_matrix( struct gl_context * ctx )
/**
* Free the context matrix data.
- *
+ *
* \param ctx GL context.
*
* Frees each of the matrix stacks and the combined modelview-projection
@@ -1082,7 +1082,7 @@ void _mesa_free_matrix_data( struct gl_context *ctx )
}
-/**
+/**
* Initialize the context transform attribute group.
*
* \param ctx GL context.
diff --git a/src/mesa/main/mesa_private.h b/src/mesa/main/mesa_private.h
new file mode 100644
index 00000000000..229a746a809
--- /dev/null
+++ b/src/mesa/main/mesa_private.h
@@ -0,0 +1,56 @@
+/*
+ * 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 */
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index dc606877d01..f882bae89ce 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -28,7 +28,7 @@
*/
#include "errors.h"
-#include "util/imports.h"
+
#include "formats.h"
#include "glformats.h"
#include "mipmap.h"
@@ -1620,7 +1620,7 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
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);
diff --git a/src/mesa/main/objectpurge.c b/src/mesa/main/objectpurge.c
index 615862e32ae..78bc4487617 100644
--- a/src/mesa/main/objectpurge.c
+++ b/src/mesa/main/objectpurge.c
@@ -31,7 +31,7 @@
#include "glheader.h"
#include "enums.h"
#include "hash.h"
-#include "util/imports.h"
+
#include "context.h"
#include "bufferobj.h"
#include "fbobject.h"
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index 818fcf85384..223bbb5adc1 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -46,12 +46,12 @@
#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"
@@ -1263,7 +1263,7 @@ _mesa_unpack_image( GLuint dimensions,
for (i = 0; i < width; i++) {
if (*s & srcMask) {
*d |= dstMask;
- }
+ }
if (srcMask == 128) {
srcMask = 1;
s++;
@@ -1305,7 +1305,7 @@ _mesa_unpack_image( GLuint dimensions,
}
else {
dstMask = dstMask >> 1;
- }
+ }
}
}
}
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index c0b6871c7b3..f12bcfe0e85 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -48,6 +48,7 @@
#include "program/program.h"
#include "program/prog_parameter.h"
#include "util/ralloc.h"
+#include "util/bitscan.h"
/**
* Delete a pipeline object.
diff --git a/src/mesa/main/pixeltransfer.c b/src/mesa/main/pixeltransfer.c
index 1b8abd87a61..b4dff56bdaa 100644
--- a/src/mesa/main/pixeltransfer.c
+++ b/src/mesa/main/pixeltransfer.c
@@ -33,7 +33,7 @@
#include "glheader.h"
#include "macros.h"
#include "pixeltransfer.h"
-#include "util/imports.h"
+
#include "mtypes.h"
#include "util/rounding.h"
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index f44542385b9..6eee6948336 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -29,7 +29,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "image.h"
#include "enums.h"
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 8577a57fbe4..e54a37b8e89 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -28,7 +28,7 @@
#include "context.h"
#include "enums.h"
#include "hash.h"
-#include "util/imports.h"
+
#include "queryobj.h"
#include "mtypes.h"
#include "util/u_memory.h"
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index a7ca828e3f1..bca9c0c90a4 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -23,7 +23,7 @@
*/
#include "glheader.h"
-#include "util/imports.h"
+
#include "blend.h"
#include "bufferobj.h"
#include "context.h"
diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c
index c8b01fb1a58..2110140ab95 100644
--- a/src/mesa/main/remap.c
+++ b/src/mesa/main/remap.c
@@ -36,8 +36,9 @@
*/
#include <stdbool.h>
+#include <string.h>
#include "remap.h"
-#include "util/imports.h"
+
#include "glapi/glapi.h"
#define MAX_ENTRY_POINTS 16
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index 2624f01259d..27c6d90fb9b 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -24,7 +24,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "fbobject.h"
#include "formats.h"
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 18e1d750155..357368b38de 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -27,7 +27,7 @@
* Shared-context state
*/
-#include "util/imports.h"
+
#include "mtypes.h"
#include "hash.h"
#include "atifragshader.h"
@@ -330,7 +330,7 @@ delete_semaphore_object_cb(GLuint id, void *data, void *userData)
*
* \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.
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index 6ef6833bb71..604167ae2d7 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -48,7 +48,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "macros.h"
#include "stencil.h"
@@ -318,9 +318,9 @@ _mesa_StencilMask( GLuint mask )
* \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.
diff --git a/src/mesa/main/streaming-load-memcpy.h b/src/mesa/main/streaming-load-memcpy.h
index d31c199a27c..9ecb685d660 100644
--- a/src/mesa/main/streaming-load-memcpy.h
+++ b/src/mesa/main/streaming-load-memcpy.h
@@ -33,6 +33,8 @@
#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);
diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
index 838d2d00a02..23b49c981ae 100644
--- a/src/mesa/main/syncobj.c
+++ b/src/mesa/main/syncobj.c
@@ -57,7 +57,7 @@
#include <inttypes.h>
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "macros.h"
#include "get.h"
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 6b97695c8ef..992818cc001 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -31,7 +31,7 @@
#include "glheader.h"
-#include "util/imports.h"
+
#include "context.h"
#include "formats.h"
#include "mtypes.h"
diff --git a/src/mesa/main/texcompress_astc.cpp b/src/mesa/main/texcompress_astc.cpp
index 63676dfa64c..583e582a4b6 100644
--- a/src/mesa/main/texcompress_astc.cpp
+++ b/src/mesa/main/texcompress_astc.cpp
@@ -37,6 +37,7 @@
#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;
diff --git a/src/mesa/main/texcompress_cpal.c b/src/mesa/main/texcompress_cpal.c
index db99649e2bf..76f3cd9bfb4 100644
--- a/src/mesa/main/texcompress_cpal.c
+++ b/src/mesa/main/texcompress_cpal.c
@@ -34,7 +34,7 @@
#include "glheader.h"
#include "context.h"
#include "mtypes.h"
-#include "util/imports.h"
+
#include "pixelstore.h"
#include "texcompress_cpal.h"
#include "teximage.h"
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 5b93eee3439..7eedd6e1732 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -31,7 +31,7 @@
#include "errors.h"
#include "glheader.h"
-#include "util/imports.h"
+
#include "image.h"
#include "macros.h"
#include "mipmap.h"
@@ -667,7 +667,7 @@ fxt1_quantize_ALPHA1 (GLuint *cc,
}
sumL += sum;
}
-
+
nn_comp--;
}
@@ -742,7 +742,7 @@ fxt1_quantize_ALPHA1 (GLuint *cc,
lolo <<= 2;
lolo |= texel;
}
-
+
cc[0] = lolo;
}
@@ -1117,7 +1117,7 @@ fxt1_quantize_MIXED0 (GLuint *cc,
}
lolo = ~lolo;
}
-
+
cc[0] = lolo;
}
diff --git a/src/mesa/main/texcompress_rgtc.c b/src/mesa/main/texcompress_rgtc.c
index e6f6075ecff..6839432966f 100644
--- a/src/mesa/main/texcompress_rgtc.c
+++ b/src/mesa/main/texcompress_rgtc.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2011 Red Hat Inc.
- *
+ *
* block compression parts are:
* Copyright (C) 2004 Roland Scheidegger All Rights Reserved.
*
@@ -32,10 +32,11 @@
* 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"
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index faec72f365d..06546a2a590 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -30,7 +30,7 @@
*/
#include "glheader.h"
-#include "util/imports.h"
+
#include "image.h"
#include "macros.h"
#include "mtypes.h"
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index ea93ac2f3b2..7eddbc33f95 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -38,7 +38,7 @@
#include "framebuffer.h"
#include "hash.h"
#include "image.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "mipmap.h"
#include "multisample.h"
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 684c34b2c06..8bd9cee4615 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -35,7 +35,7 @@
#include "fbobject.h"
#include "formats.h"
#include "hash.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "shaderimage.h"
#include "teximage.h"
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 5f2d78e07d4..932308c6471 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -30,7 +30,7 @@
#include "glheader.h"
#include "context.h"
#include "enums.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "teximage.h"
#include "texobj.h"
@@ -744,7 +744,7 @@ _mesa_TextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels,
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,
@@ -761,7 +761,7 @@ _mesa_TextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels,
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,
@@ -778,7 +778,7 @@ _mesa_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels,
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,
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 5c5331a6402..04325a9a143 100755
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -62,7 +62,7 @@
#include "mtypes.h"
#include "pack.h"
#include "pbo.h"
-#include "util/imports.h"
+
#include "texcompress.h"
#include "texcompress_fxt1.h"
#include "texcompress_rgtc.h"
diff --git a/src/mesa/main/texturebindless.c b/src/mesa/main/texturebindless.c
index 2e11b9f8c79..c1cef4b1e46 100644
--- a/src/mesa/main/texturebindless.c
+++ b/src/mesa/main/texturebindless.c
@@ -24,7 +24,7 @@
#include "glheader.h"
#include "context.h"
#include "enums.h"
-#include "util/imports.h"
+
#include "hash.h"
#include "mtypes.h"
#include "shaderimage.h"
diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c
index da09c1e3c58..6aafeed2d17 100644
--- a/src/mesa/main/textureview.c
+++ b/src/mesa/main/textureview.c
@@ -34,7 +34,7 @@
#include "glheader.h"
#include "context.h"
#include "enums.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "teximage.h"
#include "texobj.h"
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 0dd630c7a3a..559ff9d949f 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -28,7 +28,7 @@
#include <inttypes.h> /* for PRId64 macro */
#include "glheader.h"
-#include "util/imports.h"
+
#include "bufferobj.h"
#include "context.h"
#include "enable.h"
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 0cb0aabb896..7e51bb53439 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include "context.h"
-#include "util/imports.h"
+
#include "mtypes.h"
#include "version.h"
#include "git_sha1.h"
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index 666124e1ca6..c80b329137f 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -28,7 +28,7 @@
#include "glheader.h"
#include "api_arrayelt.h"
#include "context.h"
-#include "util/imports.h"
+
#include "mtypes.h"
#include "vtxfmt.h"
#include "eval.h"