]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/pm: enable GPO dynamic control support for SMU13.0.0
authorEvan Quan <evan.quan@amd.com>
Fri, 2 Dec 2022 05:56:35 +0000 (13:56 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Dec 2022 17:16:43 +0000 (12:16 -0500)
To better support UMD pstate profilings, the GPO feature needs
to be switched on/off accordingly.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.0.x
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

index a4e3425b1027c2ab6e8c5a1f3c8957fe2b79d014..4180c71d930f1bd1a2ea8eeb29929e8dc2df4f26 100644 (file)
        __SMU_DUMMY_MAP(GetGfxOffEntryCount),            \
        __SMU_DUMMY_MAP(LogGfxOffResidency),                    \
        __SMU_DUMMY_MAP(SetNumBadMemoryPagesRetired),           \
-       __SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel),
+       __SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel), \
+       __SMU_DUMMY_MAP(AllowGpo),
 
 #undef __SMU_DUMMY_MAP
 #define __SMU_DUMMY_MAP(type)  SMU_MSG_##type
index 865d6358918d27a0a8152836cf2892a6b4e8f4de..ea29ac6a80e6919014345bbee93986f77396239f 100644 (file)
@@ -272,6 +272,9 @@ int smu_v13_0_init_pptable_microcode(struct smu_context *smu);
 
 int smu_v13_0_run_btc(struct smu_context *smu);
 
+int smu_v13_0_gpo_control(struct smu_context *smu,
+                         bool enablement);
+
 int smu_v13_0_deep_sleep_control(struct smu_context *smu,
                                 bool enablement);
 
index f5e90e0a99dfe746843410f431a3d461b91feb1a..e3a80ac987df135ff0101c110a7e6a14ddd74b52 100644 (file)
@@ -2180,6 +2180,21 @@ int smu_v13_0_run_btc(struct smu_context *smu)
        return res;
 }
 
+int smu_v13_0_gpo_control(struct smu_context *smu,
+                         bool enablement)
+{
+       int res;
+
+       res = smu_cmn_send_smc_msg_with_param(smu,
+                                             SMU_MSG_AllowGpo,
+                                             enablement ? 1 : 0,
+                                             NULL);
+       if (res)
+               dev_err(smu->adev->dev, "SetGpoAllow %d failed!\n", enablement);
+
+       return res;
+}
+
 int smu_v13_0_deep_sleep_control(struct smu_context *smu,
                                 bool enablement)
 {
index 21d89c3302f1e6e0dc38f3af5e0c0abf03693309..cc66828c7a846123a46e8f741b26cfa9d14b1e5d 100644 (file)
@@ -144,6 +144,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] =
        MSG_MAP(SetNumBadMemoryPagesRetired,    PPSMC_MSG_SetNumBadMemoryPagesRetired,   0),
        MSG_MAP(SetBadMemoryPagesRetiredFlagsPerChannel,
                            PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel,   0),
+       MSG_MAP(AllowGpo,                       PPSMC_MSG_SetGpoAllow,           0),
 };
 
 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 = {
        .set_df_cstate = smu_v13_0_0_set_df_cstate,
        .send_hbm_bad_pages_num = smu_v13_0_0_smu_send_bad_mem_page_num,
        .send_hbm_bad_channel_flag = smu_v13_0_0_send_bad_mem_channel_flag,
+       .gpo_control = smu_v13_0_gpo_control,
 };
 
 void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu)