i965: Add brw_WAIT to emit wait instruction
authorJordan Justen <jordan.l.justen@intel.com>
Wed, 5 Nov 2014 02:05:04 +0000 (18:05 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Fri, 12 Jun 2015 22:12:40 +0000 (15:12 -0700)
This will be used to implement the barrier function.

v2:
 * Rename to brw_WAIT (mattst88)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 0e7be1e1ea068d7736912ee9b054a5accf67b69b..0eaab2f1d1f644d18b1c1d73f05b9613c10adfa1 100644 (file)
@@ -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:
  */
index a1d11f3043325eda480b02106b4bcdd31d69dec2..61fc1abf897a21e7fc8c0ef8964700149f21d87e 100644 (file)
@@ -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);
+}