From: Huang Rui <ray.huang@amd.com>
To: "Zhu, Changfeng" <Changfeng.Zhu@amd.com>
Cc: "Clements, John" <John.Clements@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu: add ta DTM/HDCP print in amdgpu_firmware_info for apu
Date: Wed, 9 Sep 2020 13:05:07 +0800 [thread overview]
Message-ID: <20200909050507.GC2509333@hr-amd> (raw)
In-Reply-To: <20200908083111.13901-1-changfeng.zhu@amd.com>
On Tue, Sep 08, 2020 at 04:31:11PM +0800, Zhu, Changfeng wrote:
> From: changzhu <Changfeng.Zhu@amd.com>
>
> From: Changfeng <Changfeng.Zhu@amd.com>
>
> It needs to add ta DTM/HDCP print to get HDCP/DTM version info when cat
> amdgpu_firmware_info
>
> Change-Id: I05f20d6868ce2cac06a8496890b766dbb61de671
> Signed-off-by: Changfeng <Changfeng.Zhu@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 27 ++++++++++++++++++++-----
> 1 file changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 4f6b167fef26..3a6a881a4105 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -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;
Can we use switch-case here?
> }
> 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);
> + }
The same comment above. Switch-case is more straightforward.
Thanks,
Ray
> }
>
> /* SMC */
> --
> 2.17.1
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-09-09 5:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-08 8:31 [PATCH] drm/amdgpu: add ta DTM/HDCP print in amdgpu_firmware_info for apu Changfeng.Zhu
2020-09-09 5:05 ` Huang Rui [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-09-09 5:50 Changfeng.Zhu
2020-09-10 10:57 ` Huang Rui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200909050507.GC2509333@hr-amd \
--to=ray.huang@amd.com \
--cc=Changfeng.Zhu@amd.com \
--cc=John.Clements@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox