Skip to contentSkip to conversation

drm/amd/pm/smu13: BACO is supported when it's in BACO state

PATCH In review Guchun Chen 3 participants 3 messages Jan 10, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/pm/smu13: BACO is supported when it's in BACO state

This leverages the logc in smu11. No need to talk to SMU to check BACO enablement as it's in BACO state already.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +4 -0
index ccaedfcf977e..78945e79dbee 100644
@@ -2243,6 +2243,10 @@ bool smu_v13_0_baco_is_support(struct smu_context *smu)
 	    !smu_baco->platform_support)
 		return false;
 
+	/* return true if ASIC is in BACO state already */
+	if (smu_v13_0_baco_get_state(smu) == SMU_BACO_STATE_ENTER)
+		return true;
+
 	if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT) &&
 	    !smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT))
 		return false;
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

It makes sense.

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Guchun Chen
Sent: Tuesday, January 10, 2023 11:38 AM
To: [email protected]; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amd/pm/smu13: BACO is supported when it's in BACO state

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

This leverages the logc in smu11. No need to talk to SMU to check BACO enablement as it's in BACO state already.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +4 -0
index ccaedfcf977e..78945e79dbee 100644
@@ -2243,6 +2243,10 @@ bool smu_v13_0_baco_is_support(struct smu_context *smu)
            !smu_baco->platform_support)
                return false;
 
+       /* return true if ASIC is in BACO state already */
+       if (smu_v13_0_baco_get_state(smu) == SMU_BACO_STATE_ENTER)
+               return true;
+
        if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT) &&
            !smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT))
                return false;

--
2.25.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Guchun Chen
Quoted 4 lines · Guchun Chen

This leverages the logc in smu11. No need to talk to SMU to check BACO enablement as it's in BACO state already.

Thanks,
Lijo

Quoted 19 lines
---
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +4 -0
index ccaedfcf977e..78945e79dbee 100644
@@ -2243,6 +2243,10 @@ bool smu_v13_0_baco_is_support(struct smu_context *smu)
  	    !smu_baco->platform_support)
  		return false;
 
+	/* return true if ASIC is in BACO state already */
+	if (smu_v13_0_baco_get_state(smu) == SMU_BACO_STATE_ENTER)
+		return true;
+
  	if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT) &&
  	    !smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT))
  		return false;