[Mesa-dev] [V3 PATCH 1/8] mesa: 's/\bgl_format\b/mesa_format/g'. Use better name for Mesa Formats enum

Mark Mueller markkmueller at gmail.com
Thu Jan 16 22:13:35 PST 2014


This series encompases the much discussed specification and renaming of MESA_FORMATs,
which now is packed into 8 patches

Signed-off-by: Mark Mueller <MarkKMueller at gmail.com>
---
 src/gallium/state_trackers/dri/common/dri_screen.c |  4 +-
 src/mesa/drivers/common/meta.c                     |  2 +-
 src/mesa/drivers/dri/common/dri_util.c             |  4 +-
 src/mesa/drivers/dri/common/dri_util.h             |  4 +-
 src/mesa/drivers/dri/common/utils.c                |  4 +-
 src/mesa/drivers/dri/common/utils.h                |  2 +-
 src/mesa/drivers/dri/i915/i830_vtbl.c              |  2 +-
 src/mesa/drivers/dri/i915/i915_texstate.c          |  2 +-
 src/mesa/drivers/dri/i915/i915_vtbl.c              |  2 +-
 src/mesa/drivers/dri/i915/intel_blit.c             |  4 +-
 src/mesa/drivers/dri/i915/intel_fbo.c              |  8 +--
 src/mesa/drivers/dri/i915/intel_fbo.h              |  8 +--
 src/mesa/drivers/dri/i915/intel_mipmap_tree.c      | 18 +++----
 src/mesa/drivers/dri/i915/intel_mipmap_tree.h      | 14 ++---
 src/mesa/drivers/dri/i915/intel_screen.c           |  4 +-
 src/mesa/drivers/dri/i915/intel_tex_image.c        |  4 +-
 src/mesa/drivers/dri/i915/intel_tex_layout.c       |  6 +--
 src/mesa/drivers/dri/i915/intel_tex_layout.h       |  2 +-
 src/mesa/drivers/dri/i965/brw_blorp.cpp            |  2 +-
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp       | 10 ++--
 src/mesa/drivers/dri/i965/brw_blorp_clear.cpp      |  4 +-
 src/mesa/drivers/dri/i965/brw_context.h            |  2 +-
 src/mesa/drivers/dri/i965/brw_state.h              |  4 +-
 src/mesa/drivers/dri/i965/brw_surface_formats.c    | 10 ++--
 src/mesa/drivers/dri/i965/brw_tex_layout.c         |  4 +-
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c   |  4 +-
 src/mesa/drivers/dri/i965/gen7_wm_surface_state.c  |  2 +-
 src/mesa/drivers/dri/i965/intel_blit.c             |  4 +-
 src/mesa/drivers/dri/i965/intel_fbo.c              |  8 +--
 src/mesa/drivers/dri/i965/intel_fbo.h              |  8 +--
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c      | 28 +++++-----
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h      | 16 +++---
 src/mesa/drivers/dri/i965/intel_screen.c           |  4 +-
 src/mesa/drivers/dri/i965/intel_tex_image.c        |  4 +-
 src/mesa/drivers/dri/i965/intel_tex_subimage.c     |  2 +-
 src/mesa/drivers/dri/nouveau/nouveau_fbo.c         |  2 +-
 src/mesa/drivers/dri/nouveau/nouveau_screen.c      |  2 +-
 src/mesa/drivers/dri/nouveau/nouveau_surface.h     |  2 +-
 src/mesa/drivers/dri/nouveau/nouveau_texture.c     |  4 +-
 src/mesa/drivers/dri/nouveau/nouveau_util.h        | 14 ++---
 src/mesa/drivers/dri/nouveau/nv04_state_fb.c       |  2 +-
 src/mesa/drivers/dri/nouveau/nv04_state_frag.c     |  2 +-
 src/mesa/drivers/dri/nouveau/nv04_surface.c        |  8 +--
 src/mesa/drivers/dri/nouveau/nv10_state_fb.c       |  2 +-
 src/mesa/drivers/dri/nouveau/nv10_state_frag.c     |  2 +-
 src/mesa/drivers/dri/nouveau/nv20_state_fb.c       |  2 +-
 src/mesa/drivers/dri/r200/r200_blit.c              | 12 ++---
 src/mesa/drivers/dri/r200/r200_blit.h              |  6 +--
 src/mesa/drivers/dri/r200/r200_texstate.c          |  2 +-
 src/mesa/drivers/dri/radeon/radeon_blit.c          | 10 ++--
 src/mesa/drivers/dri/radeon/radeon_blit.h          |  6 +--
 src/mesa/drivers/dri/radeon/radeon_common.h        |  2 +-
 .../drivers/dri/radeon/radeon_common_context.h     |  8 +--
 src/mesa/drivers/dri/radeon/radeon_fbo.c           |  4 +-
 src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c   |  8 +--
 src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h   |  6 +--
 src/mesa/drivers/dri/radeon/radeon_pixel_read.c    |  4 +-
 src/mesa/drivers/dri/radeon/radeon_screen.c        |  4 +-
 src/mesa/drivers/dri/radeon/radeon_tex_copy.c      |  4 +-
 src/mesa/drivers/dri/radeon/radeon_texstate.c      |  2 +-
 src/mesa/drivers/dri/radeon/radeon_texture.c       | 20 ++++----
 src/mesa/drivers/dri/radeon/radeon_texture.h       | 18 +++----
 src/mesa/drivers/dri/radeon/radeon_tile.c          |  6 +--
 src/mesa/drivers/dri/radeon/radeon_tile.h          |  6 +--
 src/mesa/drivers/dri/swrast/swrast.c               |  6 +--
 src/mesa/main/blend.c                              |  6 +--
 src/mesa/main/blend.h                              |  4 +-
 src/mesa/main/bufferobj.c                          | 12 ++---
 src/mesa/main/dd.h                                 |  4 +-
 src/mesa/main/fbobject.c                           | 10 ++--
 src/mesa/main/format_pack.c                        | 30 +++++------
 src/mesa/main/format_pack.h                        | 26 +++++-----
 src/mesa/main/format_unpack.c                      | 18 +++----
 src/mesa/main/format_unpack.h                      | 16 +++---
 src/mesa/main/formats.c                            | 60 +++++++++++-----------
 src/mesa/main/formats.h                            | 48 ++++++++---------
 src/mesa/main/framebuffer.c                        | 10 ++--
 src/mesa/main/mipmap.c                             |  4 +-
 src/mesa/main/mipmap.h                             |  2 +-
 src/mesa/main/mtypes.h                             |  8 +--
 src/mesa/main/readpix.c                            |  6 +--
 src/mesa/main/shaderimage.c                        |  4 +-
 src/mesa/main/texcompress.c                        | 10 ++--
 src/mesa/main/texcompress.h                        | 10 ++--
 src/mesa/main/texcompress_etc.c                    |  4 +-
 src/mesa/main/texcompress_etc.h                    |  4 +-
 src/mesa/main/texcompress_fxt1.c                   |  2 +-
 src/mesa/main/texcompress_fxt1.h                   |  2 +-
 src/mesa/main/texcompress_rgtc.c                   |  2 +-
 src/mesa/main/texcompress_rgtc.h                   |  2 +-
 src/mesa/main/texcompress_s3tc.c                   |  2 +-
 src/mesa/main/texcompress_s3tc.h                   |  2 +-
 src/mesa/main/texformat.c                          |  4 +-
 src/mesa/main/texformat.h                          |  2 +-
 src/mesa/main/texgetimage.c                        |  4 +-
 src/mesa/main/teximage.c                           | 26 +++++-----
 src/mesa/main/teximage.h                           |  8 +--
 src/mesa/main/texobj.c                             |  2 +-
 src/mesa/main/texparam.c                           |  4 +-
 src/mesa/main/texstorage.c                         |  4 +-
 src/mesa/main/texstore.c                           | 22 ++++----
 src/mesa/main/texstore.h                           |  6 +--
 src/mesa/main/textureview.c                        |  4 +-
 src/mesa/state_tracker/st_cb_drawpixels.c          |  4 +-
 src/mesa/state_tracker/st_cb_eglimage.c            |  2 +-
 src/mesa/state_tracker/st_cb_fbo.c                 |  4 +-
 src/mesa/state_tracker/st_cb_texture.c             |  8 +--
 src/mesa/state_tracker/st_format.c                 |  8 +--
 src/mesa/state_tracker/st_format.h                 |  6 +--
 src/mesa/state_tracker/st_manager.c                |  2 +-
 src/mesa/state_tracker/st_vdpau.c                  |  2 +-
 src/mesa/swrast/s_blit.c                           |  4 +-
 src/mesa/swrast/s_stencil.c                        |  2 +-
 src/mesa/swrast/s_texfetch.c                       |  6 +--
 src/mesa/swrast/s_texrender.c                      |  2 +-
 src/mesa/swrast/s_triangle.c                       |  2 +-
 116 files changed, 416 insertions(+), 416 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index b338f64..c13b2ed 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -81,7 +81,7 @@ const __DRIconfigOptionsExtension gallium_config_options = {
 static const __DRIconfig **
 dri_fill_in_modes(struct dri_screen *screen)
 {
-   static const gl_format mesa_formats[3] = {
+   static const mesa_format mesa_formats[3] = {
       MESA_FORMAT_ARGB8888,
       MESA_FORMAT_XRGB8888,
       MESA_FORMAT_RGB565,
@@ -91,7 +91,7 @@ dri_fill_in_modes(struct dri_screen *screen)
       PIPE_FORMAT_BGRX8888_UNORM,
       PIPE_FORMAT_B5G6R5_UNORM,
    };
-   gl_format format;
+   mesa_format format;
    __DRIconfig **configs = NULL;
    uint8_t depth_bits_array[5];
    uint8_t stencil_bits_array[5];
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 1294514..d622b94 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3806,7 +3806,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
  * ReadPixels() and passed to Tex[Sub]Image().
  */
 static GLenum
-get_temp_image_type(struct gl_context *ctx, gl_format format)
+get_temp_image_type(struct gl_context *ctx, mesa_format format)
 {
    GLenum baseFormat;
 
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index d648211..e8c0d91 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -806,7 +806,7 @@ driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv)
 }
 
 uint32_t
-driGLFormatToImageFormat(gl_format format)
+driGLFormatToImageFormat(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RGB565:
@@ -836,7 +836,7 @@ driGLFormatToImageFormat(gl_format format)
    }
 }
 
-gl_format
+mesa_format
 driImageFormatToGLFormat(uint32_t image_format)
 {
    switch (image_format) {
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index a79a4ed..a37a0bb 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -281,9 +281,9 @@ struct __DRIdrawableRec {
 };
 
 extern uint32_t
-driGLFormatToImageFormat(gl_format format);
+driGLFormatToImageFormat(mesa_format format);
 
-extern gl_format
+extern mesa_format
 driImageFormatToGLFormat(uint32_t image_format);
 
 extern void
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 3e35fe2..06981c2 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -151,7 +151,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
  *                      If the function fails and returns \c GL_FALSE, this
  *                      value will be unmodified, but some elements in the
  *                      linked list may be modified.
- * \param format        Mesa gl_format enum describing the pixel format
+ * \param format        Mesa mesa_format enum describing the pixel format
  * \param depth_bits    Array of depth buffer sizes to be exposed.
  * \param stencil_bits  Array of stencil buffer sizes to be exposed.
  * \param num_depth_stencil_bits  Number of entries in both \c depth_bits and
@@ -176,7 +176,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
  * \c format).
  */
 __DRIconfig **
-driCreateConfigs(gl_format format,
+driCreateConfigs(mesa_format format,
 		 const uint8_t * depth_bits, const uint8_t * stencil_bits,
 		 unsigned num_depth_stencil_bits,
 		 const GLenum * db_modes, unsigned num_db_modes,
diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h
index 22af123..0941434 100644
--- a/src/mesa/drivers/dri/common/utils.h
+++ b/src/mesa/drivers/dri/common/utils.h
@@ -48,7 +48,7 @@ struct __DRIconfigRec {
 };
 
 extern __DRIconfig **
-driCreateConfigs(gl_format format,
+driCreateConfigs(mesa_format format,
 		 const uint8_t * depth_bits, const uint8_t * stencil_bits,
 		 unsigned num_depth_stencil_bits,
 		 const GLenum * db_modes, unsigned num_db_modes,
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 4a9ea56..553cc3e 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -593,7 +593,7 @@ static bool
 i830_render_target_supported(struct intel_context *intel,
 			     struct gl_renderbuffer *rb)
 {
-   gl_format format = rb->Format;
+   mesa_format format = rb->Format;
 
    if (format == MESA_FORMAT_S8_Z24 ||
        format == MESA_FORMAT_X8_Z24 ||
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 43c802b..594fa55 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -39,7 +39,7 @@
 
 
 static GLuint
-translate_texture_format(gl_format mesa_format, GLenum DepthMode)
+translate_texture_format(mesa_format mesa_format, GLenum DepthMode)
 {
    switch (mesa_format) {
    case MESA_FORMAT_L8:
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index d9675c1..382c221 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -560,7 +560,7 @@ static bool
 i915_render_target_supported(struct intel_context *intel,
 			     struct gl_renderbuffer *rb)
 {
-   gl_format format = rb->Format;
+   mesa_format format = rb->Format;
 
    if (format == MESA_FORMAT_S8_Z24 ||
        format == MESA_FORMAT_X8_Z24 ||
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c
index 5147d8e..6680ccd 100644
--- a/src/mesa/drivers/dri/i915/intel_blit.c
+++ b/src/mesa/drivers/dri/i915/intel_blit.c
@@ -120,8 +120,8 @@ intel_miptree_blit(struct intel_context *intel,
     * consistent with what we want in the callers (glCopyTexSubImage(),
     * glBlitFramebuffer(), texture validation, etc.).
     */
-   gl_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
-   gl_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
+   mesa_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
+   mesa_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
 
    /* The blitter doesn't support doing any format conversions.  We do also
     * support blitting ARGB8888 to XRGB8888 (trivial, the values dropped into
diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c
index 36b22ca..250c11d 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -303,7 +303,7 @@ intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
  * not a user-created renderbuffer.
  */
 struct intel_renderbuffer *
-intel_create_renderbuffer(gl_format format)
+intel_create_renderbuffer(mesa_format format)
 {
    struct intel_renderbuffer *irb;
    struct gl_renderbuffer *rb;
@@ -338,7 +338,7 @@ intel_create_renderbuffer(gl_format format)
  * may be called at intel_update_renderbuffers() time.
  */
 struct intel_renderbuffer *
-intel_create_private_renderbuffer(gl_format format)
+intel_create_private_renderbuffer(mesa_format format)
 {
    struct intel_renderbuffer *irb;
 
@@ -682,8 +682,8 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
             return mask;
          }
 
-         gl_format src_format = _mesa_get_srgb_format_linear(src_rb->Format);
-         gl_format dst_format = _mesa_get_srgb_format_linear(dst_rb->Format);
+         mesa_format src_format = _mesa_get_srgb_format_linear(src_rb->Format);
+         mesa_format dst_format = _mesa_get_srgb_format_linear(dst_rb->Format);
          if (src_format != dst_format) {
             perf_debug("glBlitFramebuffer(): unsupported blit from %s to %s.  "
                        "Falling back to software rendering.\n",
diff --git a/src/mesa/drivers/dri/i915/intel_fbo.h b/src/mesa/drivers/dri/i915/intel_fbo.h
index bd0aae0..ae0505f 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.h
+++ b/src/mesa/drivers/dri/i915/intel_fbo.h
@@ -121,22 +121,22 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, gl_buffer_index attIndex)
 }
 
 
-static INLINE gl_format
+static INLINE mesa_format
 intel_rb_format(const struct intel_renderbuffer *rb)
 {
    return rb->Base.Base.Format;
 }
 
 extern struct intel_renderbuffer *
-intel_create_renderbuffer(gl_format format);
+intel_create_renderbuffer(mesa_format format);
 
 struct intel_renderbuffer *
-intel_create_private_renderbuffer(gl_format format);
+intel_create_private_renderbuffer(mesa_format format);
 
 struct gl_renderbuffer*
 intel_create_wrapped_renderbuffer(struct gl_context * ctx,
 				  int width, int height,
-				  gl_format format);
+				  mesa_format format);
 
 extern void
 intel_fbo_init(struct intel_context *intel);
diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
index f0ad30c..86c2bb3 100644
--- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
@@ -68,7 +68,7 @@ target_to_target(GLenum target)
 struct intel_mipmap_tree *
 intel_miptree_create_layout(struct intel_context *intel,
                             GLenum target,
-                            gl_format format,
+                            mesa_format format,
                             GLuint first_level,
                             GLuint last_level,
                             GLuint width0,
@@ -130,7 +130,7 @@ intel_miptree_create_layout(struct intel_context *intel,
  */
 static uint32_t
 intel_miptree_choose_tiling(struct intel_context *intel,
-                            gl_format format,
+                            mesa_format format,
                             uint32_t width0,
                             enum intel_miptree_tiling_mode requested,
                             struct intel_mipmap_tree *mt)
@@ -166,7 +166,7 @@ intel_miptree_choose_tiling(struct intel_context *intel,
 struct intel_mipmap_tree *
 intel_miptree_create(struct intel_context *intel,
 		     GLenum target,
-		     gl_format format,
+		     mesa_format format,
 		     GLuint first_level,
 		     GLuint last_level,
 		     GLuint width0,
@@ -236,7 +236,7 @@ intel_miptree_create(struct intel_context *intel,
 struct intel_mipmap_tree *
 intel_miptree_create_for_bo(struct intel_context *intel,
                             drm_intel_bo *bo,
-                            gl_format format,
+                            mesa_format format,
                             uint32_t offset,
                             uint32_t width,
                             uint32_t height,
@@ -295,7 +295,7 @@ intel_miptree_create_for_bo(struct intel_context *intel,
 struct intel_mipmap_tree*
 intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
                                      unsigned dri_attachment,
-                                     gl_format format,
+                                     mesa_format format,
                                      struct intel_region *region)
 {
    struct intel_mipmap_tree *mt = NULL;
@@ -334,7 +334,7 @@ intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
 struct intel_mipmap_tree*
 intel_miptree_create_for_image_buffer(struct intel_context *intel,
                                       enum __DRIimageBufferMask buffer_type,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t num_samples,
                                       struct intel_region *region)
 {
@@ -359,7 +359,7 @@ intel_miptree_create_for_image_buffer(struct intel_context *intel,
 
 struct intel_mipmap_tree*
 intel_miptree_create_for_renderbuffer(struct intel_context *intel,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t width,
                                       uint32_t height)
 {
@@ -449,7 +449,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
     */
    assert(target_to_target(image->TexObject->Target) == mt->target);
 
-   gl_format mt_format = mt->format;
+   mesa_format mt_format = mt->format;
 
    if (image->TexFormat != mt_format)
       return false;
@@ -629,7 +629,7 @@ intel_miptree_copy_slice(struct intel_context *intel,
 			 int depth)
 
 {
-   gl_format format = src_mt->format;
+   mesa_format format = src_mt->format;
    uint32_t width = src_mt->level[level].width;
    uint32_t height = src_mt->level[level].height;
    int slice;
diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.h b/src/mesa/drivers/dri/i915/intel_mipmap_tree.h
index 35cad6d..0f525a8 100644
--- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.h
@@ -149,7 +149,7 @@ struct intel_mipmap_tree
     * This is just the same as the gl_texture_image->TexFormat or
     * gl_renderbuffer->Format.
     */
-   gl_format format;
+   mesa_format format;
 
    /**
     * The X offset of each image in the miptree must be aligned to this. See
@@ -223,7 +223,7 @@ enum intel_miptree_tiling_mode {
 
 struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
                                                GLenum target,
-					       gl_format format,
+					       mesa_format format,
                                                GLuint first_level,
                                                GLuint last_level,
                                                GLuint width0,
@@ -235,7 +235,7 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
 struct intel_mipmap_tree *
 intel_miptree_create_layout(struct intel_context *intel,
                             GLenum target,
-                            gl_format format,
+                            mesa_format format,
                             GLuint first_level,
                             GLuint last_level,
                             GLuint width0,
@@ -246,7 +246,7 @@ intel_miptree_create_layout(struct intel_context *intel,
 struct intel_mipmap_tree *
 intel_miptree_create_for_bo(struct intel_context *intel,
                             drm_intel_bo *bo,
-                            gl_format format,
+                            mesa_format format,
                             uint32_t offset,
                             uint32_t width,
                             uint32_t height,
@@ -256,13 +256,13 @@ intel_miptree_create_for_bo(struct intel_context *intel,
 struct intel_mipmap_tree*
 intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
                                      unsigned dri_attachment,
-                                     gl_format format,
+                                     mesa_format format,
                                      struct intel_region *region);
 
 struct intel_mipmap_tree*
 intel_miptree_create_for_image_buffer(struct intel_context *intel,
                                       enum __DRIimageBufferMask buffer_type,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t num_samples,
                                       struct intel_region *region);
 
@@ -275,7 +275,7 @@ intel_miptree_create_for_image_buffer(struct intel_context *intel,
  */
 struct intel_mipmap_tree*
 intel_miptree_create_for_renderbuffer(struct intel_context *intel,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t width,
                                       uint32_t height);
 
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index d607f47..aff58ad 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -844,7 +844,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
                   const struct gl_config * mesaVis, GLboolean isPixmap)
 {
    struct intel_renderbuffer *rb;
-   gl_format rgbFormat;
+   mesa_format rgbFormat;
    struct gl_framebuffer *fb;
 
    if (isPixmap)
@@ -1042,7 +1042,7 @@ intel_detect_swizzling(struct intel_screen *screen)
 static __DRIconfig**
 intel_screen_make_configs(__DRIscreen *dri_screen)
 {
-   static const gl_format formats[] = {
+   static const mesa_format formats[] = {
       MESA_FORMAT_RGB565,
       MESA_FORMAT_ARGB8888
    };
diff --git a/src/mesa/drivers/dri/i915/intel_tex_image.c b/src/mesa/drivers/dri/i915/intel_tex_image.c
index 975e77a..fc23a5e 100644
--- a/src/mesa/drivers/dri/i915/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i915/intel_tex_image.c
@@ -219,7 +219,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
 			       struct intel_region *region,
 			       GLenum target,
 			       GLenum internalFormat,
-			       gl_format format,
+			       mesa_format format,
                                uint32_t offset,
                                GLuint width,
                                GLuint height,
@@ -287,7 +287,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    struct gl_texture_object *texObj;
    struct gl_texture_image *texImage;
    int level = 0, internalFormat = 0;
-   gl_format texFormat = MESA_FORMAT_NONE;
+   mesa_format texFormat = MESA_FORMAT_NONE;
 
    texObj = _mesa_get_current_tex_object(ctx, target);
    intelObj = intel_texture_object(texObj);
diff --git a/src/mesa/drivers/dri/i915/intel_tex_layout.c b/src/mesa/drivers/dri/i915/intel_tex_layout.c
index 8a6a444..64d6f59 100644
--- a/src/mesa/drivers/dri/i915/intel_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/intel_tex_layout.c
@@ -39,7 +39,7 @@
 
 static unsigned int
 intel_horizontal_texture_alignment_unit(struct intel_context *intel,
-                                       gl_format format)
+                                       mesa_format format)
 {
    /**
     * From the "Alignment Unit Size" section of various specs, namely:
@@ -79,7 +79,7 @@ intel_horizontal_texture_alignment_unit(struct intel_context *intel,
 
 static unsigned int
 intel_vertical_texture_alignment_unit(struct intel_context *intel,
-                                     gl_format format)
+                                     mesa_format format)
 {
    /**
     * From the "Alignment Unit Size" section of various specs, namely:
@@ -114,7 +114,7 @@ intel_vertical_texture_alignment_unit(struct intel_context *intel,
 
 void
 intel_get_texture_alignment_unit(struct intel_context *intel,
-				 gl_format format,
+				 mesa_format format,
 				 unsigned int *w, unsigned int *h)
 {
    *w = intel_horizontal_texture_alignment_unit(intel, format);
diff --git a/src/mesa/drivers/dri/i915/intel_tex_layout.h b/src/mesa/drivers/dri/i915/intel_tex_layout.h
index f353cf4..e2c0417 100644
--- a/src/mesa/drivers/dri/i915/intel_tex_layout.h
+++ b/src/mesa/drivers/dri/i915/intel_tex_layout.h
@@ -36,5 +36,5 @@ extern void i945_miptree_layout_2d(struct intel_mipmap_tree *mt);
 
 void
 intel_get_texture_alignment_unit(struct intel_context *intel,
-				 gl_format format,
+				 mesa_format format,
 				 unsigned int *w, unsigned int *h);
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp
index 0939a31..e7f6328 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp
@@ -115,7 +115,7 @@ brw_blorp_surface_info::set(struct brw_context *brw,
       this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM;
       break;
    default: {
-      gl_format linear_format = _mesa_get_srgb_format_linear(mt->format);
+      mesa_format linear_format = _mesa_get_srgb_format_linear(mt->format);
       if (is_render_target) {
          assert(brw->format_supported_as_render_target[linear_format]);
          this->brw_surfaceformat = brw->render_target_format[linear_format];
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 112a307..0cc7f62 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -199,10 +199,10 @@ do_blorp_blit(struct brw_context *brw, GLbitfield buffer_bit,
 }
 
 static bool
-color_formats_match(gl_format src_format, gl_format dst_format)
+color_formats_match(mesa_format src_format, mesa_format dst_format)
 {
-   gl_format linear_src_format = _mesa_get_srgb_format_linear(src_format);
-   gl_format linear_dst_format = _mesa_get_srgb_format_linear(dst_format);
+   mesa_format linear_src_format = _mesa_get_srgb_format_linear(src_format);
+   mesa_format linear_dst_format = _mesa_get_srgb_format_linear(dst_format);
 
    /* Normally, we require the formats to be equal.  However, we also support
     * blitting from ARGB to XRGB (discarding alpha), and from XRGB to ARGB
@@ -224,8 +224,8 @@ formats_match(GLbitfield buffer_bit, struct intel_renderbuffer *src_irb,
     * example MESA_FORMAT_X8_Z24 and MESA_FORMAT_S8_Z24), and we can blit
     * between those formats.
     */
-   gl_format src_format = find_miptree(buffer_bit, src_irb)->format;
-   gl_format dst_format = find_miptree(buffer_bit, dst_irb)->format;
+   mesa_format src_format = find_miptree(buffer_bit, src_irb)->format;
+   mesa_format dst_format = find_miptree(buffer_bit, dst_irb)->format;
 
    return color_formats_match(src_format, dst_format);
 }
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index c55108a..94672e0 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -147,7 +147,7 @@ brw_blorp_const_color_program::~brw_blorp_const_color_program()
  */
 static bool
 is_color_fast_clear_compatible(struct brw_context *brw,
-                               gl_format format,
+                               mesa_format format,
                                const union gl_color_union *color)
 {
    if (_mesa_is_format_integer_color(format))
@@ -193,7 +193,7 @@ brw_blorp_clear_params::brw_blorp_clear_params(struct brw_context *brw,
    dst.set(brw, irb->mt, irb->mt_level, layer, true);
 
    /* Override the surface format according to the context's sRGB rules. */
-   gl_format format = _mesa_get_render_format(ctx, irb->mt->format);
+   mesa_format format = _mesa_get_render_format(ctx, irb->mt->format);
    dst.brw_surfaceformat = brw->render_target_format[format];
 
    x0 = fb->_Xmin;
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 63dd4a0..86f2b64 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1643,7 +1643,7 @@ void brw_upload_abo_surfaces(struct brw_context *brw,
                              struct brw_stage_prog_data *prog_data);
 
 /* brw_surface_formats.c */
-bool brw_is_hiz_depth_format(struct brw_context *ctx, gl_format format);
+bool brw_is_hiz_depth_format(struct brw_context *ctx, mesa_format format);
 bool brw_render_target_supported(struct brw_context *brw,
                                  struct gl_renderbuffer *rb);
 
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index e9428fb..ac1227d 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -188,12 +188,12 @@ void gen4_init_vtable_surface_functions(struct brw_context *brw);
 uint32_t brw_get_surface_tiling_bits(uint32_t tiling);
 uint32_t brw_get_surface_num_multisamples(unsigned num_samples);
 
-uint32_t brw_format_for_mesa_format(gl_format mesa_format);
+uint32_t brw_format_for_mesa_format(mesa_format mesa_format);
 
 GLuint translate_tex_target(GLenum target);
 
 GLuint translate_tex_format(struct brw_context *brw,
-                            gl_format mesa_format,
+                            mesa_format mesa_format,
 			    GLenum srgb_decode);
 
 int brw_get_texture_swizzle(const struct gl_context *ctx,
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
index 9b75c2b..ebbd335 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -310,7 +310,7 @@ const struct surface_format_info surface_formats[] = {
 #undef Y
 
 uint32_t
-brw_format_for_mesa_format(gl_format mesa_format)
+brw_format_for_mesa_format(mesa_format mesa_format)
 {
    /* This table is ordered according to the enum ordering in formats.h.  We do
     * expect that enum to be extended without our explicit initialization
@@ -530,7 +530,7 @@ brw_init_surface_formats(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->ctx;
    int gen;
-   gl_format format;
+   mesa_format format;
 
    memset(&ctx->TextureFormatSupported, 0, sizeof(ctx->TextureFormatSupported));
 
@@ -654,7 +654,7 @@ bool
 brw_render_target_supported(struct brw_context *brw,
 			    struct gl_renderbuffer *rb)
 {
-   gl_format format = rb->Format;
+   mesa_format format = rb->Format;
 
    /* Many integer formats are promoted to RGBA (like XRGB8888 is), which means
     * we would consider them renderable even though we don't have surface
@@ -685,7 +685,7 @@ brw_render_target_supported(struct brw_context *brw,
 
 GLuint
 translate_tex_format(struct brw_context *brw,
-                     gl_format mesa_format,
+                     mesa_format mesa_format,
 		     GLenum srgb_decode)
 {
    struct gl_context *ctx = &brw->ctx;
@@ -732,7 +732,7 @@ translate_tex_format(struct brw_context *brw,
 
 /** Can HiZ be enabled on a depthbuffer of the given format? */
 bool
-brw_is_hiz_depth_format(struct brw_context *brw, gl_format format)
+brw_is_hiz_depth_format(struct brw_context *brw, mesa_format format)
 {
    if (!brw->has_hiz)
       return false;
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index a0f584b..a298580 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -40,7 +40,7 @@
 
 static unsigned int
 intel_horizontal_texture_alignment_unit(struct brw_context *brw,
-                                       gl_format format)
+                                       mesa_format format)
 {
    /**
     * From the "Alignment Unit Size" section of various specs, namely:
@@ -86,7 +86,7 @@ intel_horizontal_texture_alignment_unit(struct brw_context *brw,
 
 static unsigned int
 intel_vertical_texture_alignment_unit(struct brw_context *brw,
-                                      gl_format format, bool multisampled)
+                                      mesa_format format, bool multisampled)
 {
    /**
     * From the "Alignment Unit Size" section of various specs, namely:
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index e837631..32ce16c 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -237,7 +237,7 @@ brw_update_buffer_texture_surface(struct gl_context *ctx,
       intel_buffer_object(tObj->BufferObject);
    uint32_t size = tObj->BufferSize;
    drm_intel_bo *bo = NULL;
-   gl_format format = tObj->_BufferObjectFormat;
+   mesa_format format = tObj->_BufferObjectFormat;
    uint32_t brw_format = brw_format_for_mesa_format(format);
    int texel_size = _mesa_get_format_bytes(format);
 
@@ -596,7 +596,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
    uint32_t tile_x, tile_y;
    uint32_t format = 0;
    /* _NEW_BUFFERS */
-   gl_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
+   mesa_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
    uint32_t surf_index =
       brw->wm.prog_data->binding_table.render_target_start + unit;
 
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
index 761bc3b..7f731b7 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -441,7 +441,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw,
    struct intel_region *region = irb->mt->region;
    uint32_t format;
    /* _NEW_BUFFERS */
-   gl_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
+   mesa_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
    uint32_t surftype;
    bool is_array = false;
    int depth = MAX2(rb->Depth, 1);
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 330bac4..6ea35ae 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -162,8 +162,8 @@ intel_miptree_blit(struct brw_context *brw,
     * consistent with what we want in the callers (glCopyTexSubImage(),
     * glBlitFramebuffer(), texture validation, etc.).
     */
-   gl_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
-   gl_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
+   mesa_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
+   mesa_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
 
    /* The blitter doesn't support doing any format conversions.  We do also
     * support blitting ARGB8888 to XRGB8888 (trivial, the values dropped into
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index d3b9dcf..e6cc90c 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -335,7 +335,7 @@ intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
  * \param num_samples must be quantized.
  */
 struct intel_renderbuffer *
-intel_create_renderbuffer(gl_format format, unsigned num_samples)
+intel_create_renderbuffer(mesa_format format, unsigned num_samples)
 {
    struct intel_renderbuffer *irb;
    struct gl_renderbuffer *rb;
@@ -373,7 +373,7 @@ intel_create_renderbuffer(gl_format format, unsigned num_samples)
  * \param num_samples must be quantized.
  */
 struct intel_renderbuffer *
-intel_create_private_renderbuffer(gl_format format, unsigned num_samples)
+intel_create_private_renderbuffer(mesa_format format, unsigned num_samples)
 {
    struct intel_renderbuffer *irb;
 
@@ -739,8 +739,8 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
             return mask;
          }
 
-         gl_format src_format = _mesa_get_srgb_format_linear(src_rb->Format);
-         gl_format dst_format = _mesa_get_srgb_format_linear(dst_rb->Format);
+         mesa_format src_format = _mesa_get_srgb_format_linear(src_rb->Format);
+         mesa_format dst_format = _mesa_get_srgb_format_linear(dst_rb->Format);
          if (src_format != dst_format) {
             perf_debug("glBlitFramebuffer(): unsupported blit from %s to %s.  "
                        "Falling back to software rendering.\n",
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.h b/src/mesa/drivers/dri/i965/intel_fbo.h
index fb50f86..7c4b077 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.h
+++ b/src/mesa/drivers/dri/i965/intel_fbo.h
@@ -125,22 +125,22 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, gl_buffer_index attIndex)
 }
 
 
-static inline gl_format
+static inline mesa_format
 intel_rb_format(const struct intel_renderbuffer *rb)
 {
    return rb->Base.Base.Format;
 }
 
 extern struct intel_renderbuffer *
-intel_create_renderbuffer(gl_format format, unsigned num_samples);
+intel_create_renderbuffer(mesa_format format, unsigned num_samples);
 
 struct intel_renderbuffer *
-intel_create_private_renderbuffer(gl_format format, unsigned num_samples);
+intel_create_private_renderbuffer(mesa_format format, unsigned num_samples);
 
 struct gl_renderbuffer*
 intel_create_wrapped_renderbuffer(struct gl_context * ctx,
 				  int width, int height,
-				  gl_format format);
+				  mesa_format format);
 
 extern void
 intel_fbo_init(struct brw_context *brw);
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index ea929d4..b29aefe 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -70,7 +70,7 @@ target_to_target(GLenum target)
  * created, based on the chip generation and the surface type.
  */
 static enum intel_msaa_layout
-compute_msaa_layout(struct brw_context *brw, gl_format format, GLenum target)
+compute_msaa_layout(struct brw_context *brw, mesa_format format, GLenum target)
 {
    /* Prior to Gen7, all MSAA surfaces used IMS layout. */
    if (brw->gen < 7)
@@ -225,7 +225,7 @@ intel_is_non_msrt_mcs_buffer_supported(struct brw_context *brw,
 struct intel_mipmap_tree *
 intel_miptree_create_layout(struct brw_context *brw,
                             GLenum target,
-                            gl_format format,
+                            mesa_format format,
                             GLuint first_level,
                             GLuint last_level,
                             GLuint width0,
@@ -391,7 +391,7 @@ intel_miptree_create_layout(struct brw_context *brw,
  */
 static uint32_t
 intel_miptree_choose_tiling(struct brw_context *brw,
-                            gl_format format,
+                            mesa_format format,
                             uint32_t width0,
                             uint32_t num_samples,
                             enum intel_miptree_tiling_mode requested,
@@ -486,7 +486,7 @@ intel_miptree_choose_tiling(struct brw_context *brw,
 struct intel_mipmap_tree *
 intel_miptree_create(struct brw_context *brw,
 		     GLenum target,
-		     gl_format format,
+		     mesa_format format,
 		     GLuint first_level,
 		     GLuint last_level,
 		     GLuint width0,
@@ -497,8 +497,8 @@ intel_miptree_create(struct brw_context *brw,
                      enum intel_miptree_tiling_mode requested_tiling)
 {
    struct intel_mipmap_tree *mt;
-   gl_format tex_format = format;
-   gl_format etc_format = MESA_FORMAT_NONE;
+   mesa_format tex_format = format;
+   mesa_format etc_format = MESA_FORMAT_NONE;
    GLuint total_width, total_height;
 
    if (brw->gen < 8 && !brw->is_baytrail) {
@@ -618,7 +618,7 @@ intel_miptree_create(struct brw_context *brw,
 struct intel_mipmap_tree *
 intel_miptree_create_for_bo(struct brw_context *brw,
                             drm_intel_bo *bo,
-                            gl_format format,
+                            mesa_format format,
                             uint32_t offset,
                             uint32_t width,
                             uint32_t height,
@@ -677,7 +677,7 @@ intel_miptree_create_for_bo(struct brw_context *brw,
 struct intel_mipmap_tree*
 intel_miptree_create_for_dri2_buffer(struct brw_context *brw,
                                      unsigned dri_attachment,
-                                     gl_format format,
+                                     mesa_format format,
                                      uint32_t num_samples,
                                      struct intel_region *region)
 {
@@ -748,7 +748,7 @@ intel_miptree_create_for_dri2_buffer(struct brw_context *brw,
 struct intel_mipmap_tree*
 intel_miptree_create_for_image_buffer(struct brw_context *intel,
                                       enum __DRIimageBufferMask buffer_type,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t num_samples,
                                       struct intel_region *region)
 {
@@ -805,7 +805,7 @@ intel_miptree_create_for_image_buffer(struct brw_context *intel,
 
 struct intel_mipmap_tree*
 intel_miptree_create_for_renderbuffer(struct brw_context *brw,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t width,
                                       uint32_t height,
                                       uint32_t num_samples)
@@ -917,7 +917,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
     */
    assert(target_to_target(image->TexObject->Target) == mt->target);
 
-   gl_format mt_format = mt->format;
+   mesa_format mt_format = mt->format;
    if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt)
       mt_format = MESA_FORMAT_S8_Z24;
    if (mt->format == MESA_FORMAT_Z32_FLOAT && mt->stencil_mt)
@@ -1118,7 +1118,7 @@ intel_miptree_copy_slice(struct brw_context *brw,
 			 int depth)
 
 {
-   gl_format format = src_mt->format;
+   mesa_format format = src_mt->format;
    uint32_t width = src_mt->level[level].width;
    uint32_t height = src_mt->level[level].height;
    int slice;
@@ -1215,7 +1215,7 @@ intel_miptree_alloc_mcs(struct brw_context *brw,
     * accessing this miptree using MCS-specific hardware mechanisms, which
     * infer the correct format based on num_samples.
     */
-   gl_format format;
+   mesa_format format;
    switch (num_samples) {
    case 4:
       /* 8 bits/pixel are required for MCS data when using 4x MSAA (2 bits for
@@ -1284,7 +1284,7 @@ intel_miptree_alloc_non_msrt_mcs(struct brw_context *brw,
     * we'll need to scale the height down by the block height and then a
     * further factor of 8.
     */
-   const gl_format format = MESA_FORMAT_R_UINT32;
+   const mesa_format format = MESA_FORMAT_R_UINT32;
    unsigned block_width_px;
    unsigned block_height;
    intel_get_non_msrt_mcs_alignment(brw, mt, &block_width_px, &block_height);
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 329eeb0..a5ac2bf 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -285,10 +285,10 @@ struct intel_mipmap_tree
     * For ETC1/ETC2 textures, this is one of the uncompressed mesa texture
     * formats if the hardware lacks support for ETC1/ETC2. See @ref wraps_etc.
     */
-   gl_format format;
+   mesa_format format;
 
    /** This variable stores the value of ETC compressed texture format */
-   gl_format etc_format;
+   mesa_format etc_format;
 
    /**
     * The X offset of each image in the miptree must be aligned to this.
@@ -494,7 +494,7 @@ intel_miptree_alloc_non_msrt_mcs(struct brw_context *brw,
 
 struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
                                                GLenum target,
-					       gl_format format,
+					       mesa_format format,
                                                GLuint first_level,
                                                GLuint last_level,
                                                GLuint width0,
@@ -507,7 +507,7 @@ struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
 struct intel_mipmap_tree *
 intel_miptree_create_layout(struct brw_context *brw,
                             GLenum target,
-                            gl_format format,
+                            mesa_format format,
                             GLuint first_level,
                             GLuint last_level,
                             GLuint width0,
@@ -519,7 +519,7 @@ intel_miptree_create_layout(struct brw_context *brw,
 struct intel_mipmap_tree *
 intel_miptree_create_for_bo(struct brw_context *brw,
                             drm_intel_bo *bo,
-                            gl_format format,
+                            mesa_format format,
                             uint32_t offset,
                             uint32_t width,
                             uint32_t height,
@@ -529,14 +529,14 @@ intel_miptree_create_for_bo(struct brw_context *brw,
 struct intel_mipmap_tree*
 intel_miptree_create_for_dri2_buffer(struct brw_context *brw,
                                      unsigned dri_attachment,
-                                     gl_format format,
+                                     mesa_format format,
                                      uint32_t num_samples,
                                      struct intel_region *region);
 
 struct intel_mipmap_tree*
 intel_miptree_create_for_image_buffer(struct brw_context *intel,
                                      enum __DRIimageBufferMask buffer_type,
-                                     gl_format format,
+                                     mesa_format format,
                                      uint32_t num_samples,
                                      struct intel_region *region);
 
@@ -549,7 +549,7 @@ intel_miptree_create_for_image_buffer(struct brw_context *intel,
  */
 struct intel_mipmap_tree*
 intel_miptree_create_for_renderbuffer(struct brw_context *brw,
-                                      gl_format format,
+                                      mesa_format format,
                                       uint32_t width,
                                       uint32_t height,
                                       uint32_t num_samples);
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 4373685..9fcd690 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -962,7 +962,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
 {
    struct intel_renderbuffer *rb;
    struct intel_screen *screen = (struct intel_screen*) driScrnPriv->driverPrivate;
-   gl_format rgbFormat;
+   mesa_format rgbFormat;
    unsigned num_samples = intel_quantize_num_samples(screen, mesaVis->samples);
    struct gl_framebuffer *fb;
 
@@ -1124,7 +1124,7 @@ intel_supported_msaa_modes(const struct intel_screen  *screen)
 static __DRIconfig**
 intel_screen_make_configs(__DRIscreen *dri_screen)
 {
-   static const gl_format formats[] = {
+   static const mesa_format formats[] = {
       MESA_FORMAT_RGB565,
       MESA_FORMAT_ARGB8888
    };
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index cc50f84..b774efe 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -211,7 +211,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
 			       struct intel_region *region,
 			       GLenum target,
 			       GLenum internalFormat,
-			       gl_format format,
+			       mesa_format format,
                                uint32_t offset,
                                GLuint width,
                                GLuint height,
@@ -278,7 +278,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    struct gl_texture_object *texObj;
    struct gl_texture_image *texImage;
    int level = 0, internalFormat = 0;
-   gl_format texFormat = MESA_FORMAT_NONE;
+   mesa_format texFormat = MESA_FORMAT_NONE;
 
    texObj = _mesa_get_current_tex_object(ctx, target);
    intelObj = intel_texture_object(texObj);
diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index 202ab66..ef6a5e5 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -628,7 +628,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
     * the function.
     */
    DBG("%s: level=%d offset=(%d,%d) (w,h)=(%d,%d) format=0x%x type=0x%x "
-       "gl_format=0x%x tiling=%d "
+       "mesa_format=0x%x tiling=%d "
        "packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d) "
        "for_glTexImage=%d\n",
        __FUNCTION__, texImage->Level, xoffset, yoffset, width, height,
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
index 81e7d62..43651bf 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
@@ -269,7 +269,7 @@ nouveau_finish_render_texture(struct gl_context *ctx,
 }
 
 static int
-validate_format_bpp(gl_format format)
+validate_format_bpp(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_XRGB8888:
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index ce98242..7117f51 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -52,7 +52,7 @@ nouveau_get_configs(void)
 	const uint8_t stencil_bits[] = { 0,  0,  0,  8 };
 	const uint8_t msaa_samples[] = { 0 };
 
-	static const gl_format formats[3] = {
+	static const mesa_format formats[3] = {
 		MESA_FORMAT_RGB565,
 		MESA_FORMAT_ARGB8888,
 		MESA_FORMAT_XRGB8888,
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_surface.h b/src/mesa/drivers/dri/nouveau/nouveau_surface.h
index 8915ee4..3e80206 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_surface.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_surface.h
@@ -39,7 +39,7 @@ struct nouveau_surface {
 
 	enum nouveau_surface_layout layout;
 
-	gl_format format;
+	mesa_format format;
 	unsigned cpp, pitch;
 
 	unsigned width, height;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index 8904389..dfa6d12 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -160,7 +160,7 @@ nouveau_unmap_texture_image(struct gl_context *ctx, struct gl_texture_image *ti,
 	}
 }
 
-static gl_format
+static mesa_format
 nouveau_choose_tex_format(struct gl_context *ctx, GLenum target,
                           GLint internalFormat,
 			  GLenum srcFormat, GLenum srcType)
@@ -581,7 +581,7 @@ nouveau_bind_texture(struct gl_context *ctx, GLenum target,
 	context_dirty_i(ctx, TEX_ENV, ctx->Texture.CurrentUnit);
 }
 
-static gl_format
+static mesa_format
 get_texbuffer_format(struct gl_renderbuffer *rb, GLint format)
 {
 	struct nouveau_surface *s = &to_nouveau_renderbuffer(rb)->surface;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_util.h b/src/mesa/drivers/dri/nouveau/nouveau_util.h
index 17d6965..8d0c269 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_util.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_util.h
@@ -31,7 +31,7 @@
 #include "main/colormac.h"
 
 static inline unsigned
-pack_rgba_i(gl_format f, uint8_t c[])
+pack_rgba_i(mesa_format f, uint8_t c[])
 {
 	switch (f) {
 	case MESA_FORMAT_ARGB8888:
@@ -54,7 +54,7 @@ pack_rgba_i(gl_format f, uint8_t c[])
 }
 
 static inline unsigned
-pack_zs_i(gl_format f, uint32_t z, uint8_t s)
+pack_zs_i(mesa_format f, uint32_t z, uint8_t s)
 {
 	switch (f) {
 	case MESA_FORMAT_Z24_S8:
@@ -69,7 +69,7 @@ pack_zs_i(gl_format f, uint32_t z, uint8_t s)
 }
 
 static inline unsigned
-pack_rgba_f(gl_format f, float c[])
+pack_rgba_f(mesa_format f, float c[])
 {
 	return pack_rgba_i(f, (uint8_t []) {
 			   FLOAT_TO_UBYTE(c[RCOMP]),
@@ -79,7 +79,7 @@ pack_rgba_f(gl_format f, float c[])
 }
 
 static inline unsigned
-pack_rgba_clamp_f(gl_format f, float c[])
+pack_rgba_clamp_f(mesa_format f, float c[])
 {
 	GLubyte bytes[4];
 	_mesa_unclamped_float_rgba_to_ubyte(bytes, c);
@@ -87,7 +87,7 @@ pack_rgba_clamp_f(gl_format f, float c[])
 }
 
 static inline unsigned
-pack_zs_f(gl_format f, float z, uint8_t s)
+pack_zs_f(mesa_format f, float z, uint8_t s)
 {
 	return pack_zs_i(f, FLOAT_TO_UINT(z), s);
 }
@@ -208,7 +208,7 @@ get_texgen_coeff(struct gl_texgen *c)
 }
 
 static inline unsigned
-get_format_blocksx(gl_format format,
+get_format_blocksx(mesa_format format,
 		       unsigned x)
 {
 	GLuint blockwidth;
@@ -218,7 +218,7 @@ get_format_blocksx(gl_format format,
 }
 
 static inline unsigned
-get_format_blocksy(gl_format format,
+get_format_blocksy(mesa_format format,
 		       unsigned y)
 {
 	GLuint blockwidth;
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
index 6129b6d..fcf9fdf 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
@@ -32,7 +32,7 @@
 #include "nv04_driver.h"
 
 static inline unsigned
-get_rt_format(gl_format format)
+get_rt_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_XRGB8888:
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
index 85d8166..d0245da 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
@@ -139,7 +139,7 @@ get_input_arg(struct combiner_state *rc, int arg, int flags)
 		int i = (source == GL_TEXTURE ?
 			 rc->unit : source - GL_TEXTURE0);
 		struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
-		gl_format format = t->Image[0][t->BaseLevel]->TexFormat;
+		mesa_format format = t->Image[0][t->BaseLevel]->TexFormat;
 
 		if (format == MESA_FORMAT_A8) {
 			/* Emulated using I8. */
diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c
index 103453f..153cc9b 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -34,7 +34,7 @@
 #include "nv04_driver.h"
 
 static inline int
-swzsurf_format(gl_format format)
+swzsurf_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_A8:
@@ -73,7 +73,7 @@ swzsurf_format(gl_format format)
 }
 
 static inline int
-surf2d_format(gl_format format)
+surf2d_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_A8:
@@ -112,7 +112,7 @@ surf2d_format(gl_format format)
 }
 
 static inline int
-rect_format(gl_format format)
+rect_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_A8:
@@ -151,7 +151,7 @@ rect_format(gl_format format)
 }
 
 static inline int
-sifm_format(gl_format format)
+sifm_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_A8:
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
index 87ae1d6..93410bc 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
@@ -33,7 +33,7 @@
 #include "nv10_driver.h"
 
 static inline unsigned
-get_rt_format(gl_format format)
+get_rt_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_XRGB8888:
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c
index 467b762..b6ccf45 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c
@@ -170,7 +170,7 @@ get_input_arg(struct combiner_state *rc, int arg, int flags)
 		int i = (source == GL_TEXTURE ?
 			 rc->unit : source - GL_TEXTURE0);
 		struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
-		gl_format format = t->Image[0][t->BaseLevel]->TexFormat;
+		mesa_format format = t->Image[0][t->BaseLevel]->TexFormat;
 
 		if (format == MESA_FORMAT_A8) {
 			/* Emulated using I8. */
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
index 9d8b1d1..1c1f862 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
@@ -33,7 +33,7 @@
 #include "nv20_driver.h"
 
 static inline unsigned
-get_rt_format(gl_format format)
+get_rt_format(mesa_format format)
 {
 	switch (format) {
 	case MESA_FORMAT_XRGB8888:
diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c
index a6a1a3f..73aeec8 100644
--- a/src/mesa/drivers/dri/r200/r200_blit.c
+++ b/src/mesa/drivers/dri/r200/r200_blit.c
@@ -38,7 +38,7 @@ static inline uint32_t cmdpacket0(struct radeon_screen *rscrn,
 }
 
 /* common formats supported as both textures and render targets */
-unsigned r200_check_blit(gl_format mesa_format, uint32_t dst_pitch)
+unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
 {
     /* XXX others?  BE/LE? */
     switch (mesa_format) {
@@ -97,8 +97,8 @@ static inline void emit_vtx_state(struct r200_context *r200)
 }
 
 static void inline emit_tx_setup(struct r200_context *r200,
-				 gl_format src_mesa_format,
-				 gl_format dst_mesa_format,
+				 mesa_format src_mesa_format,
+				 mesa_format dst_mesa_format,
 				 struct radeon_bo *bo,
 				 intptr_t offset,
 				 unsigned width,
@@ -297,7 +297,7 @@ static void inline emit_tx_setup(struct r200_context *r200,
 static inline void emit_cb_setup(struct r200_context *r200,
 				 struct radeon_bo *bo,
 				 intptr_t offset,
-				 gl_format mesa_format,
+				 mesa_format mesa_format,
 				 unsigned pitch,
 				 unsigned width,
 				 unsigned height)
@@ -463,7 +463,7 @@ static inline void emit_draw_packet(struct r200_context *r200,
 unsigned r200_blit(struct gl_context *ctx,
                    struct radeon_bo *src_bo,
                    intptr_t src_offset,
-                   gl_format src_mesaformat,
+                   mesa_format src_mesaformat,
                    unsigned src_pitch,
                    unsigned src_width,
                    unsigned src_height,
@@ -471,7 +471,7 @@ unsigned r200_blit(struct gl_context *ctx,
                    unsigned src_y_offset,
                    struct radeon_bo *dst_bo,
                    intptr_t dst_offset,
-                   gl_format dst_mesaformat,
+                   mesa_format dst_mesaformat,
                    unsigned dst_pitch,
                    unsigned dst_width,
                    unsigned dst_height,
diff --git a/src/mesa/drivers/dri/r200/r200_blit.h b/src/mesa/drivers/dri/r200/r200_blit.h
index fb5dacb..2305747 100644
--- a/src/mesa/drivers/dri/r200/r200_blit.h
+++ b/src/mesa/drivers/dri/r200/r200_blit.h
@@ -30,12 +30,12 @@
 
 void r200_blit_init(struct r200_context *r200);
 
-unsigned r200_check_blit(gl_format mesa_format, uint32_t dst_pitch);
+unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch);
 
 unsigned r200_blit(struct gl_context *ctx,
                    struct radeon_bo *src_bo,
                    intptr_t src_offset,
-                   gl_format src_mesaformat,
+                   mesa_format src_mesaformat,
                    unsigned src_pitch,
                    unsigned src_width,
                    unsigned src_height,
@@ -43,7 +43,7 @@ unsigned r200_blit(struct gl_context *ctx,
                    unsigned src_y_offset,
                    struct radeon_bo *dst_bo,
                    intptr_t dst_offset,
-                   gl_format dst_mesaformat,
+                   mesa_format dst_mesaformat,
                    unsigned dst_pitch,
                    unsigned dst_width,
                    unsigned dst_height,
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index b89bb39..6ba538e 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -721,7 +721,7 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format
 	struct radeon_framebuffer *rfb;
 	radeonTexObjPtr t;
 	uint32_t pitch_val;
-	gl_format texFormat;
+	mesa_format texFormat;
 
 	radeon = pDRICtx->driverPrivate;
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c
index 2d4a2d6..db10886 100644
--- a/src/mesa/drivers/dri/radeon/radeon_blit.c
+++ b/src/mesa/drivers/dri/radeon/radeon_blit.c
@@ -38,7 +38,7 @@ static inline uint32_t cmdpacket0(struct radeon_screen *rscrn,
 }
 
 /* common formats supported as both textures and render targets */
-unsigned r100_check_blit(gl_format mesa_format, uint32_t dst_pitch)
+unsigned r100_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
 {
     /* XXX others?  BE/LE? */
     switch (mesa_format) {
@@ -92,7 +92,7 @@ static inline void emit_vtx_state(struct r100_context *r100)
 }
 
 static void inline emit_tx_setup(struct r100_context *r100,
-				 gl_format mesa_format,
+				 mesa_format mesa_format,
 				 struct radeon_bo *bo,
 				 intptr_t offset,
 				 unsigned width,
@@ -175,7 +175,7 @@ static void inline emit_tx_setup(struct r100_context *r100,
 static inline void emit_cb_setup(struct r100_context *r100,
 				 struct radeon_bo *bo,
 				 intptr_t offset,
-				 gl_format mesa_format,
+				 mesa_format mesa_format,
 				 unsigned pitch,
 				 unsigned width,
 				 unsigned height)
@@ -341,7 +341,7 @@ static inline void emit_draw_packet(struct r100_context *r100,
 unsigned r100_blit(struct gl_context *ctx,
                    struct radeon_bo *src_bo,
                    intptr_t src_offset,
-                   gl_format src_mesaformat,
+                   mesa_format src_mesaformat,
                    unsigned src_pitch,
                    unsigned src_width,
                    unsigned src_height,
@@ -349,7 +349,7 @@ unsigned r100_blit(struct gl_context *ctx,
                    unsigned src_y_offset,
                    struct radeon_bo *dst_bo,
                    intptr_t dst_offset,
-                   gl_format dst_mesaformat,
+                   mesa_format dst_mesaformat,
                    unsigned dst_pitch,
                    unsigned dst_width,
                    unsigned dst_height,
diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.h b/src/mesa/drivers/dri/radeon/radeon_blit.h
index 4fac4af..421560b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_blit.h
+++ b/src/mesa/drivers/dri/radeon/radeon_blit.h
@@ -30,12 +30,12 @@
 
 void r100_blit_init(struct r100_context *r100);
 
-unsigned r100_check_blit(gl_format mesa_format, uint32_t dst_pitch);
+unsigned r100_check_blit(mesa_format mesa_format, uint32_t dst_pitch);
 
 unsigned r100_blit(struct gl_context *ctx,
                    struct radeon_bo *src_bo,
                    intptr_t src_offset,
-                   gl_format src_mesaformat,
+                   mesa_format src_mesaformat,
                    unsigned src_pitch,
                    unsigned src_width,
                    unsigned src_height,
@@ -43,7 +43,7 @@ unsigned r100_blit(struct gl_context *ctx,
                    unsigned src_y_offset,
                    struct radeon_bo *dst_bo,
                    intptr_t dst_offset,
-                   gl_format dst_mesaformat,
+                   mesa_format dst_mesaformat,
                    unsigned dst_pitch,
                    unsigned dst_width,
                    unsigned dst_height,
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.h b/src/mesa/drivers/dri/radeon/radeon_common.h
index c925ad9..fedaf50 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.h
+++ b/src/mesa/drivers/dri/radeon/radeon_common.h
@@ -29,7 +29,7 @@ void
 radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
 			   struct radeon_bo *bo);
 struct radeon_renderbuffer *
-radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv);
+radeon_create_renderbuffer(mesa_format format, __DRIdrawable *driDrawPriv);
 
 void
 radeonReadPixels(struct gl_context * ctx,
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h
index ab55071..8d1bb81 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.h
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h
@@ -474,11 +474,11 @@ struct radeon_context {
 	   void (*free_context)(struct gl_context *ctx);
 	   void (*emit_query_finish)(radeonContextPtr radeon);
 	   void (*update_scissor)(struct gl_context *ctx);
-	   unsigned (*check_blit)(gl_format mesa_format, uint32_t dst_pitch);
+	   unsigned (*check_blit)(mesa_format mesa_format, uint32_t dst_pitch);
 	   unsigned (*blit)(struct gl_context *ctx,
                         struct radeon_bo *src_bo,
                         intptr_t src_offset,
-                        gl_format src_mesaformat,
+                        mesa_format src_mesaformat,
                         unsigned src_pitch,
                         unsigned src_width,
                         unsigned src_height,
@@ -486,7 +486,7 @@ struct radeon_context {
                         unsigned src_y_offset,
                         struct radeon_bo *dst_bo,
                         intptr_t dst_offset,
-                        gl_format dst_mesaformat,
+                        mesa_format dst_mesaformat,
                         unsigned dst_pitch,
                         unsigned dst_width,
                         unsigned dst_height,
@@ -495,7 +495,7 @@ struct radeon_context {
                         unsigned reg_width,
                         unsigned reg_height,
                         unsigned flip_y);
-	   unsigned (*is_format_renderable)(gl_format mesa_format);
+	   unsigned (*is_format_renderable)(mesa_format mesa_format);
    } vtbl;
 };
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 1e6cd1b..94068f1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -636,7 +636,7 @@ radeon_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
  * Not used for user-created renderbuffers.
  */
 struct radeon_renderbuffer *
-radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
+radeon_create_renderbuffer(mesa_format format, __DRIdrawable *driDrawPriv)
 {
     struct radeon_renderbuffer *rrb;
     struct gl_renderbuffer *rb;
@@ -833,7 +833,7 @@ static void
 radeon_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
 {
 	radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-	gl_format mesa_format;
+	mesa_format mesa_format;
 	int i;
 
 	for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
index 4cb1838..57cd725 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
@@ -39,7 +39,7 @@
 #include "radeon_tile.h"
 
 static unsigned get_aligned_compressed_row_stride(
-		gl_format format,
+		mesa_format format,
 		unsigned width,
 		unsigned minStride)
 {
@@ -71,7 +71,7 @@ static unsigned get_aligned_compressed_row_stride(
 }
 
 unsigned get_texture_image_size(
-		gl_format format,
+		mesa_format format,
 		unsigned rowStride,
 		unsigned height,
 		unsigned depth,
@@ -96,7 +96,7 @@ unsigned get_texture_image_size(
 	return rowStride * height * depth;
 }
 
-unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, GLuint target)
+unsigned get_texture_image_row_stride(radeonContextPtr rmesa, mesa_format format, unsigned width, unsigned tiling, GLuint target)
 {
 	if (_mesa_is_format_compressed(format)) {
 		return get_aligned_compressed_row_stride(format, width, rmesa->texture_compressed_row_align);
@@ -177,7 +177,7 @@ static void calculate_miptree_layout(radeonContextPtr rmesa, radeon_mipmap_tree
  * Create a new mipmap tree, calculate its layout and allocate memory.
  */
 radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa,
-					  GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels,
+					  GLenum target, mesa_format mesaFormat, GLuint baseLevel, GLuint numLevels,
 					  GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits)
 {
 	radeon_mipmap_tree *mt = CALLOC_STRUCT(_radeon_mipmap_tree);
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h
index 74007ff..f919a58 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h
@@ -91,16 +91,16 @@ GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt,
 				   GLuint face, GLuint level);
 uint32_t get_base_teximage_offset(radeonTexObj *texObj);
 
-unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, unsigned target);
+unsigned get_texture_image_row_stride(radeonContextPtr rmesa, mesa_format format, unsigned width, unsigned tiling, unsigned target);
 
 unsigned get_texture_image_size(
-		gl_format format,
+		mesa_format format,
 		unsigned rowStride,
 		unsigned height,
 		unsigned depth,
 		unsigned tiling);
 
 radeon_mipmap_tree *radeon_miptree_create(radeonContextPtr rmesa,
-					  GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels,
+					  GLenum target, mesa_format mesaFormat, GLuint baseLevel, GLuint numLevels,
 					  GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits);
 #endif /* __RADEON_MIPMAP_TREE_H_ */
diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
index 0aa00bd..e9bfc0d 100644
--- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
+++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
@@ -38,7 +38,7 @@
 #include "radeon_debug.h"
 #include "radeon_mipmap_tree.h"
 
-static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
+static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
 {
     switch (format)
     {
@@ -94,7 +94,7 @@ do_blit_readpixels(struct gl_context * ctx,
 {
     radeonContextPtr radeon = RADEON_CONTEXT(ctx);
     const struct radeon_renderbuffer *rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
-    const gl_format dst_format = gl_format_and_type_to_mesa_format(format, type);
+    const mesa_format dst_format = gl_format_and_type_to_mesa_format(format, type);
     unsigned dst_rowstride, dst_imagesize, aligned_rowstride, flip_y;
     struct radeon_bo *dst_buffer;
     GLint dst_x = 0, dst_y = 0;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 15bf5f8..d90bafa 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -598,7 +598,7 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv,
     const GLboolean swAccum = mesaVis->accumRedBits > 0;
     const GLboolean swStencil = mesaVis->stencilBits > 0 &&
 	mesaVis->depthBits != 24;
-    gl_format rgbFormat;
+    mesa_format rgbFormat;
     struct radeon_framebuffer *rfb;
 
     if (isPixmap)
@@ -708,7 +708,7 @@ radeonDestroyBuffer(__DRIdrawable *driDrawPriv)
 static const
 __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
 {
-   static const gl_format formats[3] = {
+   static const mesa_format formats[3] = {
       MESA_FORMAT_RGB565,
       MESA_FORMAT_XRGB8888,
       MESA_FORMAT_ARGB8888
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
index 675eb78..fc72384 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
@@ -50,8 +50,8 @@ do_copy_texsubimage(struct gl_context *ctx,
     const GLuint level = timg->base.Base.Level;
     unsigned src_bpp;
     unsigned dst_bpp;
-    gl_format src_mesaformat;
-    gl_format dst_mesaformat;
+    mesa_format src_mesaformat;
+    mesa_format dst_mesaformat;
     unsigned flip_y;
 
     if (!radeon->vtbl.blit) {
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 09a7ccb..5550a5a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -598,7 +598,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form
 	struct radeon_framebuffer *rfb;
 	radeonTexObjPtr t;
 	uint32_t pitch_val;
-	gl_format texFormat;
+	mesa_format texFormat;
 
 	radeon = pDRICtx->driverPrivate;
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 52cf95d..8455b82 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -213,7 +213,7 @@ radeon_unmap_texture_image(struct gl_context *ctx,
 }
 
 /* try to find a format which will only need a memcopy */
-static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
+static mesa_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
 					   GLenum srcFormat,
 					   GLenum srcType, GLboolean fbo)
 {
@@ -242,7 +242,7 @@ static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
 #endif
 }
 
-gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
 					 GLenum target,
 					 GLint internalFormat,
 					 GLenum format,
@@ -252,7 +252,7 @@ gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
 					 type, 0);
 }
 
-gl_format radeonChooseTextureFormat(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
 				    GLint internalFormat,
 				    GLenum format,
 				    GLenum type, GLboolean fbo)
@@ -504,7 +504,7 @@ static void teximage_assign_miptree(radeonContextPtr rmesa,
 				"%s Failed to allocate miptree.\n", __func__);
 }
 
-unsigned radeonIsFormatRenderable(gl_format mesa_format)
+unsigned radeonIsFormatRenderable(mesa_format mesa_format)
 {
 	if (mesa_format == _radeon_texformat_argb8888 || mesa_format == _radeon_texformat_rgb565 ||
 		mesa_format == _radeon_texformat_argb1555 || mesa_format == _radeon_texformat_argb4444)
@@ -579,12 +579,12 @@ void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
 		fprintf(stderr, "miptree doesn't match image\n");
 }
 
-gl_format _radeon_texformat_rgba8888 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_argb8888 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_rgb565 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_argb4444 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_argb1555 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_al88 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_rgba8888 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_argb8888 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_rgb565 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_argb4444 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_argb1555 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_al88 = MESA_FORMAT_NONE;
 /*@}*/
 
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h
index 6ef640c..286b2a2 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.h
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.h
@@ -33,12 +33,12 @@
 
 #include "main/formats.h"
 
-extern gl_format _radeon_texformat_rgba8888;
-extern gl_format _radeon_texformat_argb8888;
-extern gl_format _radeon_texformat_rgb565;
-extern gl_format _radeon_texformat_argb4444;
-extern gl_format _radeon_texformat_argb1555;
-extern gl_format _radeon_texformat_al88;
+extern mesa_format _radeon_texformat_rgba8888;
+extern mesa_format _radeon_texformat_argb8888;
+extern mesa_format _radeon_texformat_rgb565;
+extern mesa_format _radeon_texformat_argb4444;
+extern mesa_format _radeon_texformat_argb1555;
+extern mesa_format _radeon_texformat_al88;
 
 extern 
 void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride,
@@ -51,13 +51,13 @@ int radeon_validate_texture_miptree(struct gl_context * ctx,
 				    struct gl_texture_object *texObj);
 
 
-gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
                                          GLenum target,
                                          GLint internalFormat,
                                          GLenum format,
                                          GLenum type);
 
-gl_format radeonChooseTextureFormat(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
                                     GLint internalFormat,
                                     GLenum format,
                                     GLenum type, GLboolean fbo);
@@ -69,7 +69,7 @@ void radeonCopyTexSubImage(struct gl_context *ctx, GLuint dims,
                            GLint x, GLint y,
                            GLsizei width, GLsizei height);
 
-unsigned radeonIsFormatRenderable(gl_format mesa_format);
+unsigned radeonIsFormatRenderable(mesa_format mesa_format);
 
 void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
 				    struct gl_texture_object *texObj,
diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.c b/src/mesa/drivers/dri/radeon/radeon_tile.c
index b95961f..433199f 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tile.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tile.c
@@ -211,7 +211,7 @@ static void micro_tile_1_x_1_128bit(const void * src, unsigned src_pitch,
 
 void tile_image(const void * src, unsigned src_pitch,
                 void *dst, unsigned dst_pitch,
-                gl_format format, unsigned width, unsigned height)
+                mesa_format format, unsigned width, unsigned height)
 {
     assert(src_pitch >= width);
     assert(dst_pitch >= width);
@@ -435,7 +435,7 @@ static void micro_untile_1_x_1_128bit(const void * src, unsigned src_pitch,
 
 void untile_image(const void * src, unsigned src_pitch,
                   void *dst, unsigned dst_pitch,
-                  gl_format format, unsigned width, unsigned height)
+                  mesa_format format, unsigned width, unsigned height)
 {
     assert(src_pitch >= width);
     assert(dst_pitch >= width);
@@ -474,7 +474,7 @@ void untile_image(const void * src, unsigned src_pitch,
     }
 }
 
-void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height)
+void get_tile_size(mesa_format format, unsigned *block_width, unsigned *block_height)
 {
     switch (_mesa_get_format_bytes(format))
     {
diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.h b/src/mesa/drivers/dri/radeon/radeon_tile.h
index 31d9c56..6654c7d 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tile.h
+++ b/src/mesa/drivers/dri/radeon/radeon_tile.h
@@ -29,10 +29,10 @@
 
 void tile_image(const void * src, unsigned src_pitch,
                 void *dst, unsigned dst_pitch,
-                gl_format format, unsigned width, unsigned height);
+                mesa_format format, unsigned width, unsigned height);
 
 void untile_image(const void * src, unsigned src_pitch,
                   void *dst, unsigned dst_pitch,
-                  gl_format format, unsigned width, unsigned height);
+                  mesa_format format, unsigned width, unsigned height);
 
-void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height);
+void get_tile_size(mesa_format format, unsigned *block_width, unsigned *block_height);
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 30e6805..ddb810f 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -76,7 +76,7 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
     struct gl_texture_image *texImage;
     struct swrast_texture_image *swImage;
     uint32_t internalFormat;
-    gl_format texFormat;
+    mesa_format texFormat;
 
     dri_ctx = pDRICtx->driverPrivate;
 
@@ -130,7 +130,7 @@ swrastFillInModes(__DRIscreen *psp,
     __DRIconfig **configs;
     unsigned depth_buffer_factor;
     unsigned back_buffer_factor;
-    gl_format format;
+    mesa_format format;
 
     /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
      * support pageflipping at all.
@@ -627,7 +627,7 @@ viewport(struct gl_context *ctx)
     swrast_check_and_update_window_size(ctx, read);
 }
 
-static gl_format swrastChooseTextureFormat(struct gl_context * ctx,
+static mesa_format swrastChooseTextureFormat(struct gl_context * ctx,
                                            GLenum target,
 					   GLint internalFormat,
 					   GLenum format,
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 9e11ca7..eb4f1d6 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -854,7 +854,7 @@ _mesa_update_clamp_vertex_color(struct gl_context *ctx)
 }
 
 /**
- * Returns an appropriate gl_format for color rendering based on the
+ * Returns an appropriate mesa_format for color rendering based on the
  * GL_FRAMEBUFFER_SRGB state.
  *
  * Some drivers implement GL_FRAMEBUFFER_SRGB using a flag on the blend state
@@ -862,8 +862,8 @@ _mesa_update_clamp_vertex_color(struct gl_context *ctx)
  * overriding the format of the surface.  This is a helper for doing the
  * surface format override variant.
  */
-gl_format
-_mesa_get_render_format(const struct gl_context *ctx, gl_format format)
+mesa_format
+_mesa_get_render_format(const struct gl_context *ctx, mesa_format format)
 {
    if (ctx->Color.sRGBEnabled)
       return format;
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index 7445840..fe31a74 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -115,8 +115,8 @@ _mesa_update_clamp_fragment_color(struct gl_context *ctx);
 extern void
 _mesa_update_clamp_vertex_color(struct gl_context *ctx);
 
-extern gl_format
-_mesa_get_render_format(const struct gl_context *ctx, gl_format format);
+extern mesa_format
+_mesa_get_render_format(const struct gl_context *ctx, mesa_format format);
 
 extern void  
 _mesa_init_color( struct gl_context * ctx );
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 9336759..e305038 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -295,18 +295,18 @@ buffer_object_subdata_range_good(struct gl_context * ctx, GLenum target,
  * \param format          Format of the supplied data.
  * \param type            Type of the supplied data.
  * \param caller          Name of calling function for recording errors.
- * \return   If internalformat, format and type are legal the gl_format
+ * \return   If internalformat, format and type are legal the mesa_format
  *           corresponding to internalformat, otherwise MESA_FORMAT_NONE.
  *
  * \sa glClearBufferData and glClearBufferSubData
  */
-static gl_format
+static mesa_format
 validate_clear_buffer_format(struct gl_context *ctx,
                              GLenum internalformat,
                              GLenum format, GLenum type,
                              const char *caller)
 {
-   gl_format mesaFormat;
+   mesa_format mesaFormat;
    GLenum errorFormatType;
 
    mesaFormat = _mesa_validate_texbuffer_format(ctx, internalformat);
@@ -360,7 +360,7 @@ validate_clear_buffer_format(struct gl_context *ctx,
  */
 static bool
 convert_clear_buffer_data(struct gl_context *ctx,
-                          gl_format internalformat,
+                          mesa_format internalformat,
                           GLubyte *clearValue, GLenum format, GLenum type,
                           const GLvoid *data, const char *caller)
 {
@@ -1365,7 +1365,7 @@ _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format,
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_buffer_object* bufObj;
-   gl_format mesaFormat;
+   mesa_format mesaFormat;
    GLubyte clearValue[MAX_PIXEL_BYTES];
    GLsizeiptr clearValueSize;
 
@@ -1420,7 +1420,7 @@ _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_buffer_object* bufObj;
-   gl_format mesaFormat;
+   mesa_format mesaFormat;
    GLubyte clearValue[MAX_PIXEL_BYTES];
    GLsizeiptr clearValueSize;
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 6c084af..cb6fac4 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -182,7 +182,7 @@ struct dd_function_table {
     * GL_TEXTURE_CUBE_MAP_[POSITIVE/NEGATIVE]_[XYZ].
     * Called by glTexImage(), etc.
     */
-   gl_format (*ChooseTextureFormat)( struct gl_context *ctx,
+   mesa_format (*ChooseTextureFormat)( struct gl_context *ctx,
                                      GLenum target, GLint internalFormat,
                                      GLenum srcFormat, GLenum srcType );
 
@@ -268,7 +268,7 @@ struct dd_function_table {
     * \return GL_TRUE if the image is OK, GL_FALSE if too large
     */
    GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
-                                  GLint level, gl_format format,
+                                  GLint level, mesa_format format,
                                   GLint width, GLint height,
                                   GLint depth, GLint border);
    /*@}*/
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index dc7184a..07b9c8b 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -637,7 +637,7 @@ _mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat)
  * Is the given base format a legal format for a color renderbuffer?
  */
 static GLboolean
-is_format_color_renderable(const struct gl_context *ctx, gl_format format, GLenum internalFormat)
+is_format_color_renderable(const struct gl_context *ctx, mesa_format format, GLenum internalFormat)
 {
    const GLenum baseFormat =
       _mesa_get_format_base_format(format);
@@ -902,7 +902,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
    for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
       struct gl_renderbuffer_attachment *att;
       GLenum f;
-      gl_format attFormat;
+      mesa_format attFormat;
       GLenum att_tex_target = GL_NONE;
 
       /*
@@ -1859,7 +1859,7 @@ _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
  * we need to return zero.
  */
 static GLint
-get_component_bits(GLenum pname, GLenum baseFormat, gl_format format)
+get_component_bits(GLenum pname, GLenum baseFormat, mesa_format format)
 {
    if (_mesa_base_format_has_channel(baseFormat, pname))
       return _mesa_get_format_bits(format, pname);
@@ -2908,7 +2908,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
                      "glGetFramebufferAttachmentParameterivEXT(pname)");
       }
       else {
-         gl_format format = att->Renderbuffer->Format;
+         mesa_format format = att->Renderbuffer->Format;
 
          /* Page 235 (page 247 of the PDF) in section 6.1.13 of the OpenGL ES
           * 3.0.1 spec says:
@@ -3118,7 +3118,7 @@ find_attachment(const struct gl_framebuffer *fb,
  *     does not contain signed integer values."
  */
 static GLboolean
-compatible_color_datatypes(gl_format srcFormat, gl_format dstFormat)
+compatible_color_datatypes(mesa_format srcFormat, mesa_format dstFormat)
 {
    GLenum srcType = _mesa_get_format_datatype(srcFormat);
    GLenum dstType = _mesa_get_format_datatype(dstFormat);
diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index 41f5f99..bb78482 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -1879,7 +1879,7 @@ pack_float_SIGNED_RG1616(const GLfloat src[4], void *dst)
  * Return a function that can pack a GLubyte rgba[4] color.
  */
 gl_pack_ubyte_rgba_func
-_mesa_get_pack_ubyte_rgba_function(gl_format format)
+_mesa_get_pack_ubyte_rgba_function(mesa_format format)
 {
    static gl_pack_ubyte_rgba_func table[MESA_FORMAT_COUNT];
    static GLboolean initialized = GL_FALSE;
@@ -2042,7 +2042,7 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format)
  * Return a function that can pack a GLfloat rgba[4] color.
  */
 gl_pack_float_rgba_func
-_mesa_get_pack_float_rgba_function(gl_format format)
+_mesa_get_pack_float_rgba_function(mesa_format format)
 {
    static gl_pack_float_rgba_func table[MESA_FORMAT_COUNT];
    static GLboolean initialized = GL_FALSE;
@@ -2202,7 +2202,7 @@ _mesa_get_pack_float_rgba_function(gl_format format)
 
 
 static pack_float_rgba_row_func
-get_pack_float_rgba_row_function(gl_format format)
+get_pack_float_rgba_row_function(mesa_format format)
 {
    static pack_float_rgba_row_func table[MESA_FORMAT_COUNT];
    static GLboolean initialized = GL_FALSE;
@@ -2235,7 +2235,7 @@ get_pack_float_rgba_row_function(gl_format format)
 
 
 static pack_ubyte_rgba_row_func
-get_pack_ubyte_rgba_row_function(gl_format format)
+get_pack_ubyte_rgba_row_function(mesa_format format)
 {
    static pack_ubyte_rgba_row_func table[MESA_FORMAT_COUNT];
    static GLboolean initialized = GL_FALSE;
@@ -2271,7 +2271,7 @@ get_pack_ubyte_rgba_row_function(gl_format format)
  * Pack a row of GLfloat rgba[4] values to the destination.
  */
 void
-_mesa_pack_float_rgba_row(gl_format format, GLuint n,
+_mesa_pack_float_rgba_row(mesa_format format, GLuint n,
                           const GLfloat src[][4], void *dst)
 {
    pack_float_rgba_row_func packrow = get_pack_float_rgba_row_function(format);
@@ -2302,7 +2302,7 @@ _mesa_pack_float_rgba_row(gl_format format, GLuint n,
  * Pack a row of GLubyte rgba[4] values to the destination.
  */
 void
-_mesa_pack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_rgba_row(mesa_format format, GLuint n,
                           const GLubyte src[][4], void *dst)
 {
    pack_ubyte_rgba_row_func packrow = get_pack_ubyte_rgba_row_function(format);
@@ -2335,7 +2335,7 @@ _mesa_pack_ubyte_rgba_row(gl_format format, GLuint n,
  * \param dstRowStride  destination image row stride in bytes
  */
 void
-_mesa_pack_ubyte_rgba_rect(gl_format format, GLuint width, GLuint height,
+_mesa_pack_ubyte_rgba_rect(mesa_format format, GLuint width, GLuint height,
                            const GLubyte *src, GLint srcRowStride,
                            void *dst, GLint dstRowStride)
 {
@@ -2423,7 +2423,7 @@ pack_float_z_Z32_FLOAT(const GLfloat *src, void *dst)
 }
 
 gl_pack_float_z_func
-_mesa_get_pack_float_z_func(gl_format format)
+_mesa_get_pack_float_z_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_Z24_S8:
@@ -2508,7 +2508,7 @@ pack_uint_z_Z32_FLOAT_X24S8(const GLuint *src, void *dst)
 }
 
 gl_pack_uint_z_func
-_mesa_get_pack_uint_z_func(gl_format format)
+_mesa_get_pack_uint_z_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_Z24_S8:
@@ -2572,7 +2572,7 @@ pack_ubyte_stencil_Z32_FLOAT_X24S8(const GLubyte *src, void *dst)
 
 
 gl_pack_ubyte_stencil_func
-_mesa_get_pack_ubyte_stencil_func(gl_format format)
+_mesa_get_pack_ubyte_stencil_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_Z24_S8:
@@ -2593,7 +2593,7 @@ _mesa_get_pack_ubyte_stencil_func(gl_format format)
 
 
 void
-_mesa_pack_float_z_row(gl_format format, GLuint n,
+_mesa_pack_float_z_row(mesa_format format, GLuint n,
                        const GLfloat *src, void *dst)
 {
    switch (format) {
@@ -2669,7 +2669,7 @@ _mesa_pack_float_z_row(gl_format format, GLuint n,
  * The incoming Z values are always in the range [0, 0xffffffff].
  */
 void
-_mesa_pack_uint_z_row(gl_format format, GLuint n,
+_mesa_pack_uint_z_row(mesa_format format, GLuint n,
                       const GLuint *src, void *dst)
 {
    switch (format) {
@@ -2742,7 +2742,7 @@ _mesa_pack_uint_z_row(gl_format format, GLuint n,
 
 
 void
-_mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n,
                              const GLubyte *src, void *dst)
 {
    switch (format) {
@@ -2792,7 +2792,7 @@ _mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
  * Incoming Z/stencil values are always in uint_24_8 format.
  */
 void
-_mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
                                        const GLuint *src, void *dst)
 {
    switch (format) {
@@ -2836,7 +2836,7 @@ _mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
  * the packed value at dst will be 0 or ~0 depending on the colorMask.
  */
 void
-_mesa_pack_colormask(gl_format format, const GLubyte colorMask[4], void *dst)
+_mesa_pack_colormask(mesa_format format, const GLubyte colorMask[4], void *dst)
 {
    GLfloat maskColor[4];
 
diff --git a/src/mesa/main/format_pack.h b/src/mesa/main/format_pack.h
index ebd103d..2577def 100644
--- a/src/mesa/main/format_pack.h
+++ b/src/mesa/main/format_pack.h
@@ -49,58 +49,58 @@ typedef void (*gl_pack_ubyte_stencil_func)(const GLubyte *src, void *dst);
 
 
 extern gl_pack_ubyte_rgba_func
-_mesa_get_pack_ubyte_rgba_function(gl_format format);
+_mesa_get_pack_ubyte_rgba_function(mesa_format format);
 
 
 extern gl_pack_float_rgba_func
-_mesa_get_pack_float_rgba_function(gl_format format);
+_mesa_get_pack_float_rgba_function(mesa_format format);
 
 
 extern gl_pack_float_z_func
-_mesa_get_pack_float_z_func(gl_format format);
+_mesa_get_pack_float_z_func(mesa_format format);
 
 
 extern gl_pack_uint_z_func
-_mesa_get_pack_uint_z_func(gl_format format);
+_mesa_get_pack_uint_z_func(mesa_format format);
 
 
 extern gl_pack_ubyte_stencil_func
-_mesa_get_pack_ubyte_stencil_func(gl_format format);
+_mesa_get_pack_ubyte_stencil_func(mesa_format format);
 
 
 
 extern void
-_mesa_pack_float_rgba_row(gl_format format, GLuint n,
+_mesa_pack_float_rgba_row(mesa_format format, GLuint n,
                           const GLfloat src[][4], void *dst);
 
 extern void
-_mesa_pack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_rgba_row(mesa_format format, GLuint n,
                           const GLubyte src[][4], void *dst);
 
 
 extern void
-_mesa_pack_ubyte_rgba_rect(gl_format format, GLuint width, GLuint height,
+_mesa_pack_ubyte_rgba_rect(mesa_format format, GLuint width, GLuint height,
                            const GLubyte *src, GLint srcRowStride,
                            void *dst, GLint dstRowStride);
 
 extern void
-_mesa_pack_float_z_row(gl_format format, GLuint n,
+_mesa_pack_float_z_row(mesa_format format, GLuint n,
                        const GLfloat *src, void *dst);
 
 extern void
-_mesa_pack_uint_z_row(gl_format format, GLuint n,
+_mesa_pack_uint_z_row(mesa_format format, GLuint n,
                       const GLuint *src, void *dst);
 
 extern void
-_mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n,
                              const GLubyte *src, void *dst);
 
 extern void
-_mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
                                        const GLuint *src, void *dst);
 
 
 extern void
-_mesa_pack_colormask(gl_format format, const GLubyte colorMask[4], void *dst);
+_mesa_pack_colormask(mesa_format format, const GLubyte colorMask[4], void *dst);
 
 #endif
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index 28a50f3..96c7110 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -2311,7 +2311,7 @@ unpack_SIGNED_RG1616(const void *src, GLfloat dst[][4], GLuint n)
  * Return the unpacker function for the given format.
  */
 static unpack_rgba_func
-get_unpack_rgba_function(gl_format format)
+get_unpack_rgba_function(mesa_format format)
 {
    static unpack_rgba_func table[MESA_FORMAT_COUNT];
    static GLboolean initialized = GL_FALSE;
@@ -2540,7 +2540,7 @@ get_unpack_rgba_function(gl_format format)
  * Unpack rgba colors, returning as GLfloat values.
  */
 void
-_mesa_unpack_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_rgba_row(mesa_format format, GLuint n,
                       const void *src, GLfloat dst[][4])
 {
    unpack_rgba_func unpack = get_unpack_rgba_function(format);
@@ -2913,7 +2913,7 @@ unpack_ubyte_RG88(const void *src, GLubyte dst[][4], GLuint n)
  * only be used for unpacking formats that use 8 bits or less per channel.
  */
 void
-_mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n,
                             const void *src, GLubyte dst[][4])
 {
    switch (format) {
@@ -3640,7 +3640,7 @@ unpack_int_rgba_ABGR2101010(const GLuint *src, GLuint dst[][4], GLuint n)
 }
 
 void
-_mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
                            const void *src, GLuint dst[][4])
 {
    switch (format) {
@@ -3863,7 +3863,7 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
  * \param height  height of rect region to convert
  */
 void
-_mesa_unpack_rgba_block(gl_format format,
+_mesa_unpack_rgba_block(mesa_format format,
                         const void *src, GLint srcRowStride,
                         GLfloat dst[][4], GLint dstRowStride,
                         GLuint x, GLuint y, GLuint width, GLuint height)
@@ -3964,7 +3964,7 @@ unpack_float_z_Z32X24S8(GLuint n, const void *src, GLfloat *dst)
  * The returned values will always be in the range [0.0, 1.0].
  */
 void
-_mesa_unpack_float_z_row(gl_format format, GLuint n,
+_mesa_unpack_float_z_row(mesa_format format, GLuint n,
                          const void *src, GLfloat *dst)
 {
    unpack_float_z_func unpack;
@@ -4068,7 +4068,7 @@ unpack_uint_z_Z32_FLOAT_X24S8(const void *src, GLuint *dst, GLuint n)
  * The returned values will always be in the range [0, 0xffffffff].
  */
 void
-_mesa_unpack_uint_z_row(gl_format format, GLuint n,
+_mesa_unpack_uint_z_row(mesa_format format, GLuint n,
                         const void *src, GLuint *dst)
 {
    unpack_uint_z_func unpack;
@@ -4142,7 +4142,7 @@ unpack_ubyte_s_Z32_FLOAT_X24S8(const void *src, GLubyte *dst, GLuint n)
 }
 
 void
-_mesa_unpack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_stencil_row(mesa_format format, GLuint n,
 			       const void *src, GLubyte *dst)
 {
    switch (format) {
@@ -4183,7 +4183,7 @@ unpack_uint_24_8_depth_stencil_Z24_S8(const GLuint *src, GLuint *dst, GLuint n)
 }
 
 void
-_mesa_unpack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
 					 const void *src, GLuint *dst)
 {
    switch (format) {
diff --git a/src/mesa/main/format_unpack.h b/src/mesa/main/format_unpack.h
index 1da03ca..1fcfc04 100644
--- a/src/mesa/main/format_unpack.h
+++ b/src/mesa/main/format_unpack.h
@@ -29,38 +29,38 @@ extern GLfloat
 _mesa_nonlinear_to_linear(GLubyte cs8);
 
 extern void
-_mesa_unpack_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_rgba_row(mesa_format format, GLuint n,
                       const void *src, GLfloat dst[][4]);
 
 extern void
-_mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n,
                             const void *src, GLubyte dst[][4]);
 
 void
-_mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
                            const void *src, GLuint dst[][4]);
 
 extern void
-_mesa_unpack_rgba_block(gl_format format,
+_mesa_unpack_rgba_block(mesa_format format,
                         const void *src, GLint srcRowStride,
                         GLfloat dst[][4], GLint dstRowStride,
                         GLuint x, GLuint y, GLuint width, GLuint height);
 
 extern void
-_mesa_unpack_float_z_row(gl_format format, GLuint n,
+_mesa_unpack_float_z_row(mesa_format format, GLuint n,
                          const void *src, GLfloat *dst);
 
 
 void
-_mesa_unpack_uint_z_row(gl_format format, GLuint n,
+_mesa_unpack_uint_z_row(mesa_format format, GLuint n,
                         const void *src, GLuint *dst);
 
 void
-_mesa_unpack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_stencil_row(mesa_format format, GLuint n,
 			       const void *src, GLubyte *dst);
 
 void
-_mesa_unpack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
 					 const void *src, GLuint *dst);
 
 
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 1246c4d..575d716 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -35,7 +35,7 @@
  */
 struct gl_format_info
 {
-   gl_format Name;
+   mesa_format Name;
 
    /** text name for debugging */
    const char *StrName;
@@ -1795,7 +1795,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
 
 
 static const struct gl_format_info *
-_mesa_get_format_info(gl_format format)
+_mesa_get_format_info(mesa_format format)
 {
    const struct gl_format_info *info = &format_info[format];
    assert(info->Name == format);
@@ -1805,7 +1805,7 @@ _mesa_get_format_info(gl_format format)
 
 /** Return string name of format (for debugging) */
 const char *
-_mesa_get_format_name(gl_format format)
+_mesa_get_format_name(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return info->StrName;
@@ -1821,7 +1821,7 @@ _mesa_get_format_name(gl_format format)
  * Note: not GLuint, so as not to coerce math to unsigned. cf. fdo #37351
  */
 GLint
-_mesa_get_format_bytes(gl_format format)
+_mesa_get_format_bytes(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    ASSERT(info->BytesPerBlock);
@@ -1837,7 +1837,7 @@ _mesa_get_format_bytes(gl_format format)
  * \param pname  the component, such as GL_RED_BITS, GL_TEXTURE_BLUE_BITS, etc.
  */
 GLint
-_mesa_get_format_bits(gl_format format, GLenum pname)
+_mesa_get_format_bits(mesa_format format, GLenum pname)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
 
@@ -1886,7 +1886,7 @@ _mesa_get_format_bits(gl_format format, GLenum pname)
 
 
 GLuint
-_mesa_get_format_max_bits(gl_format format)
+_mesa_get_format_max_bits(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    GLuint max = MAX2(info->RedBits, info->GreenBits);
@@ -1911,7 +1911,7 @@ _mesa_get_format_max_bits(gl_format format)
  *    GL_FLOAT = an ordinary float
  */
 GLenum
-_mesa_get_format_datatype(gl_format format)
+_mesa_get_format_datatype(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return info->DataType;
@@ -1924,7 +1924,7 @@ _mesa_get_format_datatype(gl_format format)
  * GL_YCBCR_MESA, GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL.
  */
 GLenum
-_mesa_get_format_base_format(gl_format format)
+_mesa_get_format_base_format(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return info->BaseFormat;
@@ -1939,7 +1939,7 @@ _mesa_get_format_base_format(gl_format format)
  * \param bh  returns block height in pixels
  */
 void
-_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh)
+_mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    *bw = info->BlockWidth;
@@ -1949,7 +1949,7 @@ _mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh)
 
 /** Is the given format a compressed format? */
 GLboolean
-_mesa_is_format_compressed(gl_format format)
+_mesa_is_format_compressed(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return info->BlockWidth > 1 || info->BlockHeight > 1;
@@ -1960,7 +1960,7 @@ _mesa_is_format_compressed(gl_format format)
  * Determine if the given format represents a packed depth/stencil buffer.
  */
 GLboolean
-_mesa_is_format_packed_depth_stencil(gl_format format)
+_mesa_is_format_packed_depth_stencil(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
 
@@ -1972,7 +1972,7 @@ _mesa_is_format_packed_depth_stencil(gl_format format)
  * Is the given format a signed/unsigned integer color format?
  */
 GLboolean
-_mesa_is_format_integer_color(gl_format format)
+_mesa_is_format_integer_color(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return (info->DataType == GL_INT || info->DataType == GL_UNSIGNED_INT) &&
@@ -1986,7 +1986,7 @@ _mesa_is_format_integer_color(gl_format format)
  * Is the given format an unsigned integer format?
  */
 GLboolean
-_mesa_is_format_unsigned(gl_format format)
+_mesa_is_format_unsigned(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return _mesa_is_type_unsigned(info->DataType);
@@ -1997,7 +1997,7 @@ _mesa_is_format_unsigned(gl_format format)
  * Does the given format store signed values?
  */
 GLboolean
-_mesa_is_format_signed(gl_format format)
+_mesa_is_format_signed(mesa_format format)
 {
    if (format == MESA_FORMAT_R11_G11_B10_FLOAT || 
        format == MESA_FORMAT_RGB9_E5_FLOAT) {
@@ -2018,7 +2018,7 @@ _mesa_is_format_signed(gl_format format)
  * \return GL_LINEAR or GL_SRGB
  */
 GLenum
-_mesa_get_format_color_encoding(gl_format format)
+_mesa_get_format_color_encoding(mesa_format format)
 {
    /* XXX this info should be encoded in gl_format_info */
    switch (format) {
@@ -2043,8 +2043,8 @@ _mesa_get_format_color_encoding(gl_format format)
  * For an sRGB format, return the corresponding linear color space format.
  * For non-sRGB formats, return the format as-is.
  */
-gl_format
-_mesa_get_srgb_format_linear(gl_format format)
+mesa_format
+_mesa_get_srgb_format_linear(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_SRGB8:
@@ -2088,8 +2088,8 @@ _mesa_get_srgb_format_linear(gl_format format)
  * If the given format is a compressed format, return a corresponding
  * uncompressed format.
  */
-gl_format
-_mesa_get_uncompressed_format(gl_format format)
+mesa_format
+_mesa_get_uncompressed_format(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RGB_FXT1:
@@ -2149,7 +2149,7 @@ _mesa_get_uncompressed_format(gl_format format)
 
 
 GLuint
-_mesa_format_num_components(gl_format format)
+_mesa_format_num_components(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    return ((info->RedBits > 0) +
@@ -2168,7 +2168,7 @@ _mesa_format_num_components(gl_format format)
  * in the given format.
  */
 GLuint
-_mesa_format_image_size(gl_format format, GLsizei width,
+_mesa_format_image_size(mesa_format format, GLsizei width,
                         GLsizei height, GLsizei depth)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
@@ -2194,7 +2194,7 @@ _mesa_format_image_size(gl_format format, GLsizei width,
  * accomodate very large textures.
  */
 uint64_t
-_mesa_format_image_size64(gl_format format, GLsizei width,
+_mesa_format_image_size64(mesa_format format, GLsizei width,
                           GLsizei height, GLsizei depth)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
@@ -2220,7 +2220,7 @@ _mesa_format_image_size64(gl_format format, GLsizei width,
 
 
 GLint
-_mesa_format_row_stride(gl_format format, GLsizei width)
+_mesa_format_row_stride(mesa_format format, GLsizei width)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
    /* Strictly speaking, a conditional isn't needed here */
@@ -2247,7 +2247,7 @@ _mesa_format_row_stride(gl_format format, GLsizei width)
 static void
 check_format_to_type_and_comps(void)
 {
-   gl_format f;
+   mesa_format f;
 
    for (f = MESA_FORMAT_NONE + 1; f < MESA_FORMAT_COUNT; f++) {
       GLenum datatype = 0;
@@ -2352,11 +2352,11 @@ _mesa_test_formats(void)
 
 
 /**
- * Return datatype and number of components per texel for the given gl_format.
+ * Return datatype and number of components per texel for the given mesa_format.
  * Only used for mipmap generation code.
  */
 void
-_mesa_format_to_type_and_comps(gl_format format,
+_mesa_format_to_type_and_comps(mesa_format format,
                                GLenum *datatype, GLuint *comps)
 {
    switch (format) {
@@ -2900,16 +2900,16 @@ _mesa_format_to_type_and_comps(gl_format format,
 }
 
 /**
- * Check if a gl_format exactly matches a GL format/type combination
+ * Check if a mesa_format exactly matches a GL format/type combination
  * such that we can use memcpy() from one to the other.
- * \param gl_format  a MESA_FORMAT_x value
+ * \param mesa_format  a MESA_FORMAT_x value
  * \param format  the user-specified image format
  * \param type  the user-specified image datatype
  * \param swapBytes  typically the current pixel pack/unpack byteswap state
  * \return GL_TRUE if the formats match, GL_FALSE otherwise.
  */
 GLboolean
-_mesa_format_matches_format_and_type(gl_format gl_format,
+_mesa_format_matches_format_and_type(mesa_format mesa_format,
 				     GLenum format, GLenum type,
                                      GLboolean swapBytes)
 {
@@ -2924,7 +2924,7 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
     * enums in formats.h.
     */
 
-   switch (gl_format) {
+   switch (mesa_format) {
 
    case MESA_FORMAT_NONE:
    case MESA_FORMAT_COUNT:
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index a1f0d22..68f15be 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -310,77 +310,77 @@ typedef enum
    MESA_FORMAT_SIGNED_RG1616,
 
    MESA_FORMAT_COUNT
-} gl_format;
+} mesa_format;
 
 
 extern const char *
-_mesa_get_format_name(gl_format format);
+_mesa_get_format_name(mesa_format format);
 
 extern GLint
-_mesa_get_format_bytes(gl_format format);
+_mesa_get_format_bytes(mesa_format format);
 
 extern GLint
-_mesa_get_format_bits(gl_format format, GLenum pname);
+_mesa_get_format_bits(mesa_format format, GLenum pname);
 
 extern GLuint
-_mesa_get_format_max_bits(gl_format format);
+_mesa_get_format_max_bits(mesa_format format);
 
 extern GLenum
-_mesa_get_format_datatype(gl_format format);
+_mesa_get_format_datatype(mesa_format format);
 
 extern GLenum
-_mesa_get_format_base_format(gl_format format);
+_mesa_get_format_base_format(mesa_format format);
 
 extern void
-_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh);
+_mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh);
 
 extern GLboolean
-_mesa_is_format_compressed(gl_format format);
+_mesa_is_format_compressed(mesa_format format);
 
 extern GLboolean
-_mesa_is_format_packed_depth_stencil(gl_format format);
+_mesa_is_format_packed_depth_stencil(mesa_format format);
 
 extern GLboolean
-_mesa_is_format_integer_color(gl_format format);
+_mesa_is_format_integer_color(mesa_format format);
 
 extern GLboolean
-_mesa_is_format_unsigned(gl_format format);
+_mesa_is_format_unsigned(mesa_format format);
 
 extern GLboolean
-_mesa_is_format_signed(gl_format format);
+_mesa_is_format_signed(mesa_format format);
 
 extern GLenum
-_mesa_get_format_color_encoding(gl_format format);
+_mesa_get_format_color_encoding(mesa_format format);
 
 extern GLuint
-_mesa_format_image_size(gl_format format, GLsizei width,
+_mesa_format_image_size(mesa_format format, GLsizei width,
                         GLsizei height, GLsizei depth);
 
 extern uint64_t
-_mesa_format_image_size64(gl_format format, GLsizei width,
+_mesa_format_image_size64(mesa_format format, GLsizei width,
                           GLsizei height, GLsizei depth);
 
 extern GLint
-_mesa_format_row_stride(gl_format format, GLsizei width);
+_mesa_format_row_stride(mesa_format format, GLsizei width);
 
 extern void
-_mesa_format_to_type_and_comps(gl_format format,
+_mesa_format_to_type_and_comps(mesa_format format,
                                GLenum *datatype, GLuint *comps);
 
 extern void
 _mesa_test_formats(void);
 
-extern gl_format
-_mesa_get_srgb_format_linear(gl_format format);
+extern mesa_format
+_mesa_get_srgb_format_linear(mesa_format format);
 
-extern gl_format
-_mesa_get_uncompressed_format(gl_format format);
+extern mesa_format
+_mesa_get_uncompressed_format(mesa_format format);
 
 extern GLuint
-_mesa_format_num_components(gl_format format);
+_mesa_format_num_components(mesa_format format);
 
 GLboolean
-_mesa_format_matches_format_and_type(gl_format gl_format,
+_mesa_format_matches_format_and_type(mesa_format mesa_format,
 				     GLenum format, GLenum type,
                                      GLboolean swapBytes);
 
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 2fad458..21cbe1f 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -441,7 +441,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
       if (fb->Attachment[i].Renderbuffer) {
          const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
          const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
-         const gl_format fmt = rb->Format;
+         const mesa_format fmt = rb->Format;
 
          /* Grab samples and sampleBuffers from any attachment point (assuming
           * the framebuffer is complete, we'll get the same answer from all
@@ -468,7 +468,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
    for (i = 0; i < BUFFER_COUNT; i++) {
       if (fb->Attachment[i].Renderbuffer) {
          const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
-         const gl_format fmt = rb->Format;
+         const mesa_format fmt = rb->Format;
 
          if (_mesa_get_format_datatype(fmt) == GL_FLOAT) {
             fb->Visual.floatMode = GL_TRUE;
@@ -480,7 +480,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
    if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
       const struct gl_renderbuffer *rb =
          fb->Attachment[BUFFER_DEPTH].Renderbuffer;
-      const gl_format fmt = rb->Format;
+      const mesa_format fmt = rb->Format;
       fb->Visual.haveDepthBuffer = GL_TRUE;
       fb->Visual.depthBits = _mesa_get_format_bits(fmt, GL_DEPTH_BITS);
    }
@@ -488,7 +488,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
    if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) {
       const struct gl_renderbuffer *rb =
          fb->Attachment[BUFFER_STENCIL].Renderbuffer;
-      const gl_format fmt = rb->Format;
+      const mesa_format fmt = rb->Format;
       fb->Visual.haveStencilBuffer = GL_TRUE;
       fb->Visual.stencilBits = _mesa_get_format_bits(fmt, GL_STENCIL_BITS);
    }
@@ -496,7 +496,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
    if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) {
       const struct gl_renderbuffer *rb =
          fb->Attachment[BUFFER_ACCUM].Renderbuffer;
-      const gl_format fmt = rb->Format;
+      const mesa_format fmt = rb->Format;
       fb->Visual.haveAccumBuffer = GL_TRUE;
       fb->Visual.accumRedBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
       fb->Visual.accumGreenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 0330157..521b2d8 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1816,7 +1816,7 @@ GLboolean
 _mesa_prepare_mipmap_level(struct gl_context *ctx,
                            struct gl_texture_object *texObj, GLuint level,
                            GLsizei width, GLsizei height, GLsizei depth,
-                           GLsizei border, GLenum intFormat, gl_format format)
+                           GLsizei border, GLenum intFormat, mesa_format format)
 {
    const GLuint numFaces = _mesa_num_tex_faces(texObj->Target);
    GLuint face;
@@ -2018,7 +2018,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
 			   GLuint maxLevel)
 {
    GLuint level;
-   gl_format temp_format;
+   mesa_format temp_format;
    GLint components;
    GLuint temp_src_row_stride, temp_src_img_stride; /* in bytes */
    GLubyte *temp_src = NULL, *temp_dst = NULL;
diff --git a/src/mesa/main/mipmap.h b/src/mesa/main/mipmap.h
index ee91df0..c0366d3 100644
--- a/src/mesa/main/mipmap.h
+++ b/src/mesa/main/mipmap.h
@@ -45,7 +45,7 @@ extern GLboolean
 _mesa_prepare_mipmap_level(struct gl_context *ctx,
                            struct gl_texture_object *texObj, GLuint level,
                            GLsizei width, GLsizei height, GLsizei depth,
-                           GLsizei border, GLenum intFormat, gl_format format);
+                           GLsizei border, GLenum intFormat, mesa_format format);
 
 extern void
 _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 33df682..144af90 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1109,7 +1109,7 @@ struct gl_texture_image
 				 *   GL_DEPTH_STENCIL_EXT only. Used for
 				 *   choosing TexEnv arithmetic.
 				 */
-   gl_format TexFormat;         /**< The actual texture memory format */
+   mesa_format TexFormat;         /**< The actual texture memory format */
 
    GLuint Border;		/**< 0 or 1 */
    GLuint Width;		/**< = 2^WidthLog2 + 2*Border */
@@ -1223,7 +1223,7 @@ struct gl_texture_object
    struct gl_buffer_object *BufferObject;
    GLenum BufferObjectFormat;
    /** Equivalent Mesa format for BufferObjectFormat. */
-   gl_format _BufferObjectFormat;
+   mesa_format _BufferObjectFormat;
    /** GL_ARB_texture_buffer_range */
    GLintptr BufferOffset;
    GLsizeiptr BufferSize; /**< if this is -1, use BufferObject->Size instead */
@@ -2919,7 +2919,7 @@ struct gl_renderbuffer
    GLenum InternalFormat; /**< The user-specified format */
    GLenum _BaseFormat;    /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or
                                GL_STENCIL_INDEX. */
-   gl_format Format;      /**< The actual renderbuffer memory format */
+   mesa_format Format;      /**< The actual renderbuffer memory format */
    /**
     * Pointer to the texture image if this renderbuffer wraps a texture,
     * otherwise NULL.
@@ -3842,7 +3842,7 @@ struct gl_image_unit
    /**
     * Mesa format corresponding to \c Format.
     */
-   gl_format _ActualFormat;
+   mesa_format _ActualFormat;
 
    /**
     * GL_TRUE if the state of this image unit is valid and access from
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 51a0b15..63cf020 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -45,7 +45,7 @@
  * Return true if the conversion L=R+G+B is needed.
  */
 static GLboolean
-need_rgb_to_luminance_conversion(gl_format texFormat, GLenum format)
+need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format)
 {
    GLenum baseTexFormat = _mesa_get_format_base_format(texFormat);
 
@@ -60,7 +60,7 @@ need_rgb_to_luminance_conversion(gl_format texFormat, GLenum format)
  * Return transfer op flags for this ReadPixels operation.
  */
 static GLbitfield
-get_readpixels_transfer_ops(const struct gl_context *ctx, gl_format texFormat,
+get_readpixels_transfer_ops(const struct gl_context *ctx, mesa_format texFormat,
                             GLenum format, GLenum type, GLboolean uses_blit)
 {
    GLbitfield transferOps = ctx->_ImageTransferState;
@@ -493,7 +493,7 @@ slow_read_rgba_pixels( struct gl_context *ctx,
 		       GLbitfield transferOps )
 {
    struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
-   const gl_format rbFormat = _mesa_get_srgb_format_linear(rb->Format);
+   const mesa_format rbFormat = _mesa_get_srgb_format_linear(rb->Format);
    void *rgba;
    GLubyte *dst, *map;
    int dstStride, stride, j;
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index 80c4693..cfb5ad4 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -57,7 +57,7 @@
 # define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88_REV
 #endif
 
-static gl_format
+static mesa_format
 get_image_format(GLenum format)
 {
    switch (format) {
@@ -205,7 +205,7 @@ enum image_format_class
 };
 
 static enum image_format_class
-get_image_format_class(gl_format format)
+get_image_format_class(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RGBA_FLOAT32:
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 47ad306..4763363 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -361,7 +361,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
 /**
  * Convert a compressed MESA_FORMAT_x to a GLenum.
  */
-gl_format
+mesa_format
 _mesa_glenum_to_compressed_format(GLenum format)
 {
    switch (format) {
@@ -451,7 +451,7 @@ _mesa_glenum_to_compressed_format(GLenum format)
  * internal format unchanged.
  */
 GLenum
-_mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat)
+_mesa_compressed_format_to_glenum(struct gl_context *ctx, mesa_format mesaFormat)
 {
    switch (mesaFormat) {
    case MESA_FORMAT_RGB_FXT1:
@@ -535,7 +535,7 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat)
  */
 GLubyte *
 _mesa_compressed_image_address(GLint col, GLint row, GLint img,
-                               gl_format mesaFormat,
+                               mesa_format mesaFormat,
                                GLsizei width, const GLubyte *image)
 {
    /* XXX only 2D images implemented, not 3D */
@@ -560,7 +560,7 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
  * invalid format.
  */
 compressed_fetch_func
-_mesa_get_compressed_fetch_func(gl_format format)
+_mesa_get_compressed_fetch_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RGB_DXT1:
@@ -598,7 +598,7 @@ _mesa_get_compressed_fetch_func(gl_format format)
  *                      compressed source image.
  */
 void
-_mesa_decompress_image(gl_format format, GLuint width, GLuint height,
+_mesa_decompress_image(mesa_format format, GLuint width, GLuint height,
                        const GLubyte *src, GLint srcRowStride,
                        GLfloat *dest)
 {
diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h
index c6a6e87..b00924d 100644
--- a/src/mesa/main/texcompress.h
+++ b/src/mesa/main/texcompress.h
@@ -36,15 +36,15 @@ _mesa_gl_compressed_format_base_format(GLenum format);
 extern GLuint
 _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats);
 
-extern gl_format
+extern mesa_format
 _mesa_glenum_to_compressed_format(GLenum format);
 
 extern GLenum
-_mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat);
+_mesa_compressed_format_to_glenum(struct gl_context *ctx, mesa_format mesaFormat);
 
 extern GLubyte *
 _mesa_compressed_image_address(GLint col, GLint row, GLint img,
-                               gl_format mesaFormat,
+                               mesa_format mesaFormat,
                                GLsizei width, const GLubyte *image);
 
 
@@ -55,11 +55,11 @@ typedef void (*compressed_fetch_func)(const GLubyte *map,
                                       GLfloat *texel);
 
 extern compressed_fetch_func
-_mesa_get_compressed_fetch_func(gl_format format);
+_mesa_get_compressed_fetch_func(mesa_format format);
 
 
 extern void
-_mesa_decompress_image(gl_format format, GLuint width, GLuint height,
+_mesa_decompress_image(mesa_format format, GLuint width, GLuint height,
                        const GLubyte *src, GLint srcRowStride,
                        GLfloat *dest);
 
diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c
index a06d29f..75bb9f7 100644
--- a/src/mesa/main/texcompress_etc.c
+++ b/src/mesa/main/texcompress_etc.c
@@ -1175,7 +1175,7 @@ _mesa_unpack_etc2_format(uint8_t *dst_row,
                          unsigned src_stride,
                          unsigned src_width,
                          unsigned src_height,
-                         gl_format format)
+                         mesa_format format)
 {
    if (format == MESA_FORMAT_ETC2_RGB8)
       etc2_unpack_rgb8(dst_row, dst_stride,
@@ -1452,7 +1452,7 @@ fetch_etc2_srgb8_punchthrough_alpha1(const GLubyte *map,
 
 
 compressed_fetch_func
-_mesa_get_etc_fetch_func(gl_format format)
+_mesa_get_etc_fetch_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_ETC1_RGB8:
diff --git a/src/mesa/main/texcompress_etc.h b/src/mesa/main/texcompress_etc.h
index 9da0fb3..319b7be 100644
--- a/src/mesa/main/texcompress_etc.h
+++ b/src/mesa/main/texcompress_etc.h
@@ -77,9 +77,9 @@ _mesa_unpack_etc2_format(uint8_t *dst_row,
                          unsigned src_stride,
                          unsigned src_width,
                          unsigned src_height,
-                         gl_format format);
+                         mesa_format format);
 
 compressed_fetch_func
-_mesa_get_etc_fetch_func(gl_format format);
+_mesa_get_etc_fetch_func(mesa_format format);
 
 #endif
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 8d37d81..61b01c6 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -1641,7 +1641,7 @@ fetch_rgba_fxt1(const GLubyte *map,
 
 
 compressed_fetch_func
-_mesa_get_fxt_fetch_func(gl_format format)
+_mesa_get_fxt_fetch_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RGB_FXT1:
diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h
index 4f46d77..21032ee 100644
--- a/src/mesa/main/texcompress_fxt1.h
+++ b/src/mesa/main/texcompress_fxt1.h
@@ -37,6 +37,6 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS);
 
 
 compressed_fetch_func
-_mesa_get_fxt_fetch_func(gl_format format);
+_mesa_get_fxt_fetch_func(mesa_format format);
 
 #endif /* TEXCOMPRESS_FXT1_H */
diff --git a/src/mesa/main/texcompress_rgtc.c b/src/mesa/main/texcompress_rgtc.c
index 7afd8ff..7f052fb 100644
--- a/src/mesa/main/texcompress_rgtc.c
+++ b/src/mesa/main/texcompress_rgtc.c
@@ -439,7 +439,7 @@ fetch_signed_la_latc2(const GLubyte *map,
 
 
 compressed_fetch_func
-_mesa_get_compressed_rgtc_func(gl_format format)
+_mesa_get_compressed_rgtc_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RED_RGTC1:
diff --git a/src/mesa/main/texcompress_rgtc.h b/src/mesa/main/texcompress_rgtc.h
index 98638f0..e9e2495 100644
--- a/src/mesa/main/texcompress_rgtc.h
+++ b/src/mesa/main/texcompress_rgtc.h
@@ -41,7 +41,7 @@ extern GLboolean
 _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS);
 
 extern compressed_fetch_func
-_mesa_get_compressed_rgtc_func(gl_format format);
+_mesa_get_compressed_rgtc_func(mesa_format format);
 
 
 #endif
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index a815193..894c46d 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -483,7 +483,7 @@ fetch_srgba_dxt5(const GLubyte *map,
 
 
 compressed_fetch_func
-_mesa_get_dxt_fetch_func(gl_format format)
+_mesa_get_dxt_fetch_func(mesa_format format)
 {
    switch (format) {
    case MESA_FORMAT_RGB_DXT1:
diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h
index d8d8fbf..2734210 100644
--- a/src/mesa/main/texcompress_s3tc.h
+++ b/src/mesa/main/texcompress_s3tc.h
@@ -49,7 +49,7 @@ extern void
 _mesa_init_texture_s3tc(struct gl_context *ctx);
 
 extern compressed_fetch_func
-_mesa_get_dxt_fetch_func(gl_format format);
+_mesa_get_dxt_fetch_func(mesa_format format);
 
 
 #endif /* TEXCOMPRESS_S3TC_H */
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index d3aa477..0a993ed 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -54,12 +54,12 @@
  * \param format  incoming image pixel format.
  * \param type  incoming image data type.
  *
- * \return the closest gl_format for the given format/type arguments
+ * \return the closest mesa_format for the given format/type arguments
  *
  * This is called via dd_function_table::ChooseTextureFormat.  Hardware
  * drivers may override this function with a specialized version.
  */
-gl_format
+mesa_format
 _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
                         GLint internalFormat, GLenum format, GLenum type)
 {
diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h
index 88ad4d1..32e2099 100644
--- a/src/mesa/main/texformat.h
+++ b/src/mesa/main/texformat.h
@@ -31,7 +31,7 @@
 
 struct gl_context;
 
-extern gl_format
+extern mesa_format
 _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
                         GLint internalFormat, GLenum format, GLenum type);
 
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 200d29c..133fa53 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -225,7 +225,7 @@ get_tex_rgba_compressed(struct gl_context *ctx, GLuint dimensions,
                         GLbitfield transferOps)
 {
    /* don't want to apply sRGB -> RGB conversion here so override the format */
-   const gl_format texFormat =
+   const mesa_format texFormat =
       _mesa_get_srgb_format_linear(texImage->TexFormat);
    const GLenum baseFormat = _mesa_get_format_base_format(texFormat);
    const GLenum destBaseFormat = _mesa_base_tex_format(ctx, format);
@@ -360,7 +360,7 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, GLuint dimensions,
                           GLbitfield transferOps)
 {
    /* don't want to apply sRGB -> RGB conversion here so override the format */
-   const gl_format texFormat =
+   const mesa_format texFormat =
       _mesa_get_srgb_format_linear(texImage->TexFormat);
    const GLuint width = texImage->Width;
    GLenum destBaseFormat = _mesa_base_pack_format(format);
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 8aac54e..887ce73 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1325,7 +1325,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx,
                            struct gl_texture_image *img,
                            GLsizei width, GLsizei height, GLsizei depth,
                            GLint border, GLenum internalFormat,
-                           gl_format format)
+                           mesa_format format)
 {
    GLenum target;
    ASSERT(img);
@@ -1748,7 +1748,7 @@ error_check_subtexture_dimensions(struct gl_context *ctx,
  */
 GLboolean
 _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-                          gl_format format,
+                          mesa_format format,
                           GLint width, GLint height, GLint depth, GLint border)
 {
    /* We just check if the image size is less than MaxTextureMbytes.
@@ -1957,7 +1957,7 @@ static GLuint
 compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth,
                     GLenum glformat)
 {
-   gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
+   mesa_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
    return _mesa_format_image_size(mesaFormat, width, height, depth);
 }
 
@@ -2918,13 +2918,13 @@ override_internal_format(GLenum internalFormat, GLint width, GLint height)
  * for efficient texture memory layout/allocation.  In particular, this
  * comes up during automatic mipmap generation.
  */
-gl_format
+mesa_format
 _mesa_choose_texture_format(struct gl_context *ctx,
                             struct gl_texture_object *texObj,
                             GLenum target, GLint level,
                             GLenum internalFormat, GLenum format, GLenum type)
 {
-   gl_format f;
+   mesa_format f;
 
    /* see if we've already chosen a format for the previous level */
    if (level > 0) {
@@ -3046,7 +3046,7 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
    struct gl_pixelstore_attrib unpack_no_border;
    const struct gl_pixelstore_attrib *unpack = &ctx->Unpack;
    struct gl_texture_object *texObj;
-   gl_format texFormat;
+   mesa_format texFormat;
    GLboolean dimensionsOK, sizeOK;
 
    FLUSH_VERTICES(ctx, 0);
@@ -3470,7 +3470,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
  * from.  This depends on whether the texture contains color or depth values.
  */
 static struct gl_renderbuffer *
-get_copy_tex_image_source(struct gl_context *ctx, gl_format texFormat)
+get_copy_tex_image_source(struct gl_context *ctx, mesa_format texFormat)
 {
    if (_mesa_get_format_bits(texFormat, GL_DEPTH_BITS) > 0) {
       /* reading from depth/stencil buffer */
@@ -3524,7 +3524,7 @@ copyteximage(struct gl_context *ctx, GLuint dims,
    struct gl_texture_object *texObj;
    struct gl_texture_image *texImage;
    const GLuint face = _mesa_tex_target_to_face(target);
-   gl_format texFormat;
+   mesa_format texFormat;
 
    FLUSH_VERTICES(ctx, 0);
 
@@ -3962,7 +3962,7 @@ _mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
                             width, height, depth, format, imageSize, data);
 }
 
-static gl_format
+static mesa_format
 get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
 {
    if (ctx->API != API_OPENGL_CORE) {
@@ -4136,11 +4136,11 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
 }
 
 
-gl_format
+mesa_format
 _mesa_validate_texbuffer_format(const struct gl_context *ctx,
                                 GLenum internalFormat)
 {
-   gl_format format = get_texbuffer_format(ctx, internalFormat);
+   mesa_format format = get_texbuffer_format(ctx, internalFormat);
    GLenum datatype;
 
    if (format == MESA_FORMAT_NONE)
@@ -4174,7 +4174,7 @@ texbufferrange(struct gl_context *ctx, GLenum target, GLenum internalFormat,
                GLintptr offset, GLsizeiptr size)
 {
    struct gl_texture_object *texObj;
-   gl_format format;
+   mesa_format format;
 
    FLUSH_VERTICES(ctx, 0);
 
@@ -4311,7 +4311,7 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
    struct gl_texture_object *texObj;
    struct gl_texture_image *texImage;
    GLboolean sizeOK, dimensionsOK;
-   gl_format texFormat;
+   mesa_format texFormat;
    GLenum sample_count_error;
 
    GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 80a0a57..6b70ad8 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -83,10 +83,10 @@ _mesa_init_teximage_fields(struct gl_context *ctx,
                            struct gl_texture_image *img,
                            GLsizei width, GLsizei height, GLsizei depth,
                            GLint border, GLenum internalFormat,
-                           gl_format format);
+                           mesa_format format);
 
 
-extern gl_format
+extern mesa_format
 _mesa_choose_texture_format(struct gl_context *ctx,
                             struct gl_texture_object *texObj,
                             GLenum target, GLint level,
@@ -128,7 +128,7 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target);
 
 extern GLboolean
 _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-                          gl_format format,
+                          mesa_format format,
                           GLint width, GLint height, GLint depth, GLint border);
 
 
@@ -153,7 +153,7 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target,
                                GLint level, GLint width, GLint height,
                                GLint depth, GLint border);
 
-extern gl_format
+extern mesa_format
 _mesa_validate_texbuffer_format(const struct gl_context *ctx,
                                 GLenum internalFormat);
 
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 3c64c437..30e8dd5 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -745,7 +745,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
       GLubyte texel[4];
       struct gl_texture_object *texObj;
       struct gl_texture_image *texImage;
-      gl_format texFormat;
+      mesa_format texFormat;
       GLuint dims, face, numFaces = 1;
       GLenum target;
 
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 7c59d11..8145a65 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1081,7 +1081,7 @@ get_tex_level_parameter_image(struct gl_context *ctx,
                               GLenum pname, GLint *params)
 {
    const struct gl_texture_image *img = NULL;
-   gl_format texFormat;
+   mesa_format texFormat;
 
    img = _mesa_select_tex_image(ctx, texObj, target, level);
    if (!img || img->TexFormat == MESA_FORMAT_NONE) {
@@ -1237,7 +1237,7 @@ get_tex_level_parameter_buffer(struct gl_context *ctx,
                                GLenum pname, GLint *params)
 {
    const struct gl_buffer_object *bo = texObj->BufferObject;
-   gl_format texFormat = texObj->_BufferObjectFormat;
+   mesa_format texFormat = texObj->_BufferObjectFormat;
    GLenum internalFormat = texObj->BufferObjectFormat;
    GLenum baseFormat = _mesa_get_format_base_format(texFormat);
 
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 5062fdb..dd82696 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -120,7 +120,7 @@ initialize_texture_fields(struct gl_context *ctx,
                           struct gl_texture_object *texObj,
                           GLint levels,
                           GLsizei width, GLsizei height, GLsizei depth,
-                          GLenum internalFormat, gl_format texFormat)
+                          GLenum internalFormat, mesa_format texFormat)
 {
    const GLenum target = texObj->Target;
    const GLuint numFaces = _mesa_num_tex_faces(target);
@@ -341,7 +341,7 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
 {
    struct gl_texture_object *texObj;
    GLboolean sizeOK, dimensionsOK;
-   gl_format texFormat;
+   mesa_format texFormat;
 
    GET_CURRENT_CONTEXT(ctx);
 
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 8eaf43a..42f86b7 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -923,7 +923,7 @@ _mesa_swizzle_ubyte_image(struct gl_context *ctx,
 static void
 memcpy_texture(struct gl_context *ctx,
 	       GLuint dimensions,
-               gl_format dstFormat,
+               mesa_format dstFormat,
                GLint dstRowStride,
                GLubyte **dstSlices,
                GLint srcWidth, GLint srcHeight, GLint srcDepth,
@@ -3235,7 +3235,7 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_srgb8(TEXSTORE_PARAMS)
 {
-   gl_format newDstFormat;
+   mesa_format newDstFormat;
    GLboolean k;
 
    ASSERT(dstFormat == MESA_FORMAT_SRGB8);
@@ -3256,7 +3256,7 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_srgba8(TEXSTORE_PARAMS)
 {
-   gl_format newDstFormat;
+   mesa_format newDstFormat;
    GLboolean k;
 
    ASSERT(dstFormat == MESA_FORMAT_SRGBA8 ||
@@ -3287,7 +3287,7 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_sargb8(TEXSTORE_PARAMS)
 {
-   gl_format newDstFormat;
+   mesa_format newDstFormat;
    GLboolean k;
 
    ASSERT(dstFormat == MESA_FORMAT_SARGB8);
@@ -3308,7 +3308,7 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_sl8(TEXSTORE_PARAMS)
 {
-   gl_format newDstFormat;
+   mesa_format newDstFormat;
    GLboolean k;
 
    ASSERT(dstFormat == MESA_FORMAT_SL8);
@@ -3329,7 +3329,7 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS)
 static GLboolean
 _mesa_texstore_sla8(TEXSTORE_PARAMS)
 {
-   gl_format newDstFormat;
+   mesa_format newDstFormat;
    GLboolean k;
 
    ASSERT(dstFormat == MESA_FORMAT_SLA8);
@@ -3652,7 +3652,7 @@ _mesa_texstore_null(TEXSTORE_PARAMS)
  * Return the StoreTexImageFunc pointer to store an image in the given format.
  */
 static StoreTexImageFunc
-_mesa_get_texstore_func(gl_format format)
+_mesa_get_texstore_func(mesa_format format)
 {
    static StoreTexImageFunc table[MESA_FORMAT_COUNT];
    static GLboolean initialized = GL_FALSE;
@@ -3870,7 +3870,7 @@ _mesa_get_texstore_func(gl_format format)
 GLboolean
 _mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
                                   GLenum baseInternalFormat,
-                                  gl_format dstFormat)
+                                  mesa_format dstFormat)
 {
    GLenum dstType;
 
@@ -3899,7 +3899,7 @@ _mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
 
 GLboolean
 _mesa_texstore_can_use_memcpy(struct gl_context *ctx,
-                              GLenum baseInternalFormat, gl_format dstFormat,
+                              GLenum baseInternalFormat, mesa_format dstFormat,
                               GLenum srcFormat, GLenum srcType,
                               const struct gl_pixelstore_attrib *srcPacking)
 {
@@ -3977,7 +3977,7 @@ _mesa_texstore(TEXSTORE_PARAMS)
  * \param texFormat  the destination texture format
  */
 static GLbitfield
-get_read_write_mode(GLenum userFormat, gl_format texFormat)
+get_read_write_mode(GLenum userFormat, mesa_format texFormat)
 {
    if ((userFormat == GL_STENCIL_INDEX || userFormat == GL_DEPTH_COMPONENT)
        && _mesa_get_format_base_format(texFormat) == GL_DEPTH_STENCIL)
@@ -4220,7 +4220,7 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
    GLint i, rows;
    GLubyte *dstMap;
    const GLubyte *src;
-   const gl_format texFormat = texImage->TexFormat;
+   const mesa_format texFormat = texImage->TexFormat;
    GLuint bw, bh;
    GLint slice;
 
diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h
index fbb3b26..490f9f5 100644
--- a/src/mesa/main/texstore.h
+++ b/src/mesa/main/texstore.h
@@ -57,7 +57,7 @@
 #define TEXSTORE_PARAMS \
 	struct gl_context *ctx, GLuint dims, \
 	GLenum baseInternalFormat, \
-	gl_format dstFormat, \
+	mesa_format dstFormat, \
         GLint dstRowStride, \
         GLubyte **dstSlices, \
 	GLint srcWidth, GLint srcHeight, GLint srcDepth, \
@@ -72,11 +72,11 @@ _mesa_texstore(TEXSTORE_PARAMS);
 extern GLboolean
 _mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
                                   GLenum baseInternalFormat,
-                                  gl_format dstFormat);
+                                  mesa_format dstFormat);
 
 extern GLboolean
 _mesa_texstore_can_use_memcpy(struct gl_context *ctx,
-                              GLenum baseInternalFormat, gl_format dstFormat,
+                              GLenum baseInternalFormat, mesa_format dstFormat,
                               GLenum srcFormat, GLenum srcType,
                               const struct gl_pixelstore_attrib *srcPacking);
 
diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c
index 5f88a41..77a3b78 100644
--- a/src/mesa/main/textureview.c
+++ b/src/mesa/main/textureview.c
@@ -196,7 +196,7 @@ initialize_texture_fields(struct gl_context *ctx,
                           struct gl_texture_object *texObj,
                           GLint levels,
                           GLsizei width, GLsizei height, GLsizei depth,
-                          GLenum internalFormat, gl_format texFormat)
+                          GLenum internalFormat, mesa_format texFormat)
 {
    const GLuint numFaces = _mesa_num_tex_faces(target);
    GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
@@ -430,7 +430,7 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture,
    GLuint newViewMinLevel, newViewMinLayer;
    GLuint newViewNumLevels, newViewNumLayers;
    GLsizei width, height, depth;
-   gl_format texFormat;
+   mesa_format texFormat;
    GLboolean sizeOK, dimensionsOK;
    GLenum faceTarget;
 
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 3058dfb..1d0a826 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -483,7 +483,7 @@ make_texture(struct st_context *st,
 {
    struct gl_context *ctx = st->ctx;
    struct pipe_context *pipe = st->pipe;
-   gl_format mformat;
+   mesa_format mformat;
    struct pipe_resource *pt;
    enum pipe_format pipeFormat;
    GLenum baseInternalFormat;
@@ -542,7 +542,7 @@ make_texture(struct st_context *st,
        */
       success = _mesa_texstore(ctx, 2,           /* dims */
                                baseInternalFormat, /* baseInternalFormat */
-                               mformat,          /* gl_format */
+                               mformat,          /* mesa_format */
                                transfer->stride, /* dstRowStride, bytes */
                                &dest,            /* destSlices */
                                width, height, 1, /* size */
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index 7484cb4..561967d 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -99,7 +99,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
    struct st_texture_object *stObj;
    struct st_texture_image *stImage;
    GLenum internalFormat;
-   gl_format texFormat;
+   mesa_format texFormat;
 
    /* map pipe format to base format */
    if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index daa94df..c04a254 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -541,7 +541,7 @@ st_validate_attachment(struct gl_context *ctx,
 {
    const struct st_texture_object *stObj = st_texture_object(att->Texture);
    enum pipe_format format;
-   gl_format texFormat;
+   mesa_format texFormat;
    GLboolean valid;
 
    /* Only validate texture attachments for now, since
@@ -562,7 +562,7 @@ st_validate_attachment(struct gl_context *ctx,
     * Later when we create a surface, we change the format to a linear one. */
    if (!ctx->Extensions.EXT_framebuffer_sRGB &&
        _mesa_get_format_color_encoding(texFormat) == GL_SRGB) {
-      const gl_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
+      const mesa_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
       format = st_mesa_format_to_pipe_format(linearFormat);
    }
 
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index c09f34e..61738d7 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -519,7 +519,7 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage,
    if (stObj->surface_based) {
       const GLenum target = texObj->Target;
       const GLuint level = texImage->Level;
-      gl_format texFormat;
+      mesa_format texFormat;
 
       _mesa_clear_texture_object(ctx, texObj);
       pipe_resource_reference(&stObj->pt, NULL);
@@ -604,7 +604,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
    struct pipe_transfer *transfer;
    struct pipe_blit_info blit;
    enum pipe_format src_format, dst_format;
-   gl_format mesa_src_format;
+   mesa_format mesa_src_format;
    GLenum gl_target = texImage->TexObject->Target;
    unsigned bind;
    GLubyte *map;
@@ -856,7 +856,7 @@ st_GetTexImage(struct gl_context * ctx,
    struct pipe_resource *dst = NULL;
    struct pipe_resource dst_templ;
    enum pipe_format dst_format, src_format;
-   gl_format mesa_format;
+   mesa_format mesa_format;
    GLenum gl_target = texImage->TexObject->Target;
    enum pipe_texture_target pipe_target;
    struct pipe_blit_info blit;
@@ -1689,7 +1689,7 @@ st_AllocTextureStorage(struct gl_context *ctx,
 
 static GLboolean
 st_TestProxyTexImage(struct gl_context *ctx, GLenum target,
-                     GLint level, gl_format format,
+                     GLint level, mesa_format format,
                      GLint width, GLint height,
                      GLint depth, GLint border)
 {
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 6acf983..1cd01c7 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -54,7 +54,7 @@
  * Translate Mesa format to Gallium format.
  */
 enum pipe_format
-st_mesa_format_to_pipe_format(gl_format mesaFormat)
+st_mesa_format_to_pipe_format(mesa_format mesaFormat)
 {
    switch (mesaFormat) {
    case MESA_FORMAT_RGBA8888:
@@ -400,7 +400,7 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
 /**
  * Translate Gallium format to Mesa format.
  */
-gl_format
+mesa_format
 st_pipe_format_to_mesa_format(enum pipe_format format)
 {
    switch (format) {
@@ -1687,7 +1687,7 @@ enum pipe_format
 st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
 			  GLenum format, GLenum type, GLboolean swapBytes)
 {
-   gl_format mesa_format;
+   mesa_format mesa_format;
 
    for (mesa_format = 1; mesa_format < MESA_FORMAT_COUNT; mesa_format++) {
       if (_mesa_get_format_color_encoding(mesa_format) == GL_SRGB) {
@@ -1714,7 +1714,7 @@ st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
 /**
  * Called via ctx->Driver.ChooseTextureFormat().
  */
-gl_format
+mesa_format
 st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
                        GLint internalFormat,
                        GLenum format, GLenum type)
diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h
index 3278748..6501c79 100644
--- a/src/mesa/state_tracker/st_format.h
+++ b/src/mesa/state_tracker/st_format.h
@@ -41,9 +41,9 @@ struct pipe_screen;
 
 
 extern enum pipe_format
-st_mesa_format_to_pipe_format(gl_format mesaFormat);
+st_mesa_format_to_pipe_format(mesa_format mesaFormat);
 
-extern gl_format
+extern mesa_format
 st_pipe_format_to_mesa_format(enum pipe_format pipeFormat);
 
 
@@ -61,7 +61,7 @@ extern enum pipe_format
 st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
 			  GLenum format, GLenum type, GLboolean swapBytes);
 
-extern gl_format
+extern mesa_format
 st_ChooseTextureFormat(struct gl_context * ctx, GLenum target,
                        GLint internalFormat,
                        GLenum format, GLenum type);
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 8158450..b7757e9 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -508,7 +508,7 @@ st_context_teximage(struct st_context_iface *stctxi,
    texImage = _mesa_get_tex_image(ctx, texObj, target, level);
    stImage = st_texture_image(texImage);
    if (tex) {
-      gl_format texFormat = st_pipe_format_to_mesa_format(pipe_format);
+      mesa_format texFormat = st_pipe_format_to_mesa_format(pipe_format);
 
       if (util_format_has_alpha(tex->format))
          internalFormat = GL_RGBA;
diff --git a/src/mesa/state_tracker/st_vdpau.c b/src/mesa/state_tracker/st_vdpau.c
index 9b165ee..4317b9e 100644
--- a/src/mesa/state_tracker/st_vdpau.c
+++ b/src/mesa/state_tracker/st_vdpau.c
@@ -63,7 +63,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
  
    struct pipe_resource *res;
    struct pipe_sampler_view *sv, templ;
-   gl_format texFormat;
+   mesa_format texFormat;
 
    getProcAddr = ctx->vdpGetProcAddress;
    if (output) {
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index bbb0013..dc9c87c 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -536,7 +536,7 @@ blit_linear(struct gl_context *ctx,
    GLint srcBufferY0 = -1, srcBufferY1 = -1;
    GLvoid *dstBuffer;
 
-   gl_format readFormat = _mesa_get_srgb_format_linear(readRb->Format);
+   mesa_format readFormat = _mesa_get_srgb_format_linear(readRb->Format);
    GLuint bpp = _mesa_get_format_bytes(readFormat);
 
    GLenum pixelType;
@@ -571,7 +571,7 @@ blit_linear(struct gl_context *ctx,
       GLint idx = drawFb->_ColorDrawBufferIndexes[i];
       struct gl_renderbuffer_attachment *drawAtt;
       struct gl_renderbuffer *drawRb;
-      gl_format drawFormat;
+      mesa_format drawFormat;
 
       if (idx == -1)
          continue;
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 3eeeb24..27f1158 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -61,7 +61,7 @@ ENDIF
  * within the 4-byte pixel will be either 0 or 3.
  */
 static GLint
-get_stencil_offset(gl_format format)
+get_stencil_offset(mesa_format format)
 {
    const GLubyte one = 1;
    GLubyte pixel[MAX_PIXEL_BYTES];
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index b886e65..7f9d386 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -134,7 +134,7 @@ static void fetch_null_texelf( const struct swrast_texture_image *texImage,
  * XXX this is somewhat temporary.
  */
 static struct {
-   gl_format Name;
+   mesa_format Name;
    FetchTexelFunc Fetch1D;
    FetchTexelFunc Fetch2D;
    FetchTexelFunc Fetch3D;
@@ -1314,11 +1314,11 @@ static void
 set_fetch_functions(const struct gl_sampler_object *samp,
                     struct swrast_texture_image *texImage, GLuint dims)
 {
-   gl_format format = texImage->Base.TexFormat;
+   mesa_format format = texImage->Base.TexFormat;
 
 #ifdef DEBUG
    /* check that the table entries are sorted by format name */
-   gl_format fmt;
+   mesa_format fmt;
    for (fmt = 0; fmt < MESA_FORMAT_COUNT; fmt++) {
       assert(texfetch_funcs[fmt].Name == fmt);
    }
diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c
index 751d776..d67e48a 100644
--- a/src/mesa/swrast/s_texrender.c
+++ b/src/mesa/swrast/s_texrender.c
@@ -33,7 +33,7 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
    struct gl_renderbuffer *rb = att->Renderbuffer;
    struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
    struct swrast_texture_image *swImage;
-   gl_format format;
+   mesa_format format;
    GLuint zOffset;
 
    (void) ctx;
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 085021b..69c812f 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -1050,7 +1050,7 @@ _swrast_choose_triangle( struct gl_context *ctx )
          const struct gl_texture_image *texImg;
          const struct swrast_texture_image *swImg;
          GLenum minFilter, magFilter, envMode;
-         gl_format format;
+         mesa_format format;
          texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX];
          if (ctx->Texture.Unit[0].Sampler)
             samp = ctx->Texture.Unit[0].Sampler;
-- 
1.8.3.1



More information about the mesa-dev mailing list