pan/bi: Stub worklist routines
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 6 Jan 2021 19:23:41 +0000 (14:23 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Feb 2021 14:07:29 +0000 (14:07 +0000)
In the near future we'll schedule out-of-order via a dependendency graph
and worklist. For now, emulate in-order operation.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>

src/panfrost/bifrost/bi_schedule.c

index e970720..0668209 100644 (file)
@@ -155,6 +155,38 @@ bi_flatten_block(bi_block *block, unsigned *len)
         return instructions;
 }
 
+/* The worklist would track instructions without outstanding dependencies. For
+ * debug, force in-order scheduling (no dependency graph is constructed).
+ */
+
+static struct bi_worklist
+bi_initialize_worklist(bi_block *block)
+{
+        struct bi_worklist st = { };
+        st.instructions = bi_flatten_block(block, &st.count);
+
+        if (st.count) {
+                st.worklist = calloc(BITSET_WORDS(st.count), sizeof(BITSET_WORD));
+                BITSET_SET(st.worklist, st.count - 1);
+        }
+
+        return st;
+}
+
+static void
+bi_free_worklist(struct bi_worklist st)
+{
+        free(st.instructions);
+        free(st.worklist);
+}
+
+static void
+bi_update_worklist(struct bi_worklist st, unsigned idx)
+{
+        if (idx >= 1)
+                BITSET_SET(st.worklist, idx - 1);
+}
+
 /* Determines messsage type by checking the table and a few special cases. Only
  * case missing is tilebuffer instructions that access depth/stencil, which
  * require a Z_STENCIL message (to implement