aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen8_instruction.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-01-27 15:44:18 -0800
committerKenneth Graunke <[email protected]>2014-02-20 15:50:08 -0800
commit29a69744034c37ebe1ba088fbc8bbd39b7a17875 (patch)
treefa5b05781b11dc9407ae0020ab6f437ad319a7f9 /src/mesa/drivers/dri/i965/gen8_instruction.c
parenta5e54c91a3b73551609efea1f6f31eaae26281ea (diff)
i965: Add Gen8 assembly support for DP Scratch messages.
The new accessors will make it easy to do Gen7-style scratch messages. v2: Move num_regs assertion from gen8_fs_generator into gen8_set_dp_scratch_message() (suggested by Eric). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen8_instruction.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen8_instruction.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen8_instruction.c b/src/mesa/drivers/dri/i965/gen8_instruction.c
index 476b3a91130..c9cbab639fe 100644
--- a/src/mesa/drivers/dri/i965/gen8_instruction.c
+++ b/src/mesa/drivers/dri/i965/gen8_instruction.c
@@ -431,3 +431,27 @@ gen8_set_dp_message(const struct brw_context *brw,
gen8_set_dp_message_type(inst, msg_type);
gen8_set_dp_message_control(inst, msg_control);
}
+
+void
+gen8_set_dp_scratch_message(const struct brw_context *brw,
+ struct gen8_instruction *inst,
+ bool write,
+ bool dword,
+ bool invalidate_after_read,
+ unsigned num_regs,
+ unsigned addr_offset,
+ unsigned mlen,
+ unsigned rlen,
+ bool header_present,
+ bool end_of_thread)
+{
+ assert(num_regs == 1 || num_regs == 2 || num_regs == 4 || num_regs == 8);
+ gen8_set_message_descriptor(brw, inst, GEN7_SFID_DATAPORT_DATA_CACHE,
+ mlen, rlen, header_present, end_of_thread);
+ gen8_set_dp_category(inst, 1); /* Scratch Block Read/Write messages */
+ gen8_set_scratch_read_write(inst, write);
+ gen8_set_scratch_type(inst, dword);
+ gen8_set_scratch_invalidate_after_read(inst, invalidate_after_read);
+ gen8_set_scratch_block_size(inst, ffs(num_regs) - 1);
+ gen8_set_scratch_addr_offset(inst, addr_offset);
+}