diff options
author | Francisco Jerez <[email protected]> | 2018-06-07 10:50:20 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2018-07-09 23:46:57 -0700 |
commit | 2bac890bf5896a7ddc27a901b8014e28bc77d84c (patch) | |
tree | f7bb2b3113e0e33f90eb04b621f025aa45fbf9a9 /src/intel/compiler/brw_eu.h | |
parent | 27c211e30f92a0bf85bd03aab8f5e5de7d094a22 (diff) |
intel/eu: Use descriptor constructors for dataport read 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 | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h index 08284766725..edb024f5d75 100644 --- a/src/intel/compiler/brw_eu.h +++ b/src/intel/compiler/brw_eu.h @@ -245,16 +245,6 @@ ROUND(RNDE) /* Helpers for SEND instruction: */ -void brw_set_dp_read_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 response_length); - void brw_set_dp_write_message(struct brw_codegen *p, brw_inst *insn, unsigned binding_table_index, @@ -315,6 +305,34 @@ brw_sampler_desc(const struct gen_device_info *devinfo, SET_BITS(msg_type, 15, 14)); } +/** + * Construct a message descriptor immediate with the specified dataport read + * function controls. + */ +static inline uint32_t +brw_dp_read_desc(const struct gen_device_info *devinfo, + unsigned binding_table_index, + unsigned msg_control, + unsigned msg_type, + unsigned target_cache) +{ + const unsigned desc = SET_BITS(binding_table_index, 7, 0); + if (devinfo->gen >= 7) + return (desc | SET_BITS(msg_control, 13, 8) | + SET_BITS(msg_type, 17, 14)); + else if (devinfo->gen >= 6) + return (desc | SET_BITS(msg_control, 12, 8) | + SET_BITS(msg_type, 16, 13)); + else if (devinfo->gen >= 5 || devinfo->is_g4x) + return (desc | SET_BITS(msg_control, 10, 8) | + SET_BITS(msg_type, 13, 11) | + SET_BITS(target_cache, 15, 14)); + else + return (desc | SET_BITS(msg_control, 11, 8) | + SET_BITS(msg_type, 13, 12) | + SET_BITS(target_cache, 15, 14)); +} + void brw_urb_WRITE(struct brw_codegen *p, struct brw_reg dest, unsigned msg_reg_nr, |