Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
void brw_WAIT(struct brw_codegen *p);
+void brw_SYNC(struct brw_codegen *p, enum tgl_sync_function func);
+
/* Special case: there is never a destination, execution size will be
* taken from src0:
*/
BRW_WIDTH_16 = 4,
};
+enum tgl_sync_function {
+ TGL_SYNC_NOP = 0x0,
+ TGL_SYNC_ALLRD = 0x2,
+ TGL_SYNC_ALLWR = 0x3,
+ TGL_SYNC_BAR = 0xe,
+ TGL_SYNC_HOST = 0xf
+};
+
/**
* Message target: Shared Function ID for where to SEND a message.
*
brw_inst_set_opcode(p->devinfo, insn, BRW_OPCODE_NOP);
}
-
-
-
+void brw_SYNC(struct brw_codegen *p, enum tgl_sync_function func)
+{
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SYNC);
+ brw_inst_set_cond_modifier(p->devinfo, insn, func);
+}
/***********************************************************************
* Comparisons, if/else/endif
assert(inst->mlen <= BRW_MAX_MSG_LENGTH);
switch (inst->opcode) {
+ case BRW_OPCODE_SYNC:
+ assert(src[0].file == BRW_IMMEDIATE_VALUE);
+ brw_SYNC(p, tgl_sync_function(src[0].ud));
+ break;
case BRW_OPCODE_MOV:
brw_MOV(p, dst, src[0]);
break;