[Mesa-dev] [PATCH 02/10] i915: Make the set_draw_region hook static and not vtabled.

Eric Anholt eric at anholt.net
Mon Jan 28 21:00:30 PST 2013


It's now always called from the same file.
---
 src/mesa/drivers/dri/i915/i830_vtbl.c      |   17 +++++++----------
 src/mesa/drivers/dri/i915/i915_vtbl.c      |   17 +++++++----------
 src/mesa/drivers/dri/intel/intel_context.h |    4 ----
 3 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index c75a786..1d02c2c 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -608,9 +608,8 @@ i830_render_target_supported(struct intel_context *intel,
 
 static void
 i830_set_draw_region(struct intel_context *intel,
-                     struct intel_region *color_regions[],
-                     struct intel_region *depth_region,
-		     GLuint num_regions)
+                     struct intel_region *color_region,
+                     struct intel_region *depth_region)
 {
    struct i830_context *i830 = i830_context(&intel->ctx);
    struct gl_context *ctx = &intel->ctx;
@@ -624,9 +623,9 @@ i830_set_draw_region(struct intel_context *intel,
 
    drm_intel_bo_unreference(state->color_bo);
    state->color_bo = NULL;
-   if (color_regions[0]) {
-      state->color_bo = color_regions[0]->bo;
-      drm_intel_bo_unreference(color_regions[0]->bo);
+   if (color_region) {
+      state->color_bo = color_region->bo;
+      drm_intel_bo_unreference(color_region->bo);
    }
    drm_intel_bo_unreference(state->depth_bo);
    state->depth_bo = NULL;
@@ -639,7 +638,7 @@ i830_set_draw_region(struct intel_context *intel,
     * Set stride/cpp values
     */
    i915_set_buf_info_for_region(&state->Buffer[I830_DESTREG_CBUFADDR0],
-				color_regions[0], BUF_3D_ID_COLOR_BACK);
+				color_region, BUF_3D_ID_COLOR_BACK);
 
    i915_set_buf_info_for_region(&state->Buffer[I830_DESTREG_DBUFADDR0],
 				depth_region, BUF_3D_ID_DEPTH);
@@ -836,8 +835,7 @@ i830_update_draw_buffer(struct intel_context *intel)
    ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
 		      (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0));
 
-   intel->vtbl.set_draw_region(intel, colorRegions, depthRegion,
-                               fb->_NumColorDrawBuffers);
+   i830_set_draw_region(intel, colorRegions[0], depthRegion);
    intel->NewGLState |= _NEW_BUFFERS;
 
    /* update viewport since it depends on window size */
@@ -900,7 +898,6 @@ i830InitVtbl(struct i830_context *i830)
    i830->intel.vtbl.emit_state = i830_emit_state;
    i830->intel.vtbl.new_batch = i830_new_batch;
    i830->intel.vtbl.reduced_primitive_state = i830_reduced_primitive_state;
-   i830->intel.vtbl.set_draw_region = i830_set_draw_region;
    i830->intel.vtbl.update_draw_buffer = i830_update_draw_buffer;
    i830->intel.vtbl.update_texture_state = i830UpdateTextureState;
    i830->intel.vtbl.render_start = i830_render_start;
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index 1c4ed14..7b78699 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -571,9 +571,8 @@ i915_render_target_supported(struct intel_context *intel,
 
 static void
 i915_set_draw_region(struct intel_context *intel,
-                     struct intel_region *color_regions[],
-                     struct intel_region *depth_region,
-		     GLuint num_regions)
+                     struct intel_region *color_region,
+                     struct intel_region *depth_region)
 {
    struct i915_context *i915 = i915_context(&intel->ctx);
    struct gl_context *ctx = &intel->ctx;
@@ -587,9 +586,9 @@ i915_set_draw_region(struct intel_context *intel,
 
    drm_intel_bo_unreference(state->color_bo);
    state->color_bo = NULL;
-   if (color_regions[0]) {
-      state->color_bo = color_regions[0]->bo;
-      drm_intel_bo_unreference(color_regions[0]->bo);
+   if (color_region) {
+      state->color_bo = color_region->bo;
+      drm_intel_bo_unreference(color_region->bo);
    }
    drm_intel_bo_unreference(state->depth_bo);
    state->depth_bo = NULL;
@@ -602,7 +601,7 @@ i915_set_draw_region(struct intel_context *intel,
     * Set stride/cpp values
     */
    i915_set_buf_info_for_region(&state->Buffer[I915_DESTREG_CBUFADDR0],
-				color_regions[0], BUF_3D_ID_COLOR_BACK);
+				color_region, BUF_3D_ID_COLOR_BACK);
 
    i915_set_buf_info_for_region(&state->Buffer[I915_DESTREG_DBUFADDR0],
 				depth_region, BUF_3D_ID_DEPTH);
@@ -806,8 +805,7 @@ i915_update_draw_buffer(struct intel_context *intel)
 
    i915_update_color_write_enable(i915, colorRegion != NULL);
 
-   intel->vtbl.set_draw_region(intel, &colorRegion, depthRegion,
-                               fb->_NumColorDrawBuffers);
+   i915_set_draw_region(intel, colorRegion, depthRegion);
    intel->NewGLState |= _NEW_BUFFERS;
 
    /* update viewport since it depends on window size */
@@ -879,7 +877,6 @@ i915InitVtbl(struct i915_context *i915)
    i915->intel.vtbl.reduced_primitive_state = i915_reduced_primitive_state;
    i915->intel.vtbl.render_start = i915_render_start;
    i915->intel.vtbl.render_prevalidate = i915_render_prevalidate;
-   i915->intel.vtbl.set_draw_region = i915_set_draw_region;
    i915->intel.vtbl.update_draw_buffer = i915_update_draw_buffer;
    i915->intel.vtbl.update_texture_state = i915UpdateTextureState;
    i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty;
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index af49ab1..2643a0c 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -161,10 +161,6 @@ struct intel_context
 
       void (*render_start) (struct intel_context * intel);
       void (*render_prevalidate) (struct intel_context * intel);
-      void (*set_draw_region) (struct intel_context * intel,
-                               struct intel_region * draw_regions[],
-                               struct intel_region * depth_region,
-			       GLuint num_regions);
       void (*update_draw_buffer)(struct intel_context *intel);
 
       void (*reduced_primitive_state) (struct intel_context * intel,
-- 
1.7.10.4



More information about the mesa-dev mailing list