diff options
author | Francisco Jerez <[email protected]> | 2018-07-09 16:12:59 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2018-07-09 23:46:57 -0700 |
commit | 8fa4bc4676fbd97b79799bef462078114b81e57a (patch) | |
tree | 138a0fad7cf7dde86ff633353a8cba82d7954dc0 /src/intel/compiler/brw_eu.h | |
parent | 2bac890bf5896a7ddc27a901b8014e28bc77d84c (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/intel/compiler/brw_eu.h')
-rw-r--r-- | src/intel/compiler/brw_eu.h | 41 |
1 files changed, 29 insertions, 12 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, |