#define BRW_DATAPORT_OWORD_BLOCK_2_OWORDS 2
#define BRW_DATAPORT_OWORD_BLOCK_4_OWORDS 3
#define BRW_DATAPORT_OWORD_BLOCK_8_OWORDS 4
+#define BRW_DATAPORT_OWORD_BLOCK_DWORDS(n) \
+ ((n) == 4 ? BRW_DATAPORT_OWORD_BLOCK_1_OWORDLOW : \
+ (n) == 8 ? BRW_DATAPORT_OWORD_BLOCK_2_OWORDS : \
+ (n) == 16 ? BRW_DATAPORT_OWORD_BLOCK_4_OWORDS : \
+ (n) == 32 ? BRW_DATAPORT_OWORD_BLOCK_8_OWORDS : \
+ (abort(), ~0))
#define BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD 0
#define BRW_DATAPORT_OWORD_DUAL_BLOCK_4OWORDS 2
mrf = retype(mrf, BRW_REGISTER_TYPE_UD);
const unsigned mlen = 1 + num_regs;
- const unsigned msg_control =
- (num_regs == 1 ? BRW_DATAPORT_OWORD_BLOCK_2_OWORDS :
- num_regs == 2 ? BRW_DATAPORT_OWORD_BLOCK_4_OWORDS :
- num_regs == 4 ? BRW_DATAPORT_OWORD_BLOCK_8_OWORDS : 0);
- assert(msg_control);
/* Set up the message header. This is g0, with g0.2 filled with
* the offset. We don't want to leave our offset around in g0 or
brw_set_dp_write_message(p,
insn,
brw_scratch_surface_idx(p),
- msg_control,
+ BRW_DATAPORT_OWORD_BLOCK_DWORDS(num_regs * 8),
msg_type,
target_cache,
mlen,
dest = retype(dest, BRW_REGISTER_TYPE_UW);
const unsigned rlen = num_regs;
- const unsigned msg_control =
- (num_regs == 1 ? BRW_DATAPORT_OWORD_BLOCK_2_OWORDS :
- num_regs == 2 ? BRW_DATAPORT_OWORD_BLOCK_4_OWORDS :
- num_regs == 4 ? BRW_DATAPORT_OWORD_BLOCK_8_OWORDS : 0);
- assert(msg_control);
const unsigned target_cache =
(devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
brw_set_dp_read_message(p,
insn,
brw_scratch_surface_idx(p),
- msg_control,
+ BRW_DATAPORT_OWORD_BLOCK_DWORDS(num_regs * 8),
BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ, /* msg_type */
target_cache,
1, /* msg_length */