Skip to content

Commit df7c013

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/pm: enable runpm support over BACO for SMU13.0.7
Enable SMU13.0.7 runpm support. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.0.x
1 parent 8652da4 commit df7c013

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT] =
122122
MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0),
123123
MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0),
124124
MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0),
125+
MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
125126
};
126127

127128
static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = {
@@ -1578,6 +1579,31 @@ static int smu_v13_0_7_set_mp1_state(struct smu_context *smu,
15781579
return ret;
15791580
}
15801581

1582+
static int smu_v13_0_7_baco_enter(struct smu_context *smu)
1583+
{
1584+
struct smu_baco_context *smu_baco = &smu->smu_baco;
1585+
struct amdgpu_device *adev = smu->adev;
1586+
1587+
if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev))
1588+
return smu_v13_0_baco_set_armd3_sequence(smu,
1589+
smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO);
1590+
else
1591+
return smu_v13_0_baco_enter(smu);
1592+
}
1593+
1594+
static int smu_v13_0_7_baco_exit(struct smu_context *smu)
1595+
{
1596+
struct amdgpu_device *adev = smu->adev;
1597+
1598+
if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) {
1599+
/* Wait for PMFW handling for the Dstate change */
1600+
usleep_range(10000, 11000);
1601+
return smu_v13_0_baco_set_armd3_sequence(smu, BACO_SEQ_ULPS);
1602+
} else {
1603+
return smu_v13_0_baco_exit(smu);
1604+
}
1605+
}
1606+
15811607
static bool smu_v13_0_7_is_mode1_reset_supported(struct smu_context *smu)
15821608
{
15831609
struct amdgpu_device *adev = smu->adev;
@@ -1655,8 +1681,8 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
16551681
.baco_is_support = smu_v13_0_baco_is_support,
16561682
.baco_get_state = smu_v13_0_baco_get_state,
16571683
.baco_set_state = smu_v13_0_baco_set_state,
1658-
.baco_enter = smu_v13_0_baco_enter,
1659-
.baco_exit = smu_v13_0_baco_exit,
1684+
.baco_enter = smu_v13_0_7_baco_enter,
1685+
.baco_exit = smu_v13_0_7_baco_exit,
16601686
.mode1_reset_is_support = smu_v13_0_7_is_mode1_reset_supported,
16611687
.mode1_reset = smu_v13_0_mode1_reset,
16621688
.set_mp1_state = smu_v13_0_7_set_mp1_state,

0 commit comments

Comments
 (0)