Skip to contentSkip to conversation

drm/amd/pm: enable UCLK DS feature for SMU 13.0.0

PATCH In review Evan Quan 2 participants 5 messages Jun 10, 2022 – Jun 13, 2022

Subsystems (3)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/2 drm/amd/pm: enable UCLK DS feature for SMU 13.0.0

The feature is ready with latest PMFW and IFWI.

Change-Id I0b1ea6a32bc092eec4b95118a1442597688ee8d0
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +2 -0
index fda89e309b07..495713e4ebd4 100644
@@ -306,6 +306,8 @@ smu_v13_0_0_get_allowed_feature_mask(struct smu_context *smu,
 
 	*(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_FW_CTF_BIT);
 
+	*(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_DS_UCLK_BIT);
+
 	return 0;
 }
 
Signature · 1 line
2.29.0
author
#1 lore raw

PATCH 2/2 drm/amd/pm: enable MACO support for SMU 13.0.0

Enable BAMACO reset support for SMU 13.0.0.

Change-Id I67696671c216790a0b6d5b84f7d4b430d734ac3c

--
v1->v2:
- maximum code sharing around smu13.0.0 and smu13.0.7

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c    |  3 +-
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c  |  3 ++
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c  | 52 +------------------
 3 files changed, 7 insertions(+), 51 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -1
index fba0b87d01fb..f18f9605e586 100644
@@ -2271,7 +2271,8 @@ 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,
-						      0,
+						      smu_baco->maco_support ?
+						      BACO_SEQ_BAMACO : BACO_SEQ_BACO,
 						      NULL);
 	} else {
 		ret = smu_cmn_send_smc_msg(smu,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +3 -0
index 495713e4ebd4..6fb2b072a730 100644
@@ -325,6 +325,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
 	    powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
 		smu_baco->platform_support = true;
 
+	if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
+		smu_baco->maco_support = true;
+
 	table_context->thermal_controller_type =
 		powerplay_table->thermal_controller_type;
 
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +2 -50

64 lines not on this page · raw message

Signature · 1 line
2.29.0
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/amd/pm: enable MACO support for SMU 13.0.0

Quoted 33 lines · Evan Quan

Enable BAMACO reset support for SMU 13.0.0.

Change-Id I67696671c216790a0b6d5b84f7d4b430d734ac3c

--
v1->v2:
- maximum code sharing around smu13.0.0 and smu13.0.7

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c    |  3 +-
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c  |  3 ++
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c  | 52 +------------------
 3 files changed, 7 insertions(+), 51 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -1
index fba0b87d01fb..f18f9605e586 100644
@@ -2271,7 +2271,8 @@ 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,
-                                                     0,
+                                                     smu_baco->maco_support ?
+                                                     BACO_SEQ_BAMACO : BACO_SEQ_BACO,
                                                      NULL);
        } else {
                ret = smu_cmn_send_smc_msg(smu,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +0 -0
index 495713e4ebd4..6fb2b072a730 100644

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu) · line 326

Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +0 -0
@@ -325,6 +325,9 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
            powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
                smu_baco->platform_support = true;

Not really related to this patch, but is SMU_13_0_0_PP_PLATFORM_CAP_MACO really used to determine with the platform supports BACO in general? Is this right? I don't see how we would ever end up using plain BACO.

This patch is:

Quoted 80 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +3 -0
+       if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
+               smu_baco->maco_support = true;
+
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
 
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +2 -51
index 693bb6bda350..96ae5ff8e19e 100644
@@ -1551,54 +1551,6 @@ static int smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *inp
        return ret;
 }
 
-static int smu_v13_0_7_baco_set_state(struct smu_context *smu,
-                            enum smu_baco_state state)
-{
-       struct smu_baco_context *smu_baco = &smu->smu_baco;
-       struct amdgpu_device *adev = smu->adev;
-       bool is_maco_support = smu_baco->maco_support;
-       int ret;
-
-       if (smu_v13_0_baco_get_state(smu) == state)
-               return 0;
-
-       if (state == SMU_BACO_STATE_ENTER) {
-               ret = smu_cmn_send_smc_msg_with_param(smu,
-                                                     SMU_MSG_EnterBaco,
-                                                     (is_maco_support ? 2 : 0),
-                                                     NULL);
-       } else {
-               ret = smu_cmn_send_smc_msg(smu,
-                                          SMU_MSG_ExitBaco,
-                                          NULL);
-               if (ret)
-                       return ret;
-
-               /* clear vbios scratch 6 and 7 for coming asic reinit */
-               WREG32(adev->bios_scratch_reg_offset + 6, 0);
-               WREG32(adev->bios_scratch_reg_offset + 7, 0);
-       }
-
-       if (!ret)
-               smu_baco->state = state;
-
-       return ret;
-}
-
-static int smu_v13_0_7_baco_enter(struct smu_context *smu)
-{
-       int ret = 0;
-
-       ret = smu_v13_0_7_baco_set_state(smu,
-                                      SMU_BACO_STATE_ENTER);
-       if (ret)
-               return ret;
-
-       msleep(10);
-
-       return ret;
-}
-
 static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
        .get_allowed_feature_mask = smu_v13_0_7_get_allowed_feature_mask,
        .set_default_dpm_table = smu_v13_0_7_set_default_dpm_table,
@@ -1653,8 +1605,8 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
        .set_pp_feature_mask = smu_cmn_set_pp_feature_mask,
        .baco_is_support = smu_v13_0_baco_is_support,
        .baco_get_state = smu_v13_0_baco_get_state,
-       .baco_set_state = smu_v13_0_7_baco_set_state,
-       .baco_enter = smu_v13_0_7_baco_enter,
+       .baco_set_state = smu_v13_0_baco_set_state,
+       .baco_enter = smu_v13_0_baco_enter,
        .baco_exit = smu_v13_0_baco_exit,
        .set_mp1_state = smu_cmn_set_mp1_state,
 };
--

2.29.0

author
#3 lore raw

RE: [PATCH 2/2] drm/amd/pm: enable MACO support for SMU 13.0.0

[AMD Official Use Only - General]

Quoted 49 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Saturday, June 11, 2022 12:08 AM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Gao, Likun <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 2/2] drm/amd/pm: enable MACO support for SMU 13.0.0

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_baco_set_state(struct

Quoted 20 lines · Evan Quan

Enable BAMACO reset support for SMU 13.0.0.

Change-Id I67696671c216790a0b6d5b84f7d4b430d734ac3c

--
v1->v2:
- maximum code sharing around smu13.0.0 and smu13.0.7

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c    |  3 +-
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c  |  3 ++
.../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c  | 52 +------------------
 3 files changed, 7 insertions(+), 51 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0 -0
index fba0b87d01fb..f18f9605e586 100644
@@ -2271,7 +2271,8 @@ int smu_v13_0_baco_set_state(struct

smu_context *smu,

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c static int

Quoted 16 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +3 -1
        if (state == SMU_BACO_STATE_ENTER) {
                ret = smu_cmn_send_smc_msg_with_param(smu,
                                                      SMU_MSG_EnterBaco,
-                                                     0,
+                                                     smu_baco->maco_support ?
+                                                     BACO_SEQ_BAMACO
+ : BACO_SEQ_BACO,
                                                      NULL);
        } else {
                ret = smu_cmn_send_smc_msg(smu, 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 495713e4ebd4..6fb2b072a730 100644

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +0 -0
@@ -325,6 +325,9 @@ static int

smu_v13_0_0_check_powerplay_table(struct smu_context *smu)

Quoted 8 lines

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c static int · line 325

Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +0 -0
            powerplay_table->platform_caps &

SMU_13_0_0_PP_PLATFORM_CAP_MACO)

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu) · line 326

Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +0 -0
                smu_baco->platform_support = true;

Not really related to this patch, but is SMU_13_0_0_PP_PLATFORM_CAP_MACO really used to determine with the platform supports BACO in general? Is this right? I don't see how we would ever end up using plain BACO.

[Quan, Evan] Yes, I think we can drop the SMU_13_0_0_PP_PLATFORM_CAP_MACO check for BACO support. They should not have direct dependence.

BR
Evan

Quoted 89 lines

This patch is:

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c static int · line 327

Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +1 -0
+       if (powerplay_table->platform_caps &

SMU_13_0_0_PP_PLATFORM_CAP_MACO)

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c static int

Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +2 -0
+               smu_baco->maco_support = true;
+
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
 
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +0 -0
index 693bb6bda350..96ae5ff8e19e 100644
@@ -1551,54 +1551,6 @@ static int

smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *inp

Quoted 42 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +0 -39
        return ret;
 }
 
-static int smu_v13_0_7_baco_set_state(struct smu_context *smu,
-                            enum smu_baco_state state)
-{
-       struct smu_baco_context *smu_baco = &smu->smu_baco;
-       struct amdgpu_device *adev = smu->adev;
-       bool is_maco_support = smu_baco->maco_support;
-       int ret;
-
-       if (smu_v13_0_baco_get_state(smu) == state)
-               return 0;
-
-       if (state == SMU_BACO_STATE_ENTER) {
-               ret = smu_cmn_send_smc_msg_with_param(smu,
-                                                     SMU_MSG_EnterBaco,
-                                                     (is_maco_support ? 2 : 0),
-                                                     NULL);
-       } else {
-               ret = smu_cmn_send_smc_msg(smu,
-                                          SMU_MSG_ExitBaco,
-                                          NULL);
-               if (ret)
-                       return ret;
-
-               /* clear vbios scratch 6 and 7 for coming asic reinit */
-               WREG32(adev->bios_scratch_reg_offset + 6, 0);
-               WREG32(adev->bios_scratch_reg_offset + 7, 0);
-       }
-
-       if (!ret)
-               smu_baco->state = state;
-
-       return ret;
-}
-
-static int smu_v13_0_7_baco_enter(struct smu_context *smu) -{
-       int ret = 0;
-
-       ret = smu_v13_0_7_baco_set_state(smu,
-                                      SMU_BACO_STATE_ENTER);

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c static int smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *inp

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +0 -8
-       if (ret)
-               return ret;
-
-       msleep(10);
-
-       return ret;
-}
-
 static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
        .get_allowed_feature_mask =

smu_v13_0_7_get_allowed_feature_mask,

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c static const struct pptable_funcs

Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +0 -0
        .set_default_dpm_table = smu_v13_0_7_set_default_dpm_table,
@@ -1653,8 +1605,8 @@ static const struct pptable_funcs

smu_v13_0_7_ppt_funcs = {

Quoted 12 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +2 -3
        .set_pp_feature_mask = smu_cmn_set_pp_feature_mask,
        .baco_is_support = smu_v13_0_baco_is_support,
        .baco_get_state = smu_v13_0_baco_get_state,
-       .baco_set_state = smu_v13_0_7_baco_set_state,
-       .baco_enter = smu_v13_0_7_baco_enter,
+       .baco_set_state = smu_v13_0_baco_set_state,
+       .baco_enter = smu_v13_0_baco_enter,
        .baco_exit = smu_v13_0_baco_exit,
        .set_mp1_state = smu_cmn_set_mp1_state,  };
--

2.29.0

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

The feature is ready with latest PMFW and IFWI.

Quoted 21 lines

Change-Id: I0b1ea6a32bc092eec4b95118a1442597688ee8d0

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +2 -1
index fda89e309b07..495713e4ebd4 100644
@@ -306,6 +306,8 @@ smu_v13_0_0_get_allowed_feature_mask(struct smu_context *smu,
 
        *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_FW_CTF_BIT);
 
+       *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_DS_UCLK_BIT);
+
        return 0;
 }
 
--

2.29.0