All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xu, Feifei" <Feifei.Xu@amd.com>
To: "Lazar, Lijo" <Lijo.Lazar@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Wang, Kevin\(Yang\)" <Kevin1.Wang@amd.com>,
	"Feng, Kenneth" <Kenneth.Feng@amd.com>,
	"Zhang, Hawking" <Hawking.Zhang@amd.com>
Subject: RE: [PATCH] drm/amd/pm: Fix DPM level count on aldebaran
Date: Fri, 26 Mar 2021 06:51:20 +0000	[thread overview]
Message-ID: <DM6PR12MB4603CD531249422165C70F34FE619@DM6PR12MB4603.namprd12.prod.outlook.com> (raw)
In-Reply-To: <MN2PR12MB45496022CDFAACE2E5E2FF8197619@MN2PR12MB4549.namprd12.prod.outlook.com>


[-- Attachment #1.1: Type: text/plain, Size: 2020 bytes --]



Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>

From: Lazar, Lijo <Lijo.Lazar@amd.com>
Sent: Friday, March 26, 2021 2:04 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>
Subject: [PATCH] drm/amd/pm: Fix DPM level count on aldebaran


[AMD Public Use]

Firmware returns zero-based max level, increment by one to get
total levels. This fixes the issue of not showing all levels and current
frequency when frequency is at max DPM level.

Signed-off-by: Lijo Lazar lijo.lazar@amd.com<mailto:lijo.lazar@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
index 1f860969ea1c..30c9ac635105 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
@@ -1710,10 +1710,14 @@ int smu_v13_0_get_dpm_level_count(struct smu_context *smu,
                                                                 enum smu_clk_type clk_type,
                                                                 uint32_t *value)
{
-              return smu_v13_0_get_dpm_freq_by_index(smu,
-                                                                                     clk_type,
-                                                                                     0xff,
-                                                                                     value);
+             int ret;
+
+             ret = smu_v13_0_get_dpm_freq_by_index(smu, clk_type, 0xff, value);
+             /* FW returns 0 based max level, increment by one */
+             if (!ret && value)
+                             ++(*value);
+
+             return ret;
}

 int smu_v13_0_set_single_dpm_table(struct smu_context *smu,
--
2.17.1


[-- Attachment #1.2: Type: text/html, Size: 8263 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      reply	other threads:[~2021-03-26  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  6:03 [PATCH] drm/amd/pm: Fix DPM level count on aldebaran Lazar, Lijo
2021-03-26  6:51 ` Xu, Feifei [this message]

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=DM6PR12MB4603CD531249422165C70F34FE619@DM6PR12MB4603.namprd12.prod.outlook.com \
    --to=feifei.xu@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Kenneth.Feng@amd.com \
    --cc=Kevin1.Wang@amd.com \
    --cc=Lijo.Lazar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.