amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting
@ 2019-11-14  9:07 Evan Quan
  2019-11-14  9:07 ` Evan Quan
       [not found] ` <20191114090720.14342-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Evan Quan @ 2019-11-14  9:07 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

For fine grained dpm, there is only two levels supported. However
to reflect correctly the current clock frequency, there is an
intermediate level faked. Thus on forcing level setting, we
need to treat level 2 correctly as level 1.

Change-Id: I32f936636f27eb8d8d9002bedd701f2bb0d3060a
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index c4f84627cfd9..0bbe3412d9b5 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -823,6 +823,12 @@ static int navi10_force_clk_levels(struct smu_context *smu,
 	case SMU_UCLK:
 	case SMU_DCEFCLK:
 	case SMU_FCLK:
+		/* There is only 2 levels for fine grained DPM */
+		if (navi10_is_support_fine_grained_dpm(smu, clk_type)) {
+			soft_max_level = (soft_max_level >= 1 ? 1 : 0);
+			soft_min_level = (soft_min_level >= 1 ? 1 : 0);
+		}
+
 		ret = smu_get_dpm_freq_by_index(smu, clk_type, soft_min_level, &min_freq);
 		if (ret)
 			return size;
-- 
2.24.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting
  2019-11-14  9:07 [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting Evan Quan
@ 2019-11-14  9:07 ` Evan Quan
       [not found] ` <20191114090720.14342-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Evan Quan @ 2019-11-14  9:07 UTC (permalink / raw)
  To: amd-gfx; +Cc: Evan Quan

For fine grained dpm, there is only two levels supported. However
to reflect correctly the current clock frequency, there is an
intermediate level faked. Thus on forcing level setting, we
need to treat level 2 correctly as level 1.

Change-Id: I32f936636f27eb8d8d9002bedd701f2bb0d3060a
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index c4f84627cfd9..0bbe3412d9b5 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -823,6 +823,12 @@ static int navi10_force_clk_levels(struct smu_context *smu,
 	case SMU_UCLK:
 	case SMU_DCEFCLK:
 	case SMU_FCLK:
+		/* There is only 2 levels for fine grained DPM */
+		if (navi10_is_support_fine_grained_dpm(smu, clk_type)) {
+			soft_max_level = (soft_max_level >= 1 ? 1 : 0);
+			soft_min_level = (soft_min_level >= 1 ? 1 : 0);
+		}
+
 		ret = smu_get_dpm_freq_by_index(smu, clk_type, soft_min_level, &min_freq);
 		if (ret)
 			return size;
-- 
2.24.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting
       [not found] ` <20191114090720.14342-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-11-14  9:18   ` Wang, Kevin(Yang)
  2019-11-14  9:18     ` Wang, Kevin(Yang)
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Kevin(Yang) @ 2019-11-14  9:18 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


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

Reviewed-by: Kevin Wang <kevin1.wang-5C7GfCeVMHo@public.gmane.org>

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, November 14, 2019 5:07 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Quan, Evan <Evan.Quan-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting

For fine grained dpm, there is only two levels supported. However
to reflect correctly the current clock frequency, there is an
intermediate level faked. Thus on forcing level setting, we
need to treat level 2 correctly as level 1.

Change-Id: I32f936636f27eb8d8d9002bedd701f2bb0d3060a
Signed-off-by: Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index c4f84627cfd9..0bbe3412d9b5 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -823,6 +823,12 @@ static int navi10_force_clk_levels(struct smu_context *smu,
         case SMU_UCLK:
         case SMU_DCEFCLK:
         case SMU_FCLK:
+               /* There is only 2 levels for fine grained DPM */
+               if (navi10_is_support_fine_grained_dpm(smu, clk_type)) {
+                       soft_max_level = (soft_max_level >= 1 ? 1 : 0);
+                       soft_min_level = (soft_min_level >= 1 ? 1 : 0);
+               }
+
                 ret = smu_get_dpm_freq_by_index(smu, clk_type, soft_min_level, &min_freq);
                 if (ret)
                         return size;
--
2.24.0

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

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

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

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting
  2019-11-14  9:18   ` Wang, Kevin(Yang)
@ 2019-11-14  9:18     ` Wang, Kevin(Yang)
  0 siblings, 0 replies; 4+ messages in thread
From: Wang, Kevin(Yang) @ 2019-11-14  9:18 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx


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

Reviewed-by: Kevin Wang <kevin1.wang@amd.com>

________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Evan Quan <evan.quan@amd.com>
Sent: Thursday, November 14, 2019 5:07 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Quan, Evan <Evan.Quan@amd.com>
Subject: [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting

For fine grained dpm, there is only two levels supported. However
to reflect correctly the current clock frequency, there is an
intermediate level faked. Thus on forcing level setting, we
need to treat level 2 correctly as level 1.

Change-Id: I32f936636f27eb8d8d9002bedd701f2bb0d3060a
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index c4f84627cfd9..0bbe3412d9b5 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -823,6 +823,12 @@ static int navi10_force_clk_levels(struct smu_context *smu,
         case SMU_UCLK:
         case SMU_DCEFCLK:
         case SMU_FCLK:
+               /* There is only 2 levels for fine grained DPM */
+               if (navi10_is_support_fine_grained_dpm(smu, clk_type)) {
+                       soft_max_level = (soft_max_level >= 1 ? 1 : 0);
+                       soft_min_level = (soft_min_level >= 1 ? 1 : 0);
+               }
+
                 ret = smu_get_dpm_freq_by_index(smu, clk_type, soft_min_level, &min_freq);
                 if (ret)
                         return size;
--
2.24.0

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

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

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

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-14  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14  9:07 [PATCH] drm/amd/powerplay: correct fine grained dpm force level setting Evan Quan
2019-11-14  9:07 ` Evan Quan
     [not found] ` <20191114090720.14342-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-11-14  9:18   ` Wang, Kevin(Yang)
2019-11-14  9:18     ` Wang, Kevin(Yang)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).