Skip to content

Commit 1794f6a

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/pm: enable GPO dynamic control support for SMU13.0.0
To better support UMD pstate profilings, the GPO feature needs to be switched on/off accordingly. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.0.x
1 parent 4772222 commit 1794f6a

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@
241241
__SMU_DUMMY_MAP(GetGfxOffEntryCount), \
242242
__SMU_DUMMY_MAP(LogGfxOffResidency), \
243243
__SMU_DUMMY_MAP(SetNumBadMemoryPagesRetired), \
244-
__SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel),
244+
__SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel), \
245+
__SMU_DUMMY_MAP(AllowGpo),
245246

246247
#undef __SMU_DUMMY_MAP
247248
#define __SMU_DUMMY_MAP(type) SMU_MSG_##type

drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ int smu_v13_0_init_pptable_microcode(struct smu_context *smu);
272272

273273
int smu_v13_0_run_btc(struct smu_context *smu);
274274

275+
int smu_v13_0_gpo_control(struct smu_context *smu,
276+
bool enablement);
277+
275278
int smu_v13_0_deep_sleep_control(struct smu_context *smu,
276279
bool enablement);
277280

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,6 +2180,21 @@ int smu_v13_0_run_btc(struct smu_context *smu)
21802180
return res;
21812181
}
21822182

2183+
int smu_v13_0_gpo_control(struct smu_context *smu,
2184+
bool enablement)
2185+
{
2186+
int res;
2187+
2188+
res = smu_cmn_send_smc_msg_with_param(smu,
2189+
SMU_MSG_AllowGpo,
2190+
enablement ? 1 : 0,
2191+
NULL);
2192+
if (res)
2193+
dev_err(smu->adev->dev, "SetGpoAllow %d failed!\n", enablement);
2194+
2195+
return res;
2196+
}
2197+
21832198
int smu_v13_0_deep_sleep_control(struct smu_context *smu,
21842199
bool enablement)
21852200
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] =
144144
MSG_MAP(SetNumBadMemoryPagesRetired, PPSMC_MSG_SetNumBadMemoryPagesRetired, 0),
145145
MSG_MAP(SetBadMemoryPagesRetiredFlagsPerChannel,
146146
PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel, 0),
147+
MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0),
147148
};
148149

149150
static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = {
@@ -1949,6 +1950,7 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
19491950
.set_df_cstate = smu_v13_0_0_set_df_cstate,
19501951
.send_hbm_bad_pages_num = smu_v13_0_0_smu_send_bad_mem_page_num,
19511952
.send_hbm_bad_channel_flag = smu_v13_0_0_send_bad_mem_channel_flag,
1953+
.gpo_control = smu_v13_0_gpo_control,
19521954
};
19531955

19541956
void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu)

0 commit comments

Comments
 (0)