[PATCH] drm/amd/pm: allow the user to force BACO on smu v13.0.0/7

Alex Deucher alexdeucher at gmail.com
Tue Aug 15 16:56:17 UTC 2023


On Tue, Aug 15, 2023 at 5:05 AM Kenneth Feng <kenneth.feng at amd.com> wrote:
>
> allow the user to force BACO on smu v13.0.0/7
>
> Signed-off-by: Kenneth Feng <kenneth.feng at amd.com>

Acked-by: Alex Deucher <alexander.deucher at amd.com>
Would it be better to default to BACO?  It would save more power at
the expense of resume latency.

Alex


> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c       | 2 +-
>  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 3 ++-
>  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 3 ++-
>  3 files changed, 5 insertions(+), 3 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 895cda8e6934..52e9c7611013 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
> @@ -2263,7 +2263,7 @@ int smu_v13_0_baco_set_state(struct smu_context *smu,
>         if (state == SMU_BACO_STATE_ENTER) {
>                 ret = smu_cmn_send_smc_msg_with_param(smu,
>                                                       SMU_MSG_EnterBaco,
> -                                                     smu_baco->maco_support ?
> +                                                     (smu_baco->maco_support && amdgpu_runtime_pm != 1) ?
>                                                       BACO_SEQ_BAMACO : BACO_SEQ_BACO,
>                                                       NULL);
>         } else {
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
> index a5857acee641..12ccc12657d7 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
> @@ -2211,7 +2211,8 @@ static int smu_v13_0_0_baco_enter(struct smu_context *smu)
>
>         if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev))
>                 return smu_v13_0_baco_set_armd3_sequence(smu,
> -                               smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO);
> +                               (smu_baco->maco_support && amdgpu_runtime_pm != 1) ?
> +                                       BACO_SEQ_BAMACO : BACO_SEQ_BACO);
>         else
>                 return smu_v13_0_baco_enter(smu);
>  }
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
> index 93b3e8fa8238..f0bcc7995983 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
> @@ -2139,7 +2139,8 @@ static int smu_v13_0_7_baco_enter(struct smu_context *smu)
>
>         if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev))
>                 return smu_v13_0_baco_set_armd3_sequence(smu,
> -                               smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO);
> +                               (smu_baco->maco_support && amdgpu_runtime_pm != 1) ?
> +                                       BACO_SEQ_BAMACO : BACO_SEQ_BACO);
>         else
>                 return smu_v13_0_baco_enter(smu);
>  }
> --
> 2.34.1
>


More information about the amd-gfx mailing list