pan/va: Unit test barrier handling
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 20 Jun 2022 20:49:27 +0000 (16:49 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Jun 2022 22:19:59 +0000 (22:19 +0000)
Add a unit test for the quirk discovered in the previos commit, because this
will cause flakes (instead of fails) if we get it wrong. Better have a
deterministic fail mode.

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

src/panfrost/bifrost/valhall/test/test-insert-flow.cpp

index 57b547d..410fe4e 100644 (file)
@@ -248,3 +248,16 @@ TEST_F(InsertFlow, DiamondCFG) {
          flow(END);
    });
 }
+
+TEST_F(InsertFlow, BarrierBug) {
+   CASE(KERNEL, {
+         bi_instr *I = bi_store_i32(b, bi_register(0), bi_register(2), bi_register(4), BI_SEG_NONE, 0);
+         I->slot = 2;
+
+         bi_fadd_f32_to(b, bi_register(10), bi_register(10), bi_register(10));
+         flow(WAIT2);
+         bi_barrier(b);
+         flow(WAIT);
+         flow(END);
+   });
+}