Mesa (main): pan/va: Only hex dump when verbosely disassembling

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 6 21:18:32 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Sun Nov 21 19:03:33 2021 -0500

pan/va: Only hex dump when verbosely disassembling

Closer behaviour to Bifrost, making the entrypoints symmetric.

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

---

 src/panfrost/bifrost/valhall/disassemble.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/panfrost/bifrost/valhall/disassemble.h b/src/panfrost/bifrost/valhall/disassemble.h
index 5cd644f0303..7bde8b3cb9d 100644
--- a/src/panfrost/bifrost/valhall/disassemble.h
+++ b/src/panfrost/bifrost/valhall/disassemble.h
@@ -36,7 +36,7 @@ va_print_dest(FILE *fp, uint8_t dest, bool can_mask)
 void va_disasm_instr(FILE *fp, uint64_t instr);
 
 static inline void
-disassemble_valhall(FILE *fp, const uint64_t *code, unsigned size)
+disassemble_valhall(FILE *fp, const uint64_t *code, unsigned size, bool verbose)
 {
    assert((size & 7) == 0);
 
@@ -48,11 +48,13 @@ disassemble_valhall(FILE *fp, const uint64_t *code, unsigned size)
       if (instr == 0)
          return;
 
-      /* Print byte pattern */
-      for (unsigned j = 0; j < 8; ++j)
-         fprintf(fp, "%02x ", (uint8_t) (instr >> (j * 8)));
+      if (verbose) {
+         /* Print byte pattern */
+         for (unsigned j = 0; j < 8; ++j)
+            fprintf(fp, "%02x ", (uint8_t) (instr >> (j * 8)));
 
-      fprintf(fp, "   ");
+         fprintf(fp, "   ");
+      }
 
       va_disasm_instr(fp, instr);
       fprintf(fp, "\n");



More information about the mesa-commit mailing list