drm/amd/pm: correct the baco state setting for ArmD3 scenario
Subsystems (3)
PATCH 1/2 drm/amd/pm: correct the baco state setting for ArmD3 scenario
The check for baco support relies on the correct baco state.
--- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +17 -4
@@ -2217,10 +2217,23 @@ int smu_v13_0_gfx_ulv_control(struct smu_context *smu,int smu_v13_0_baco_set_armd3_sequence (struct smu_context *smu,enum smu_baco_seq baco_seq) { -return smu_cmn_send_smc_msg_with_param (smu, - SMU_MSG_ArmD3, - baco_seq, -NULL ); +struct smu_baco_context *smu_baco = &smu->smu_baco; +int ret; + + ret =smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_ArmD3, + baco_seq, +NULL ); +if (ret) +return ret; + +if ((baco_seq ==BACO_SEQ_BAMACO ) || + (baco_seq ==BACO_SEQ_BACO )) + smu_baco->state =SMU_BACO_STATE_ENTER ; +else + smu_baco->state =SMU_BACO_STATE_EXIT ; + +return 0 ; }bool smu_v13_0_baco_is_support (struct smu_context *smu)
Signature · 1 line
2.34.1
PATCH 2/2 drm/amd/pm: no pptable resetup on runpm exiting
It is assumed the pptable used before runpm is same as the one used afterwards. Thus, we can reuse the stored copy and do not need to resetup the pptable again.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +11 -4
@@ -1220,10 +1220,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)return ret; } - ret =smu_setup_pptable (smu); -if (ret) { -dev_err (adev->dev,"Failed to setup pptable!\n" ); -return ret; +/* +* It is assumed the pptable used before runpm is same as +* the one used afterwards. Thus, we can reuse the stored +* copy and do not need to resetup the pptable again. +*/ +if (!adev->in_runpm) { + ret =smu_setup_pptable (smu); +if (ret) { +dev_err (adev->dev,"Failed to setup pptable!\n" ); +return ret; + } }/* smu_dump_pptable(smu); */
Signature · 1 line
2.34.1
RE: [PATCH 2/2] drm/amd/pm: no pptable resetup on runpm exiting
Series is Reviewed-by: Feifei Xu <Feifei [email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Tuesday, February 21, 2023 3:51 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH 2/2] drm/amd/pm: no pptable resetup on runpm exiting
It is assumed the pptable used before runpm is same as the one used afterwards. Thus, we can reuse the stored copy and do not need to resetup the pptable again.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +11 -4
@@ -1220,10 +1220,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)return ret; } - ret =smu_setup_pptable (smu); -if (ret) { -dev_err (adev->dev,"Failed to setup pptable!\n" ); -return ret; +/* +* It is assumed the pptable used before runpm is same as +* the one used afterwards. Thus, we can reuse the stored +* copy and do not need to resetup the pptable again. +*/ +if (!adev->in_runpm) { + ret =smu_setup_pptable (smu); +if (ret) { +dev_err (adev->dev,"Failed to setup pptable!\n" ); +return ret; + } }/* smu_dump_pptable(smu); */
--
2.34.1