aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2018-07-09 16:12:59 -0700
committerFrancisco Jerez <[email protected]>2018-07-09 23:46:57 -0700
commit8fa4bc4676fbd97b79799bef462078114b81e57a (patch)
tree138a0fad7cf7dde86ff633353a8cba82d7954dc0 /src
parent2bac890bf5896a7ddc27a901b8014e28bc77d84c (diff)
intel/eu: Use descriptor constructors for dataport write messages.
v2: Use SET_BITS macro instead of left shift (Ken). Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_eu.h41
-rw-r--r--src/intel/compiler/brw_eu_emit.c100
-rw-r--r--src/intel/compiler/brw_vec4_generator.cpp22
3 files changed, 65 insertions, 98 deletions
diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index edb024f5d75..e963d95a478 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -245,18 +245,6 @@ ROUND(RNDE)
/* Helpers for SEND instruction:
*/
-void brw_set_dp_write_message(struct brw_codegen *p,
- brw_inst *insn,
- unsigned binding_table_index,
- unsigned msg_control,
- unsigned msg_type,
- unsigned target_cache,
- unsigned msg_length,
- bool header_present,
- unsigned last_render_target,
- unsigned response_length,
- unsigned end_of_thread,
- unsigned send_commit_msg);
/**
* Construct a message descriptor immediate with the specified common
@@ -333,6 +321,35 @@ brw_dp_read_desc(const struct gen_device_info *devinfo,
SET_BITS(target_cache, 15, 14));
}
+/**
+ * Construct a message descriptor immediate with the specified dataport write
+ * function controls.
+ */
+static inline uint32_t
+brw_dp_write_desc(const struct gen_device_info *devinfo,
+ unsigned binding_table_index,
+ unsigned msg_control,
+ unsigned msg_type,
+ unsigned last_render_target,
+ unsigned send_commit_msg)
+{
+ const unsigned desc = SET_BITS(binding_table_index, 7, 0);
+ if (devinfo->gen >= 7)
+ return (desc | SET_BITS(msg_control, 13, 8) |
+ SET_BITS(last_render_target, 12, 12) |
+ SET_BITS(msg_type, 17, 14));
+ else if (devinfo->gen >= 6)
+ return (desc | SET_BITS(msg_control, 12, 8) |
+ SET_BITS(last_render_target, 12, 12) |
+ SET_BITS(msg_type, 16, 13) |
+ SET_BITS(send_commit_msg, 17, 17));
+ else
+ return (desc | SET_BITS(msg_control, 11, 8) |
+ SET_BITS(last_render_target, 11, 11) |
+ SET_BITS(msg_type, 14, 12) |
+ SET_BITS(send_commit_msg, 15, 15));
+}
+
void brw_urb_WRITE(struct brw_codegen *p,
struct brw_reg dest,
unsigned msg_reg_nr,
diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c
index ce5e29f706a..97202c7e39b 100644
--- a/src/intel/compiler/brw_eu_emit.c
+++ b/src/intel/compiler/brw_eu_emit.c
@@ -489,41 +489,6 @@ static void brw_set_urb_message( struct brw_codegen *p,
}
}
-void
-brw_set_dp_write_message(struct brw_codegen *p,
- brw_inst *insn,
- unsigned binding_table_index,
- unsigned msg_control,
- unsigned msg_type,
- unsigned target_cache,
- unsigned msg_length,
- bool header_present,
- unsigned last_render_target,
- unsigned response_length,
- unsigned end_of_thread,
- unsigned send_commit_msg)
-{
- const struct gen_device_info *devinfo = p->devinfo;
- const unsigned sfid = (devinfo->gen >= 6 ? target_cache :
- BRW_SFID_DATAPORT_WRITE);
-
- brw_set_desc(p, insn, brw_message_desc(
- devinfo, msg_length, response_length, header_present));
-
- brw_inst_set_sfid(devinfo, insn, sfid);
- brw_inst_set_eot(devinfo, insn, !!end_of_thread);
- brw_inst_set_binding_table_index(devinfo, insn, binding_table_index);
- brw_inst_set_dp_write_msg_type(devinfo, insn, msg_type);
- brw_inst_set_dp_write_msg_control(devinfo, insn, msg_control);
- brw_inst_set_rt_last(devinfo, insn, last_render_target);
- if (devinfo->gen < 7) {
- brw_inst_set_dp_write_commit(devinfo, insn, send_commit_msg);
- }
-
- if (devinfo->gen >= 11)
- brw_inst_set_null_rt(devinfo, insn, false);
-}
-
static void
gen7_set_dp_scratch_message(struct brw_codegen *p,
brw_inst *inst,
@@ -1943,7 +1908,7 @@ void brw_oword_block_write_scratch(struct brw_codegen *p,
const unsigned target_cache =
(devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
- BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
+ BRW_SFID_DATAPORT_WRITE);
uint32_t msg_type;
if (devinfo->gen >= 6)
@@ -1984,6 +1949,7 @@ void brw_oword_block_write_scratch(struct brw_codegen *p,
struct brw_reg src_header = retype(brw_vec8_grf(0, 0),
BRW_REGISTER_TYPE_UW);
+ brw_inst_set_sfid(devinfo, insn, target_cache);
brw_inst_set_compression(devinfo, insn, false);
if (brw_inst_exec_size(devinfo, insn) >= 16)
@@ -2023,18 +1989,12 @@ void brw_oword_block_write_scratch(struct brw_codegen *p,
else
msg_type = BRW_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE;
- brw_set_dp_write_message(p,
- insn,
- brw_scratch_surface_idx(p),
- BRW_DATAPORT_OWORD_BLOCK_DWORDS(num_regs * 8),
- msg_type,
- target_cache,
- mlen,
- true, /* header_present */
- 0, /* not a render target */
- send_commit_msg, /* response_length */
- 0, /* eot */
- send_commit_msg);
+ brw_set_desc(p, insn,
+ brw_message_desc(devinfo, mlen, send_commit_msg, true) |
+ brw_dp_write_desc(devinfo, brw_scratch_surface_idx(p),
+ BRW_DATAPORT_OWORD_BLOCK_DWORDS(num_regs * 8),
+ msg_type, 0, /* not a render target */
+ send_commit_msg));
}
}
@@ -2232,7 +2192,7 @@ brw_fb_WRITE(struct brw_codegen *p,
const struct gen_device_info *devinfo = p->devinfo;
const unsigned target_cache =
(devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
- BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
+ BRW_SFID_DATAPORT_WRITE);
brw_inst *insn;
unsigned msg_type;
struct brw_reg dest, src0;
@@ -2247,6 +2207,7 @@ brw_fb_WRITE(struct brw_codegen *p,
} else {
insn = next_insn(p, BRW_OPCODE_SEND);
}
+ brw_inst_set_sfid(devinfo, insn, target_cache);
brw_inst_set_compression(devinfo, insn, false);
if (devinfo->gen >= 6) {
@@ -2264,18 +2225,13 @@ brw_fb_WRITE(struct brw_codegen *p,
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src0);
- brw_set_dp_write_message(p,
- insn,
- binding_table_index,
- msg_control,
- msg_type,
- target_cache,
- msg_length,
- header_present,
- last_render_target,
- response_length,
- eot,
- 0 /* send_commit_msg */);
+ brw_set_desc(p, insn,
+ brw_message_desc(devinfo, msg_length, response_length,
+ header_present) |
+ brw_dp_write_desc(devinfo, binding_table_index, msg_control,
+ msg_type, last_render_target,
+ 0 /* send_commit_msg */));
+ brw_inst_set_eot(devinfo, insn, eot);
return insn;
}
@@ -2770,26 +2726,22 @@ brw_svb_write(struct brw_codegen *p,
const unsigned target_cache =
(devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
- BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
+ BRW_SFID_DATAPORT_WRITE);
brw_inst *insn;
gen6_resolve_implied_move(p, &src0, msg_reg_nr);
insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst_set_sfid(devinfo, insn, target_cache);
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src0);
- brw_set_src1(p, insn, brw_imm_d(0));
- brw_set_dp_write_message(p, insn,
- binding_table_index,
- 0, /* msg_control: ignored */
- GEN6_DATAPORT_WRITE_MESSAGE_STREAMED_VB_WRITE,
- target_cache,
- 1, /* msg_length */
- true, /* header_present */
- 0, /* last_render_target: ignored */
- send_commit_msg, /* response_length */
- 0, /* end_of_thread */
- send_commit_msg); /* send_commit_msg */
+ brw_set_desc(p, insn,
+ brw_message_desc(devinfo, 1, send_commit_msg, true) |
+ brw_dp_write_desc(devinfo, binding_table_index,
+ 0, /* msg_control: ignored */
+ GEN6_DATAPORT_WRITE_MESSAGE_STREAMED_VB_WRITE,
+ 0, /* last_render_target: ignored */
+ send_commit_msg)); /* send_commit_msg */
}
static unsigned
diff --git a/src/intel/compiler/brw_vec4_generator.cpp b/src/intel/compiler/brw_vec4_generator.cpp
index 013b9d48dc1..d506b675776 100644
--- a/src/intel/compiler/brw_vec4_generator.cpp
+++ b/src/intel/compiler/brw_vec4_generator.cpp
@@ -1185,7 +1185,7 @@ generate_scratch_write(struct brw_codegen *p,
const unsigned target_cache =
(devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
- BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
+ BRW_SFID_DATAPORT_WRITE);
struct brw_reg header = brw_vec8_grf(0, 0);
bool write_commit;
@@ -1237,21 +1237,19 @@ generate_scratch_write(struct brw_codegen *p,
* dword is written.
*/
brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst_set_sfid(p->devinfo, send, target_cache);
brw_set_dest(p, send, dst);
brw_set_src0(p, send, header);
if (devinfo->gen < 6)
brw_inst_set_cond_modifier(p->devinfo, send, inst->base_mrf);
- brw_set_dp_write_message(p, send,
- brw_scratch_surface_idx(p),
- BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD,
- msg_type,
- target_cache,
- 3, /* mlen */
- true, /* header present */
- false, /* not a render target write */
- write_commit, /* rlen */
- false, /* eot */
- write_commit);
+ brw_set_desc(p, send,
+ brw_message_desc(devinfo, 3, write_commit, true) |
+ brw_dp_write_desc(devinfo,
+ brw_scratch_surface_idx(p),
+ BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD,
+ msg_type,
+ false, /* not a render target write */
+ write_commit));
}
static void