[Mesa-dev] [PATCH 4/9] i965: Add a header_present flag for setting up dp read messages.

Eric Anholt eric at anholt.net
Mon Nov 12 10:53:09 PST 2012


As of gen7, we can skip the header on some messages, and this can make
optimization on those messages much nicer when you've got GRFs instead of MRFs
as the source.
---
 src/mesa/drivers/dri/i965/brw_eu.h          |    1 +
 src/mesa/drivers/dri/i965/brw_eu_emit.c     |    5 ++++-
 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp |    2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index fce4f15..8c3a634 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -907,6 +907,7 @@ void brw_set_dp_read_message(struct brw_compile *p,
 			     GLuint msg_type,
 			     GLuint target_cache,
 			     GLuint msg_length,
+                             bool header_present,
 			     GLuint response_length);
 
 void brw_set_dp_write_message(struct brw_compile *p,
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 72fb5c5..8a629ff 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -620,6 +620,7 @@ brw_set_dp_read_message(struct brw_compile *p,
 			GLuint msg_type,
 			GLuint target_cache,
 			GLuint msg_length,
+                        bool header_present,
 			GLuint response_length)
 {
    struct brw_context *brw = p->brw;
@@ -638,7 +639,7 @@ brw_set_dp_read_message(struct brw_compile *p,
    }
 
    brw_set_message_descriptor(p, insn, sfid, msg_length, response_length,
-			      true, false);
+			      header_present, false);
 
    if (intel->gen >= 7) {
       insn->bits3.gen7_dp.binding_table_index = binding_table_index;
@@ -1967,6 +1968,7 @@ brw_oword_block_read_scratch(struct brw_compile *p,
 			      BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ, /* msg_type */
 			      BRW_DATAPORT_READ_TARGET_RENDER_CACHE,
 			      1, /* msg_length */
+                              true, /* header_present */
 			      rlen);
    }
 }
@@ -2024,6 +2026,7 @@ void brw_oword_block_read(struct brw_compile *p,
 			   BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ,
 			   BRW_DATAPORT_READ_TARGET_DATA_CACHE,
 			   1, /* msg_length */
+                           true, /* header_present */
 			   1); /* response_length (1 reg, 2 owords!) */
 
    brw_pop_insn_state(p);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index 812fa47..baffdb6 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -567,6 +567,7 @@ vec4_visitor::generate_scratch_read(vec4_instruction *inst,
 			   msg_type,
 			   BRW_DATAPORT_READ_TARGET_RENDER_CACHE,
 			   2, /* mlen */
+                           true, /* header_present */
 			   1 /* rlen */);
 }
 
@@ -700,6 +701,7 @@ vec4_visitor::generate_pull_constant_load(vec4_instruction *inst,
 			   msg_type,
 			   BRW_DATAPORT_READ_TARGET_DATA_CACHE,
 			   2, /* mlen */
+                           true, /* header_present */
 			   1 /* rlen */);
 }
 
-- 
1.7.10.4



More information about the mesa-dev mailing list