[Mesa-dev] [PATCH 3/3] i915: Silence warning: unused parameter warning in intel_bufferobj_buffer

Ian Romanick idr at freedesktop.org
Fri Jan 3 16:51:25 PST 2014


From: Ian Romanick <ian.d.romanick at intel.com>

intel_buffer_objects.c: In function 'old_intel_bufferobj_buffer':
intel_buffer_objects.c:471:17: warning: unused parameter 'flag' [-Wunused-parameter]

The parameter hasn't been used since the i915 and i965 drivers had their
breakup.  i965 got the flags, and i915 got to cry itself to sleep.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/i915/intel_buffer_objects.c | 7 +++----
 src/mesa/drivers/dri/i915/intel_buffer_objects.h | 3 +--
 src/mesa/drivers/dri/i915/intel_pixel_read.c     | 8 +-------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_buffer_objects.c b/src/mesa/drivers/dri/i915/intel_buffer_objects.c
index 729e4fa..66d0473 100644
--- a/src/mesa/drivers/dri/i915/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i915/intel_buffer_objects.c
@@ -467,8 +467,7 @@ intel_bufferobj_unmap(struct gl_context * ctx, struct gl_buffer_object *obj)
 
 drm_intel_bo *
 intel_bufferobj_buffer(struct intel_context *intel,
-                       struct intel_buffer_object *intel_obj,
-		       GLuint flag)
+                       struct intel_buffer_object *intel_obj)
 {
    if (intel_obj->source)
       release_buffer(intel_obj);
@@ -627,7 +626,7 @@ intel_bufferobj_copy_subdata(struct gl_context *ctx,
 
    /* Otherwise, we have real BOs, so blit them. */
 
-   dst_bo = intel_bufferobj_buffer(intel, intel_dst, INTEL_WRITE_PART);
+   dst_bo = intel_bufferobj_buffer(intel, intel_dst);
    src_bo = intel_bufferobj_source(intel, intel_src, 64, &src_offset);
 
    intel_emit_linear_blit(intel,
@@ -671,7 +670,7 @@ intel_buffer_object_purgeable(struct gl_context * ctx,
    } else {
       /* XXX Create the buffer and madvise(MADV_DONTNEED)? */
       struct intel_context *intel = intel_context(ctx);
-      drm_intel_bo *bo = intel_bufferobj_buffer(intel, intel_obj, INTEL_READ);
+      drm_intel_bo *bo = intel_bufferobj_buffer(intel, intel_obj);
 
       return intel_buffer_purgeable(bo);
    }
diff --git a/src/mesa/drivers/dri/i915/intel_buffer_objects.h b/src/mesa/drivers/dri/i915/intel_buffer_objects.h
index 331c423..6dbccd3 100644
--- a/src/mesa/drivers/dri/i915/intel_buffer_objects.h
+++ b/src/mesa/drivers/dri/i915/intel_buffer_objects.h
@@ -58,8 +58,7 @@ struct intel_buffer_object
 /* Get the bm buffer associated with a GL bufferobject:
  */
 drm_intel_bo *intel_bufferobj_buffer(struct intel_context *intel,
-				     struct intel_buffer_object *obj,
-				     GLuint flag);
+				     struct intel_buffer_object *obj);
 drm_intel_bo *intel_bufferobj_source(struct intel_context *intel,
 				     struct intel_buffer_object *obj,
 				     GLuint align,
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_read.c b/src/mesa/drivers/dri/i915/intel_pixel_read.c
index 8fd1c8d..b6148f6 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_read.c
@@ -79,7 +79,6 @@ do_blit_readpixels(struct gl_context * ctx,
    struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
    GLuint dst_offset;
    drm_intel_bo *dst_buffer;
-   bool all;
    GLint dst_x, dst_y;
    GLuint dirty;
 
@@ -127,12 +126,7 @@ do_blit_readpixels(struct gl_context * ctx,
    intel_prepare_render(intel);
    intel->front_buffer_dirty = dirty;
 
-   all = (width * height * irb->mt->cpp == dst->Base.Size &&
-	  x == 0 && dst_offset == 0);
-
-   dst_buffer = intel_bufferobj_buffer(intel, dst,
-				       all ? INTEL_WRITE_FULL :
-				       INTEL_WRITE_PART);
+   dst_buffer = intel_bufferobj_buffer(intel, dst);
 
    struct intel_mipmap_tree *pbo_mt =
       intel_miptree_create_for_bo(intel,
-- 
1.8.1.4



More information about the mesa-dev mailing list