[Mesa-dev] [PATCH 16/51] i965: Replace opencoded brw_load_register_mem()

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 10 21:23:39 UTC 2017


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 | 13 ++++++-------
 1 file changed, 6 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 595b1c703d..e1b63abeaf 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -595,13 +595,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.11.0



More information about the mesa-dev mailing list