Mesa (staging/21.2): intel/disasm: fix missing oword index decoding

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 3 18:09:02 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 18b65515a69848aa65e3d67e81c003dc94831ad6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18b65515a69848aa65e3d67e81c003dc94831ad6

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Tue Aug  3 15:48:03 2021 +0300

intel/disasm: fix missing oword index decoding

Also switch to array of strings to show high/low dwords.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Fixes: daba2894ffc300 ("intel/disasm: decode/describe more send messages")
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12183>
(cherry picked from commit 97be8e42e42f3b739c3de808553094f86ad8879f)

---

 .pick_status.json               |  2 +-
 src/intel/compiler/brw_disasm.c | 19 ++++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 5ea287ea4c5..399675f06eb 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
         "description": "intel/disasm: fix missing oword index decoding",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "daba2894ffc3000b76ff5f3d8c767119d6a8eeae"
     },
diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 84b1c7c9e77..7fca5b27bee 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -429,11 +429,12 @@ static const char *const dp_dc0_msg_type_gfx7[16] = {
    [GFX7_DATAPORT_DC_UNTYPED_SURFACE_WRITE] = "DC untyped surface write",
 };
 
-static const int dp_oword_block_rw[8] = {
-      [BRW_DATAPORT_OWORD_BLOCK_1_OWORDLOW] = 1,
-      [BRW_DATAPORT_OWORD_BLOCK_2_OWORDS] = 2,
-      [BRW_DATAPORT_OWORD_BLOCK_4_OWORDS] = 4,
-      [BRW_DATAPORT_OWORD_BLOCK_8_OWORDS] = 8,
+static const char *const dp_oword_block_rw[8] = {
+      [BRW_DATAPORT_OWORD_BLOCK_1_OWORDLOW]  = "1-low",
+      [BRW_DATAPORT_OWORD_BLOCK_1_OWORDHIGH] = "1-high",
+      [BRW_DATAPORT_OWORD_BLOCK_2_OWORDS]    = "2",
+      [BRW_DATAPORT_OWORD_BLOCK_4_OWORDS]    = "4",
+      [BRW_DATAPORT_OWORD_BLOCK_8_OWORDS]    = "8",
 };
 
 static const char *const dp_dc1_msg_type_hsw[32] = {
@@ -2307,8 +2308,8 @@ brw_disassemble_inst(FILE *file, const struct intel_device_info *devinfo,
                case GFX7_DATAPORT_DC_OWORD_BLOCK_READ:
                case GFX7_DATAPORT_DC_OWORD_BLOCK_WRITE: {
                   unsigned msg_ctrl = brw_dp_desc_msg_control(devinfo, imm_desc);
-                  assert(dp_oword_block_rw[msg_ctrl & 7] > 0);
-                  format(file, "owords = %d, aligned = %d",
+                  assert(dp_oword_block_rw[msg_ctrl & 7]);
+                  format(file, "owords = %s, aligned = %d",
                         dp_oword_block_rw[msg_ctrl & 7], (msg_ctrl >> 3) & 3);
                   break;
                }
@@ -2369,8 +2370,8 @@ brw_disassemble_inst(FILE *file, const struct intel_device_info *devinfo,
                   break;
                case GFX9_DATAPORT_DC_PORT1_A64_OWORD_BLOCK_WRITE:
                case GFX9_DATAPORT_DC_PORT1_A64_OWORD_BLOCK_READ:
-                  assert(dp_oword_block_rw[msg_ctrl & 7] > 0);
-                  format(file, "owords = %d, aligned = %d",
+                  assert(dp_oword_block_rw[msg_ctrl & 7]);
+                  format(file, "owords = %s, aligned = %d",
                         dp_oword_block_rw[msg_ctrl & 7], (msg_ctrl >> 3) & 3);
                   break;
                default:



More information about the mesa-commit mailing list