[Mesa-dev] [PATCH 44/70] i965: Unconditionally reset the HW binding table offsets after a batch
Chris Wilson
chris at chris-wilson.co.uk
Fri Aug 7 13:13:48 PDT 2015
Rather than spend an instruction deciding whether we need to, just zero
out the single integer to reset the HW binding tables.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
src/mesa/drivers/dri/i965/brw_binding_tables.c | 6 ------
src/mesa/drivers/dri/i965/brw_context.c | 3 +--
src/mesa/drivers/dri/i965/brw_state.h | 6 +++++-
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c
index a1afdc2..cb9c489 100644
--- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
+++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
@@ -363,12 +363,6 @@ gen7_enable_hw_binding_tables(struct brw_context *brw)
ADVANCE_BATCH();
}
-void
-gen7_reset_hw_bt_pool_offsets(struct brw_context *brw)
-{
- brw->hw_bt_pool.next_offset = 0;
-}
-
const struct brw_tracked_state gen7_hw_binding_tables = {
.dirty = {
.mesa = 0,
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 95e545c..dbbcc21 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1574,8 +1574,7 @@ void brw_batch_finish_hook(brw_batch *batch)
brw->ib.type = -1;
- if (brw->use_resource_streamer)
- gen7_reset_hw_bt_pool_offsets(brw);
+ gen7_reset_hw_bt_pool_offsets(brw);
/* If the kernel supports hardware contexts, then most hardware state is
* preserved between batches; we only need to re-emit state that is required
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index cf3a96c..943e8c8 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -375,7 +375,11 @@ void gen7_update_binding_table_from_array(struct brw_context *brw,
int num_surfaces);
void gen7_enable_hw_binding_tables(struct brw_context *brw);
void gen7_disable_hw_binding_tables(struct brw_context *brw);
-void gen7_reset_hw_bt_pool_offsets(struct brw_context *brw);
+static inline void gen7_reset_hw_bt_pool_offsets(struct brw_context *brw)
+{
+ brw->hw_bt_pool.next_offset = 0;
+}
+
#ifdef __cplusplus
}
--
2.5.0
More information about the mesa-dev
mailing list