All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: add pstate mclk(uclk) support for navi10
@ 2019-07-12  3:33 Wang, Kevin(Yang)
       [not found] ` <20190712033326.12294-1-kevin1.wang-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Wang, Kevin(Yang) @ 2019-07-12  3:33 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Quan, Evan, Feng, Kenneth, Wang, Kevin(Yang)

add pstate mclk(uclk) support.

Change-Id: I7f3bca4901833b4ea213fe02249fc055b80e5cdd
Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 1 +
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index de6cc5d489cd..67db2746ec4f 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -136,6 +136,7 @@ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
 		return -EINVAL;
 
 	switch (clk_type) {
+	case SMU_MCLK:
 	case SMU_UCLK:
 		if (!smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UCLK_BIT)) {
 			pr_warn("uclk dpm is not enabled\n");
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index cd32b20a13c1..16a4c1ca98cf 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -709,7 +709,7 @@ static int navi10_force_clk_levels(struct smu_context *smu,
 static int navi10_populate_umd_state_clk(struct smu_context *smu)
 {
 	int ret = 0;
-	uint32_t min_sclk_freq = 0;
+	uint32_t min_sclk_freq = 0, min_mclk_freq = 0;
 
 	ret = smu_get_dpm_freq_range(smu, SMU_SCLK, &min_sclk_freq, NULL);
 	if (ret)
@@ -717,6 +717,12 @@ static int navi10_populate_umd_state_clk(struct smu_context *smu)
 
 	smu->pstate_sclk = min_sclk_freq * 100;
 
+	ret = smu_get_dpm_freq_range(smu, SMU_MCLK, &min_mclk_freq, NULL);
+	if (ret)
+		return ret;
+
+	smu->pstate_mclk = min_mclk_freq * 100;
+
 	return ret;
 }
 
-- 
2.22.0

_______________________________________________
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/powerplay: add pstate mclk(uclk) support for navi10
       [not found] ` <20190712033326.12294-1-kevin1.wang-5C7GfCeVMHo@public.gmane.org>
@ 2019-07-12  3:47   ` Quan, Evan
  0 siblings, 0 replies; 2+ messages in thread
From: Quan, Evan @ 2019-07-12  3:47 UTC (permalink / raw)
  To: Wang, Kevin(Yang), amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Feng, Kenneth

Reviewed-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: Wang, Kevin(Yang) <Kevin1.Wang@amd.com>
> Sent: Friday, July 12, 2019 11:34 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Feng, Kenneth <Kenneth.Feng@amd.com>; Quan, Evan
> <Evan.Quan@amd.com>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>
> Subject: [PATCH] drm/amd/powerplay: add pstate mclk(uclk) support for
> navi10
> 
> add pstate mclk(uclk) support.
> 
> Change-Id: I7f3bca4901833b4ea213fe02249fc055b80e5cdd
> Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 1 +
> drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 8 +++++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> index de6cc5d489cd..67db2746ec4f 100644
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> @@ -136,6 +136,7 @@ int smu_get_dpm_freq_range(struct smu_context
> *smu, enum smu_clk_type clk_type,
>  		return -EINVAL;
> 
>  	switch (clk_type) {
> +	case SMU_MCLK:
>  	case SMU_UCLK:
>  		if (!smu_feature_is_enabled(smu,
> SMU_FEATURE_DPM_UCLK_BIT)) {
>  			pr_warn("uclk dpm is not enabled\n"); diff --git
> a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> index cd32b20a13c1..16a4c1ca98cf 100644
> --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> @@ -709,7 +709,7 @@ static int navi10_force_clk_levels(struct smu_context
> *smu,  static int navi10_populate_umd_state_clk(struct smu_context *smu)
> {
>  	int ret = 0;
> -	uint32_t min_sclk_freq = 0;
> +	uint32_t min_sclk_freq = 0, min_mclk_freq = 0;
> 
>  	ret = smu_get_dpm_freq_range(smu, SMU_SCLK, &min_sclk_freq,
> NULL);
>  	if (ret)
> @@ -717,6 +717,12 @@ static int navi10_populate_umd_state_clk(struct
> smu_context *smu)
> 
>  	smu->pstate_sclk = min_sclk_freq * 100;
> 
> +	ret = smu_get_dpm_freq_range(smu, SMU_MCLK, &min_mclk_freq,
> NULL);
> +	if (ret)
> +		return ret;
> +
> +	smu->pstate_mclk = min_mclk_freq * 100;
> +
>  	return ret;
>  }
> 
> --
> 2.22.0

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

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

end of thread, other threads:[~2019-07-12  3:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  3:33 [PATCH] drm/amd/powerplay: add pstate mclk(uclk) support for navi10 Wang, Kevin(Yang)
     [not found] ` <20190712033326.12294-1-kevin1.wang-5C7GfCeVMHo@public.gmane.org>
2019-07-12  3:47   ` Quan, Evan

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.