All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: Disable GFXOFF when GFX DPM or PG disabled
@ 2021-02-02 12:04 Jinzhou Su
  2021-02-02 12:15 ` Huang Rui
  0 siblings, 1 reply; 2+ messages in thread
From: Jinzhou Su @ 2021-02-02 12:04 UTC (permalink / raw)
  To: amd-gfx; +Cc: Jinzhou Su, ray.huang

Check GFX DPM and PG bit before enable GFXOFF on Vangogh
smu post init.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
index 4726cac8d824..f0f06ef47b9e 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
@@ -1712,10 +1712,16 @@ static int vangogh_post_smu_init(struct smu_context *smu)
 		adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;
 
 	/* allow message will be sent after enable message on Vangogh*/
-	ret = smu_cmn_send_smc_msg(smu, SMU_MSG_EnableGfxOff, NULL);
-	if (ret) {
-		dev_err(adev->dev, "Failed to Enable GfxOff!\n");
-		return ret;
+	if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_DPM_GFXCLK_BIT) &&
+			(adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) {
+		ret = smu_cmn_send_smc_msg(smu, SMU_MSG_EnableGfxOff, NULL);
+		if (ret) {
+			dev_err(adev->dev, "Failed to Enable GfxOff!\n");
+			return ret;
+		}
+	} else {
+		adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
+		dev_info(adev->dev, "If GFX DPM or power gate disabled, disable GFXOFF\n");
 	}
 
 	/* if all CUs are active, no need to power off any WGPs */
-- 
2.17.1

_______________________________________________
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: Disable GFXOFF when GFX DPM or PG disabled
  2021-02-02 12:04 [PATCH] drm/amd/pm: Disable GFXOFF when GFX DPM or PG disabled Jinzhou Su
@ 2021-02-02 12:15 ` Huang Rui
  0 siblings, 0 replies; 2+ messages in thread
From: Huang Rui @ 2021-02-02 12:15 UTC (permalink / raw)
  To: Su, Jinzhou (Joe); +Cc: amd-gfx

On Tue, Feb 02, 2021 at 08:04:43PM +0800, Su, Jinzhou (Joe) wrote:
> Check GFX DPM and PG bit before enable GFXOFF on Vangogh
> smu post init.
> 
> Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 4726cac8d824..f0f06ef47b9e 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -1712,10 +1712,16 @@ static int vangogh_post_smu_init(struct smu_context *smu)
>  		adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;
>  
>  	/* allow message will be sent after enable message on Vangogh*/
> -	ret = smu_cmn_send_smc_msg(smu, SMU_MSG_EnableGfxOff, NULL);
> -	if (ret) {
> -		dev_err(adev->dev, "Failed to Enable GfxOff!\n");
> -		return ret;
> +	if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_DPM_GFXCLK_BIT) &&
> +			(adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) {
> +		ret = smu_cmn_send_smc_msg(smu, SMU_MSG_EnableGfxOff, NULL);
> +		if (ret) {
> +			dev_err(adev->dev, "Failed to Enable GfxOff!\n");
> +			return ret;
> +		}
> +	} else {
> +		adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
> +		dev_info(adev->dev, "If GFX DPM or power gate disabled, disable GFXOFF\n");
>  	}
>  
>  	/* if all CUs are active, no need to power off any WGPs */
> -- 
> 2.17.1
> 
_______________________________________________
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:[~2021-02-02 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 12:04 [PATCH] drm/amd/pm: Disable GFXOFF when GFX DPM or PG disabled Jinzhou Su
2021-02-02 12:15 ` Huang Rui

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.