[Mesa-dev] [PATCH 3/7] i965: Stop using the kernel SOL reset feature.

Kenneth Graunke kenneth at whitecape.org
Mon May 20 15:54:33 PDT 2013


We can just do it ourselves with MI_LOAD_REGISTER_IMM.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Eric Anholt <eric at anholt.net>
Cc: Paul Berry <stereotype441 at gmail.com>
---
 src/mesa/drivers/dri/i965/gen6_sol.c           | 13 ++++++++-----
 src/mesa/drivers/dri/intel/intel_batchbuffer.c |  4 ----
 src/mesa/drivers/dri/intel/intel_context.h     |  1 -
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c
index 3cbf28e..bb2dd12 100644
--- a/src/mesa/drivers/dri/i965/gen6_sol.c
+++ b/src/mesa/drivers/dri/i965/gen6_sol.c
@@ -184,11 +184,14 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
    brw->sol.offset_0_batch_start = 0;
 
    if (intel->gen >= 7) {
-      /* Ask the kernel to reset the SO offsets for any previous transform
-       * feedback, so we start at the start of the user's buffer. (note: these
-       * are not the query counters)
-       */
-      intel->batch.needs_sol_reset = true;
+      /* Reset the SOL buffer offset register. */
+      for (int i = 0; i < 4; i++) {
+         BEGIN_BATCH(3);
+         OUT_BATCH(MI_LOAD_REGISTER_IMM | (3 - 2));
+         OUT_BATCH(GEN7_SO_WRITE_OFFSET(i));
+         OUT_BATCH(0);
+         ADVANCE_BATCH();
+      }
    }
 }
 
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index 8c6524e..c7f6d56 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -96,7 +96,6 @@ intel_batchbuffer_reset(struct intel_context *intel)
    intel->batch.reserved_space = BATCH_RESERVED;
    intel->batch.state_batch_offset = intel->batch.bo->size;
    intel->batch.used = 0;
-   intel->batch.needs_sol_reset = false;
 }
 
 void
@@ -199,9 +198,6 @@ do_flush_locked(struct intel_context *intel)
 	 flags = I915_EXEC_BLT;
       }
 
-      if (batch->needs_sol_reset)
-	 flags |= I915_EXEC_GEN7_SOL_RESET;
-
       if (ret == 0) {
          if (unlikely(INTEL_DEBUG & DEBUG_AUB) && intel->vtbl.annotate_aub)
             intel->vtbl.annotate_aub(intel);
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index c0f07ff..8c50e6e 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -135,7 +135,6 @@ struct intel_batchbuffer {
 
    uint32_t state_batch_offset;
    bool is_blit;
-   bool needs_sol_reset;
 
    struct {
       uint16_t used;
-- 
1.8.2.3



More information about the mesa-dev mailing list