Mesa (main): pan/mdg: Add a bundle ID to instructions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 17 20:04:49 UTC 2021


Module: Mesa
Branch: main
Commit: 1490e7e622d1b3ffe35ad9f577f13744497c0169
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1490e7e622d1b3ffe35ad9f577f13744497c0169

Author: Icecream95 <ixn at disroot.org>
Date:   Mon Jun  7 19:21:41 2021 +1200

pan/mdg: Add a bundle ID to instructions

So that it is possible to check if two instructions were scheduled
into the same bundle.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11212>

---

 src/panfrost/midgard/compiler.h         | 2 ++
 src/panfrost/midgard/midgard_schedule.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 310032823c3..7f3ea63cc52 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -183,6 +183,8 @@ typedef struct midgard_instruction {
 
                 midgard_branch branch;
         };
+
+        unsigned bundle_id;
 } midgard_instruction;
 
 typedef struct midgard_block {
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index e3d49aaf64c..f987b7f17fd 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -1464,6 +1464,10 @@ schedule_block(compiler_context *ctx, midgard_block *block)
                 else
                         break;
 
+                for (unsigned i = 0; i < bundle.instruction_count; ++i)
+                        bundle.instructions[i]->bundle_id =
+                                ctx->quadword_count + block->quadword_count;
+
                 util_dynarray_append(&bundles, midgard_bundle, bundle);
                 block->quadword_count += midgard_tag_props[bundle.tag].size;
         }



More information about the mesa-commit mailing list