Re: [PATCH] drm/amdgpu: add MES and MES-KIQ version in debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Public]


Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>

From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of Yifan Zhang <yifan1.zhang@xxxxxxx>
Sent: Friday, September 16, 2022 12:38 AM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>
Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Huang, Tim <Tim.Huang@xxxxxxx>; Du, Xiaojian <Xiaojian.Du@xxxxxxx>; Zhang, Yifan <Yifan1.Zhang@xxxxxxx>
Subject: [PATCH] drm/amdgpu: add MES and MES-KIQ version in debugfs
 
This patch addes MES and MES-KIQ version in debugfs.

Signed-off-by: Yifan Zhang <yifan1.zhang@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 24 ++++++++++++++++++++++++
 include/uapi/drm/amdgpu_drm.h           |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 1369c25448dc..bb0ed358909f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -328,6 +328,14 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
                 fw_info->ver = adev->psp.cap_fw_version;
                 fw_info->feature = adev->psp.cap_feature_version;
                 break;
+       case AMDGPU_INFO_FW_MES_KIQ:
+               fw_info->ver = adev->mes.ucode_fw_version[0];
+               fw_info->feature = 0;
+               break;
+       case AMDGPU_INFO_FW_MES:
+               fw_info->ver = adev->mes.ucode_fw_version[1];
+               fw_info->feature = 0;
+               break;
         default:
                 return -EINVAL;
         }
@@ -1581,6 +1589,22 @@ static int amdgpu_debugfs_firmware_info_show(struct seq_file *m, void *unused)
                                 fw_info.feature, fw_info.ver);
         }
 
+       /* MES_KIQ */
+       query_fw.fw_type = AMDGPU_INFO_FW_MES_KIQ;
+       ret = amdgpu_firmware_info(&fw_info, &query_fw, adev);
+       if (ret)
+               return ret;
+       seq_printf(m, "MES_KIQ feature version: %u, firmware version: 0x%08x\n",
+                  fw_info.feature, fw_info.ver);
+
+       /* MES */
+       query_fw.fw_type = AMDGPU_INFO_FW_MES;
+       ret = amdgpu_firmware_info(&fw_info, &query_fw, adev);
+       if (ret)
+               return ret;
+       seq_printf(m, "MES feature version: %u, firmware version: 0x%08x\n",
+                  fw_info.feature, fw_info.ver);
+
         seq_printf(m, "VBIOS version: %s\n", ctx->vbios_version);
 
         return 0;
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index c2c9c674a223..12fdf62730b8 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -755,6 +755,10 @@ struct drm_amdgpu_cs_chunk_data {
         #define AMDGPU_INFO_FW_TOC              0x15
         /* Subquery id: Query CAP firmware version */
         #define AMDGPU_INFO_FW_CAP              0x16
+       /* Subquery id: Query MES_KIQ firmware version */
+       #define AMDGPU_INFO_FW_MES_KIQ          0x17
+       /* Subquery id: Query MES firmware version */
+       #define AMDGPU_INFO_FW_MES              0x18
 
 /* number of bytes moved for TTM migration */
 #define AMDGPU_INFO_NUM_BYTES_MOVED             0x0f
--
2.37.3


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux