[PATCH 1/2] drm/amd/pm: correct the baco state setting for ArmD3 scenario

Evan Quan evan.quan at amd.com
Tue Feb 21 07:51:22 UTC 2023


The check for baco support relies on the correct baco state.

Signed-off-by: Evan Quan <evan.quan at amd.com>
Change-Id: I9dd15958c213eb83abdb8b7d858eff0d2d364b4e
---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c    | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 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 f4927ada5c07..1984b01514bd 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
@@ -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)
-- 
2.34.1



More information about the amd-gfx mailing list