i965: Stop using the kernel SOL reset feature.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 17 May 2013 17:55:35 +0000 (10:55 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 21 May 2013 20:29:22 +0000 (13:29 -0700)
We can just do it ourselves with MI_LOAD_REGISTER_IMM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/gen6_sol.c
src/mesa/drivers/dri/intel/intel_batchbuffer.c
src/mesa/drivers/dri/intel/intel_context.h

index 3cbf28e7dc4c50a293647de31f0a0c0c603cc26d..bb2dd12393034ab6febc0dd8a8afed58eae1a854 100644 (file)
@@ -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();
+      }
    }
 }
 
index 8c6524e71af72205411a6d65487bacbbd52eb80c..c7f6d56e5592423f8ca190e25ff9242a7b1f827a 100644 (file)
@@ -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);
index c0f07ff1f3c87e559f48f749389e4975e6961363..8c50e6e612117ca777c7fcc08bc27ef5e7056554 100644 (file)
@@ -135,7 +135,6 @@ struct intel_batchbuffer {
 
    uint32_t state_batch_offset;
    bool is_blit;
-   bool needs_sol_reset;
 
    struct {
       uint16_t used;