intel/fs/gen12: Fix barrier codegen.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 4 Sep 2019 00:31:37 +0000 (17:31 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 11 Oct 2019 19:24:16 +0000 (12:24 -0700)
The WAIT instruction has been removed, but SYNC.bar can be used
instead to wait for a notification on n0.0.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_fs_visitor.cpp

index ffdcc96f22ae38ecd721a8f111f24a308fb2ff52..4a398640dd02f096edf72d647da32e595c9c879b 100644 (file)
@@ -783,8 +783,12 @@ void
 fs_generator::generate_barrier(fs_inst *, struct brw_reg src)
 {
    brw_barrier(p, src);
-   brw_set_default_swsb(p, tgl_swsb_null());
-   brw_WAIT(p);
+   if (devinfo->gen >= 12) {
+      brw_set_default_swsb(p, tgl_swsb_null());
+      brw_SYNC(p, TGL_SYNC_BAR);
+   } else {
+      brw_WAIT(p);
+   }
 }
 
 bool
index d723e2818e8064661ee3471aa33580c48032b645..6ced1b9db62dba3b373f9d927447142b8c0290ce 100644 (file)
@@ -920,6 +920,7 @@ fs_visitor::emit_barrier()
    case 10:
       barrier_id_mask = 0x8f000000u; break;
    case 11:
+   case 12:
       barrier_id_mask = 0x7f000000u; break;
    default:
       unreachable("barrier is only available on gen >= 7");