* [PATCH] drm/amd/pm: Fix DPM level count on aldebaran
@ 2021-03-26 6:03 Lazar, Lijo
2021-03-26 6:51 ` Xu, Feifei
0 siblings, 1 reply; 2+ messages in thread
From: Lazar, Lijo @ 2021-03-26 6:03 UTC (permalink / raw)
To: amd-gfx; +Cc: Xu, Feifei, Wang, Kevin(Yang), Feng, Kenneth, Zhang, Hawking
[-- Attachment #1.1: Type: text/plain, Size: 1633 bytes --]
[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: 6977 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] drm/amd/pm: Fix DPM level count on aldebaran
2021-03-26 6:03 [PATCH] drm/amd/pm: Fix DPM level count on aldebaran Lazar, Lijo
@ 2021-03-26 6:51 ` Xu, Feifei
0 siblings, 0 replies; 2+ messages in thread
From: Xu, Feifei @ 2021-03-26 6:51 UTC (permalink / raw)
To: Lazar, Lijo, amd-gfx; +Cc: Wang, Kevin(Yang), Feng, Kenneth, Zhang, Hawking
[-- 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-26 6:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.