[Mesa-dev] [PATCH 06/11] intel: Drop the "intel" argument to intel_miptree_release().

Eric Anholt eric at anholt.net
Thu Sep 22 12:34:18 PDT 2011


We don't have it in the other refcounting functions, and it was
totally unused.
---
 src/mesa/drivers/dri/intel/intel_fbo.c          |    2 +-
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c  |    3 +--
 src/mesa/drivers/dri/intel/intel_mipmap_tree.h  |    3 +--
 src/mesa/drivers/dri/intel/intel_tex.c          |    8 +++-----
 src/mesa/drivers/dri/intel/intel_tex_image.c    |    2 +-
 src/mesa/drivers/dri/intel/intel_tex_validate.c |    8 +++-----
 6 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 315108e..c0fb8d8 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -747,7 +747,7 @@ intel_render_texture(struct gl_context * ctx,
 			       intel_image->base.Base.Level,
 			       old_mt);
 
-      intel_miptree_release(intel, &intel_image->mt);
+      intel_miptree_release(&intel_image->mt);
       intel_image->mt = new_mt;
       intel_renderbuffer_set_draw_offset(irb, intel_image, att->Zoffset);
 
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index b77c5d7..5434e48 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -187,8 +187,7 @@ intel_miptree_reference(struct intel_mipmap_tree **dst,
 
 
 void
-intel_miptree_release(struct intel_context *intel,
-                      struct intel_mipmap_tree **mt)
+intel_miptree_release(struct intel_mipmap_tree **mt)
 {
    if (!*mt)
       return;
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index 7f20319..cae9b35 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -158,8 +158,7 @@ int intel_miptree_pitch_align (struct intel_context *intel,
 void intel_miptree_reference(struct intel_mipmap_tree **dst,
                              struct intel_mipmap_tree *src);
 
-void intel_miptree_release(struct intel_context *intel,
-                           struct intel_mipmap_tree **mt);
+void intel_miptree_release(struct intel_mipmap_tree **mt);
 
 /* Check if an image fits an existing mipmap tree layout
  */
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 3ce5b90..61e705c 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -43,10 +43,9 @@ static void
 intelDeleteTextureObject(struct gl_context *ctx,
 			 struct gl_texture_object *texObj)
 {
-   struct intel_context *intel = intel_context(ctx);
    struct intel_texture_object *intelObj = intel_texture_object(texObj);
 
-   intel_miptree_release(intel, &intelObj->mt);
+   intel_miptree_release(&intelObj->mt);
    _mesa_delete_texture_object(ctx, texObj);
 }
 
@@ -55,12 +54,11 @@ static void
 intel_free_texture_image_buffer(struct gl_context * ctx,
 				struct gl_texture_image *texImage)
 {
-   struct intel_context *intel = intel_context(ctx);
    struct intel_texture_image *intelImage = intel_texture_image(texImage);
 
    DBG("%s\n", __FUNCTION__);
 
-   intel_miptree_release(intel, &intelImage->mt);
+   intel_miptree_release(&intelImage->mt);
 
    if (texImage->Data) {
       _mesa_free_texmemory(texImage->Data);
@@ -188,7 +186,7 @@ intelGenerateMipmap(struct gl_context *ctx, GLenum target,
                /* Unreference the miptree to signal that the new Data is a
                 * bare pointer from mesa.
                 */
-               intel_miptree_release(intel, &intelImage->mt);
+               intel_miptree_release(&intelImage->mt);
             }
          }
       }
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index cbc9a49..69da0e2 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -392,7 +392,7 @@ intelTexImage(struct gl_context * ctx,
        * before, and any lower levels would fit into our miptree.
        */
       if (intelImage->mt) {
-	 intel_miptree_release(intel, &intelObj->mt);
+	 intel_miptree_release(&intelObj->mt);
 	 intel_miptree_reference(&intelObj->mt, intelImage->mt);
       }
    }
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index 59f39de..59354d6 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -44,7 +44,7 @@ copy_image_data_to_tree(struct intel_context *intel,
                                intelImage->base.Base.Face,
                                intelImage->base.Base.Level, intelImage->mt);
 
-      intel_miptree_release(intel, &intelImage->mt);
+      intel_miptree_release(&intelImage->mt);
    }
    else {
       assert(intelImage->base.Base.Data != NULL);
@@ -92,9 +92,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
    /* Fallback case:
     */
    if (firstImage->base.Base.Border) {
-      if (intelObj->mt) {
-         intel_miptree_release(intel, &intelObj->mt);
-      }
+      intel_miptree_release(&intelObj->mt);
       return GL_FALSE;
    }
 
@@ -114,7 +112,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
 	intelObj->mt->width0 != firstImage->base.Base.Width ||
 	intelObj->mt->height0 != firstImage->base.Base.Height ||
 	intelObj->mt->depth0 != firstImage->base.Base.Depth)) {
-      intel_miptree_release(intel, &intelObj->mt);
+      intel_miptree_release(&intelObj->mt);
    }
 
 
-- 
1.7.5.4



More information about the mesa-dev mailing list