drm/amdgpu: add ta DTM/HDCP print in amdgpu_firmware_info for apu
Subsystems (2)
PATCH 1/1 drm/amdgpu: add ta DTM/HDCP print in amdgpu_firmware_info for apu
From: changzhu <[email protected]>
From: Changfeng <[email protected]>
It needs to add ta DTM/HDCP print to get HDCP/DTM version info when cat amdgpu_firmware_info
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 27 ++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +22 -5
@@ -282,14 +282,20 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, fw_info->feature =0 ;break ;case AMDGPU_INFO_FW_TA : -if (query_fw->index >1 ) +if (query_fw->index >3 )return -EINVAL ;if (query_fw->index ==0 ) { fw_info->ver = adev->psp.ta_fw_version; fw_info->feature = adev->psp.ta_xgmi_ucode_version; - }else { + }else if (query_fw->index ==1 ) { fw_info->ver = adev->psp.ta_fw_version; fw_info->feature = adev->psp.ta_ras_ucode_version; + }else if (query_fw->index ==2 ) { + fw_info->ver = adev->psp.ta_fw_version; + fw_info->feature = adev->psp.ta_hdcp_ucode_version; + }else { + fw_info->ver = adev->psp.ta_fw_version; + fw_info->feature = adev->psp.ta_dtm_ucode_version; }break ;case AMDGPU_INFO_FW_SDMA :
@@ -1383,13 +1389,24 @@ static int amdgpu_debugfs_firmware_info(struct seq_file *m, void *data) fw_info.feature, fw_info.ver); query_fw.fw_type =AMDGPU_INFO_FW_TA ; -for (i =0 ; i <2 ; i++) { +for (i =0 ; i <4 ; i++) { query_fw.index = i; ret =amdgpu_firmware_info (&fw_info, &query_fw, adev);if (ret)continue ; -seq_printf (m,"TA %s feature version: %u, firmware version: 0x%08x\n" , - i ?"RAS" :"XGMI" , fw_info.feature, fw_info.ver); +if (query_fw.index ==0 ) { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"RAS" , fw_info.feature, fw_info.ver); + }else if (query_fw.index ==1 ) { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"XGMI" , fw_info.feature, fw_info.ver); + }else if (query_fw.index ==2 ) { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"HDCP" , fw_info.feature, fw_info.ver); + }else { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"DTM" , fw_info.feature, fw_info.ver); + } }/* SMC */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 27 lines · Changfeng
From: changzhu <[email protected]>
From: Changfeng <[email protected]>
It needs to add ta DTM/HDCP print to get HDCP/DTM version info when cat
amdgpu_firmware_infoChange-Id I05f20d6868ce2cac06a8496890b766dbb61de671Signed-off-by Changfeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 27 ++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1
-1@@ -282,14 +282,20 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, fw_info->feature =0 ;break ;case AMDGPU_INFO_FW_TA : -if (query_fw->index >1 ) +if (query_fw->index >3 )return -EINVAL ;if (query_fw->index ==0 ) { fw_info->ver = adev->psp.ta_fw_version; fw_info->feature = adev->psp.ta_xgmi_ucode_version;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, · line 298
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +7
-1- }else { + }else if (query_fw->index ==1 ) { fw_info->ver = adev->psp.ta_fw_version; fw_info->feature = adev->psp.ta_ras_ucode_version; + }else if (query_fw->index ==2 ) { + fw_info->ver = adev->psp.ta_fw_version; + fw_info->feature = adev->psp.ta_hdcp_ucode_version; + }else { + fw_info->ver = adev->psp.ta_fw_version; + fw_info->feature = adev->psp.ta_dtm_ucode_version;
Can we use switch-case here?
Quoted 18 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +4
-3}break ;case AMDGPU_INFO_FW_SDMA :@@ -1383,13 +1389,24 @@ static int amdgpu_debugfs_firmware_info(struct seq_file *m, void *data) fw_info.feature, fw_info.ver); query_fw.fw_type =AMDGPU_INFO_FW_TA ; -for (i =0 ; i <2 ; i++) { +for (i =0 ; i <4 ; i++) { query_fw.index = i; ret =amdgpu_firmware_info (&fw_info, &query_fw, adev);if (ret)continue ; -seq_printf (m,"TA %s feature version: %u, firmware version: 0x%08x\n" , - i ?"RAS" :"XGMI" , fw_info.feature, fw_info.ver); +if (query_fw.index ==0 ) { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"RAS" , fw_info.feature, fw_info.ver);
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c static int amdgpu_debugfs_firmware_info(struct seq_file *m, void *data) · line 1409
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +10
-0+ }else if (query_fw.index ==1 ) { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"XGMI" , fw_info.feature, fw_info.ver); + }else if (query_fw.index ==2 ) { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"HDCP" , fw_info.feature, fw_info.ver); + }else { +seq_printf (m,"TA %s feature version: 0x%08x, firmware version: 0x%08x\n" , +"DTM" , fw_info.feature, fw_info.ver); + }
The same comment above. Switch-case is more straightforward.
Thanks,
Ray
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-0}/* SMC */ Signature · 1 line
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx