summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-07-19 11:02:56 -0700
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-07-22 08:20:34 -0700
commit997f85c136882569e56b433292feb09dcd4d33fb (patch)
tree30ccc5eb873d171be9b5151918a3b983ef98d092 /src
parentd168b08d621990cd1e47c7f3c13bb6e92195b52e (diff)
panfrost/midgard/disasm: Check for certain tag errors
Midgard bundles contain a tag, as well as a copy of the tag of the next bundle to facilitate prefetch. Do some simple static analysis to detect certain tag errors (particularly on shaders without branching). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/disassemble.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c
index 50598c3958e..7fb5d202cc3 100644
--- a/src/panfrost/midgard/disassemble.c
+++ b/src/panfrost/midgard/disassemble.c
@@ -1266,12 +1266,30 @@ disassemble_midgard(uint8_t *code, size_t size)
bool prefetch_flag = false;
+ int last_next_tag = -1;
+
unsigned i = 0;
while (i < num_words) {
unsigned tag = words[i] & 0xF;
+ unsigned next_tag = (words[i] >> 4) & 0xF;
unsigned num_quad_words = midgard_word_size[tag];
+ /* Check the tag */
+ if (last_next_tag > 1) {
+ if (last_next_tag != tag) {
+ printf("/* TAG ERROR got ");
+ print_tag_short(tag);
+ printf(" expected ");
+ print_tag_short(last_next_tag);
+ printf(" */ ");
+ }
+ } else {
+ /* TODO: Check ALU case */
+ }
+
+ last_next_tag = next_tag;
+
switch (midgard_word_types[tag]) {
case midgard_word_type_texture:
print_texture_word(&words[i], tabs);