[Mesa-dev] [RFC PATCH 11/40] i965/gen7.5: Flush on-chip binding table to pool

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Sun Jan 4 06:04:25 PST 2015


Normally, the CS will will just consume the binding table pointer commands
as pipelined state. When the RS is enabled however, the RS flushes whatever
edited surface state entries of our on-chip binding table to the binding
table pool before passing the command on to the CS.

Note that the the binding table pointer offset is relative to the binding table
pool base address when resource streamer instead of the surface state base address.

In addition, 3DSTATE_BINDING_TABLE_POINTERS_* expects btp offsets of up to 64k when
resource streamer hardware binding tables are enabled. However the bt entry within
the command only allows until 32k. Therefore, ensure that offset fits within the
highest bit of the command.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/mesa/drivers/dri/i965/brw_binding_tables.c | 3 ++-
 src/mesa/drivers/dri/i965/gen7_blorp.cpp       | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c
index d97b3d9..03e7a4a 100644
--- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
+++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
@@ -106,7 +106,8 @@ brw_upload_binding_table(struct brw_context *brw,
 
       BEGIN_BATCH(2);
       OUT_BATCH(packet_name << 16 | (2 - 2));
-      OUT_BATCH(stage_state->bind_bo_offset);
+      OUT_BATCH(brw->hw_bt_pool.bo ? stage_state->bind_bo_offset >> 1
+                : stage_state->bind_bo_offset);
       ADVANCE_BATCH();
 
       if (brw->has_resource_streamer)
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index 3d5c7df..f6fb904 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -560,7 +560,9 @@ gen7_blorp_emit_binding_table_pointers_ps(struct brw_context *brw,
 {
    BEGIN_BATCH(2);
    OUT_BATCH(_3DSTATE_BINDING_TABLE_POINTERS_PS << 16 | (2 - 2));
-   OUT_BATCH(wm_bind_bo_offset);
+   /* For RS: fit maximum 64k binding table offset within high bits */
+   OUT_BATCH(brw->hw_bt_pool.bo ? wm_bind_bo_offset >> 1
+             : wm_bind_bo_offset);
    ADVANCE_BATCH();
 }
 
-- 
1.9.1



More information about the mesa-dev mailing list