pan/bi: Fix overzealous write barriers
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 26 Mar 2020 14:06:49 +0000 (10:06 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 01:12:26 +0000 (01:12 +0000)
It's possible this triggers an INSTR_INVALID_ENC.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>

src/panfrost/bifrost/bi_schedule.c

index 4adab3b..589c848 100644 (file)
@@ -110,7 +110,10 @@ bi_schedule(bi_context *ctx)
                         ids = ids & 1;
                         last_id = u->scoreboard_id;
                         u->back_to_back = true;
-                        u->data_register_write_barrier = true;
+
+                        /* Rule: first instructions cannot have write barriers */
+                        if (!is_first)
+                                u->data_register_write_barrier = true;
 
                         u->constant_count = 1;
                         u->constants[0] = ins->constant.u64;