diff options
author | Jordan Justen <[email protected]> | 2014-11-04 18:05:04 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2015-06-12 15:12:40 -0700 |
commit | 0d250cc210f971f566bbe5b1e54cf3cd114537e9 (patch) | |
tree | 2d5884558d8e09b449d4fef1345aea204f04034d /src | |
parent | b925f1a1df86120d2846bf09797bb0967040f9c6 (diff) |
i965: Add brw_WAIT to emit wait instruction
This will be used to implement the barrier function.
v2:
* Rename to brw_WAIT (mattst88)
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu_emit.c | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index 0e7be1e1ea0..0eaab2f1d1f 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -390,6 +390,8 @@ brw_inst *brw_JMPI(struct brw_codegen *p, struct brw_reg index, void brw_NOP(struct brw_codegen *p); +void brw_WAIT(struct brw_codegen *p); + /* Special case: there is never a destination, execution size will be * taken from src0: */ diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index a1d11f30433..61fc1abf897 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -3406,3 +3406,24 @@ void brw_shader_time_add(struct brw_codegen *p, brw_pop_insn_state(p); } + + +/** + * Emit the wait instruction for a barrier + */ +void +brw_WAIT(struct brw_codegen *p) +{ + const struct brw_device_info *devinfo = p->devinfo; + struct brw_inst *insn; + + struct brw_reg src = brw_notification_reg(); + + insn = next_insn(p, BRW_OPCODE_WAIT); + brw_set_dest(p, insn, src); + brw_set_src0(p, insn, src); + brw_set_src1(p, insn, brw_null_reg()); + + brw_inst_set_exec_size(devinfo, insn, BRW_EXECUTE_1); + brw_inst_set_mask_control(devinfo, insn, BRW_MASK_DISABLE); +} |