panfrost/decode: Disassemble Bifrost shaders
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 18 May 2019 18:58:56 +0000 (18:58 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 19 May 2019 17:41:08 +0000 (17:41 +0000)
We already have the Bifrost disassembler in-tree, so now that panwrap is
able to dump Bifrost command streams, hook up the disassembler to
pandecode.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ryan Houdek <Sonicadvance1@gmail.com>
src/gallium/drivers/panfrost/meson.build
src/gallium/drivers/panfrost/pandecode/decode.c

index b3673d15bc172748d55d22f497d0256073755dad..65db4006e5082ed5487489ad5ff741d8f095e080 100644 (file)
@@ -151,7 +151,8 @@ files_pandecode = files(
 
   'pan_pretty_print.c',
 
-  'midgard/disassemble.c'
+  'midgard/disassemble.c',
+  'bifrost/disassemble.c',
 )
 
 pandecode = executable(
index f8f49f69e427c9d5ec408845578eefefa955b351..e70ebb7f660e3b3324cc5ec8c30d2d71d95238a4 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "../pan_pretty_print.h"
 #include "../midgard/disassemble.h"
+#include "../bifrost/disassemble.h"
 int pandecode_replay_jc(mali_ptr jc_gpu_va, bool bifrost);
 
 #define MEMORY_PROP(obj, p) {\
@@ -1155,17 +1156,17 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
         /* Compute maximum possible size */
         size_t sz = mem->length - (shader_ptr - mem->gpu_va);
 
-        /* TODO: When Bifrost is upstreamed, disassemble that too */
-        if (is_bifrost) {
-                pandecode_msg("Bifrost disassembler not yet upstreamed");
-                return;
-        }
-
         /* Print some boilerplate to clearly denote the assembly (which doesn't
          * obey indentation rules), and actually do the disassembly! */
 
         printf("\n\n");
-        disassemble_midgard(code, sz);
+
+        if (is_bifrost) {
+                disassemble_bifrost(code, sz, false);
+        } else {
+                disassemble_midgard(code, sz);
+        }
+
         printf("\n\n");
 }