[Mesa-dev] [PATCH 20/70] i965: Replace opencoded brw_load_register_mem()

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 7 13:13:24 PDT 2015


gen7_sol_state loads the SOL_OFFSET registers from its scratch buffer
by hand, switch it over to the common routine for emitting that command.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/mesa/drivers/dri/i965/gen7_sol_state.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index 396d029..c863dfc 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -31,6 +31,7 @@
 #include "brw_context.h"
 #include "brw_state.h"
 #include "brw_defines.h"
+#include "brw_pipelined_register.h"
 #include "intel_buffer_objects.h"
 #include "intel_reg.h"
 #include "main/transformfeedback.h"
@@ -547,13 +548,12 @@ gen7_resume_transform_feedback(struct gl_context *ctx,
    /* Reload the SOL buffer offset registers. */
    if (brw->gen < 8) {
       for (int i = 0; i < 4; i++) {
-         BEGIN_BATCH(3);
-         OUT_BATCH(GEN7_MI_LOAD_REGISTER_MEM | (3 - 2));
-         OUT_BATCH(GEN7_SO_WRITE_OFFSET(i));
-         OUT_RELOC(brw_obj->offset_bo,
-                   I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
-                   i * sizeof(uint32_t));
-         ADVANCE_BATCH();
+         brw_load_register_mem(brw,
+                               GEN7_SO_WRITE_OFFSET(i),
+                               brw_obj->offset_bo,
+                               I915_GEM_DOMAIN_INSTRUCTION,
+                               I915_GEM_DOMAIN_INSTRUCTION,
+                               i * sizeof(uint32_t));
       }
    }
 
-- 
2.5.0



More information about the mesa-dev mailing list