]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: Add DMCUB to firmware query interface
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 25 Oct 2019 18:15:08 +0000 (14:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Nov 2019 20:29:42 +0000 (15:29 -0500)
The DMCUB firmware version can be read using the AMDGPU_INFO ioctl
or the amdgpu_firmware_info debugfs entry.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
include/uapi/drm/amdgpu_drm.h

index 82c46c4faaad5761b3f03ea3fbf41771800b16be..3827dcf7e48d2bbf8fe4337dc726292c2b75a4e3 100644 (file)
@@ -293,6 +293,10 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
                fw_info->ver = adev->dm.dmcu_fw_version;
                fw_info->feature = 0;
                break;
+       case AMDGPU_INFO_FW_DMCUB:
+               fw_info->ver = adev->dm.dmcub_fw_version;
+               fw_info->feature = 0;
+               break;
        default:
                return -EINVAL;
        }
@@ -1390,6 +1394,14 @@ static int amdgpu_debugfs_firmware_info(struct seq_file *m, void *data)
        seq_printf(m, "DMCU feature version: %u, firmware version: 0x%08x\n",
                   fw_info.feature, fw_info.ver);
 
+       /* DMCUB */
+       query_fw.fw_type = AMDGPU_INFO_FW_DMCUB;
+       ret = amdgpu_firmware_info(&fw_info, &query_fw, adev);
+       if (ret)
+               return ret;
+       seq_printf(m, "DMCUB feature version: %u, firmware version: 0x%08x\n",
+                  fw_info.feature, fw_info.ver);
+
 
        seq_printf(m, "VBIOS version: %s\n", ctx->vbios_version);
 
index bbdad866e3fe1d5d8310b9119422480e3bd487c1..ac3879829bb5d4eca930f35dc52070d20ce7085e 100644 (file)
@@ -703,6 +703,9 @@ struct drm_amdgpu_cs_chunk_data {
        /* Subquery id: Query DMCU firmware version */
        #define AMDGPU_INFO_FW_DMCU             0x12
        #define AMDGPU_INFO_FW_TA               0x13
+       /* Subquery id: Query DMCUB firmware version */
+       #define AMDGPU_INFO_FW_DMCUB            0x14
+
 /* number of bytes moved for TTM migration */
 #define AMDGPU_INFO_NUM_BYTES_MOVED            0x0f
 /* the used VRAM size */