Add the MES firmware debug-extension ("mes_dbgext") API definitions to
the shared MES v11 and v12 interface headers: the
MESAPI_MISC__SETUP_MES_DBGEXT misc opcode, the MES_DBGEXT_INIT_DATA
struct (log buffer MC address + option bits), and the corresponding
dbgext_init_data member of union MESAPI__MISC.

These describe the SETUP_MES_DBGEXT packet the firmware expects and are
consumed by the per-IP mes_dbgext wiring for gfx11 and gfx12.

Signed-off-by: Yongqiang Sun <[email protected]>
---
 drivers/gpu/drm/amd/include/mes_v11_api_def.h | 18 ++++++++++++++++++
 drivers/gpu/drm/amd/include/mes_v12_api_def.h | 17 +++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/amd/include/mes_v11_api_def.h 
b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
index a8e6ccc7817c..e251ccc41f9c 100644
--- a/drivers/gpu/drm/amd/include/mes_v11_api_def.h
+++ b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
@@ -622,6 +622,7 @@ enum MESAPI_MISC_OPCODE {
        MESAPI_MISC__NOTIFY_TO_UNMAP_PROCESSES,
        MESAPI_MISC__CHANGE_CONFIG,
        MESAPI_MISC__LAUNCH_CLEANER_SHADER,
+       MESAPI_MISC__SETUP_MES_DBGEXT,
 
        MESAPI_MISC__MAX,
 };
@@ -702,6 +703,22 @@ struct CHANGE_CONFIG {
        } tdr_config;
 };
 
+/*
+ * MES firmware debug extension ("mes_dbgext"): the driver hands the MES a
+ * GART/GTT log buffer; the MES firmware writes text/binary log items into a
+ * circular, zone-partitioned buffer that the driver drains and prints.
+ */
+struct MES_DBGEXT_INIT_DATA {
+       uint64_t dbg_ext_mc_addr;
+       union {
+               struct {
+                       uint64_t trigger_interrupt_per_new_msg : 1;
+                       uint64_t reserved : 63;
+               };
+               uint64_t u64_all;
+       };
+};
+
 union MESAPI__MISC {
        struct {
                union MES_API_HEADER    header;
@@ -717,6 +734,7 @@ union MESAPI__MISC {
                        struct          SET_SHADER_DEBUGGER set_shader_debugger;
                        enum MES_AMD_PRIORITY_LEVEL queue_sch_level;
                        struct          CHANGE_CONFIG change_config;
+                       struct          MES_DBGEXT_INIT_DATA dbgext_init_data;
 
                        uint32_t        data[MISC_DATA_MAX_SIZE_IN_DWORDS];
                };
diff --git a/drivers/gpu/drm/amd/include/mes_v12_api_def.h 
b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
index cb7ebdfffeeb..3e214cb4f6e1 100644
--- a/drivers/gpu/drm/amd/include/mes_v12_api_def.h
+++ b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
@@ -839,6 +839,22 @@ struct CHANGE_CONFIG {
        } tdr_config;
 };
 
+/*
+ * MES firmware debug extension ("mes_dbgext"): the driver hands the MES a
+ * GART/GTT log buffer; the MES firmware writes text/binary log items into a
+ * circular, zone-partitioned buffer that the driver drains and prints.
+ */
+struct MES_DBGEXT_INIT_DATA {
+       uint64_t dbg_ext_mc_addr;
+       union {
+               struct {
+                       uint64_t trigger_interrupt_per_new_msg : 1;
+                       uint64_t reserved : 63;
+               };
+               uint64_t u64_all;
+       };
+};
+
 union MESAPI__MISC {
        struct {
                union MES_API_HEADER    header;
@@ -853,6 +869,7 @@ union MESAPI__MISC {
                        struct SET_SHADER_DEBUGGER set_shader_debugger;
                        enum MES_AMD_PRIORITY_LEVEL queue_sch_level;
                        struct CHANGE_CONFIG change_config;
+                       struct MES_DBGEXT_INIT_DATA dbgext_init_data;
                        uint32_t data[MISC_DATA_MAX_SIZE_IN_DWORDS];
                };
                uint64_t                timestamp;
-- 
2.43.0

Reply via email to