]> www.infradead.org Git - linux.git/commitdiff
drm/amd/pm: update deep sleep status on smu v14.0.2/3
authorKenneth Feng <kenneth.feng@amd.com>
Thu, 17 Oct 2024 08:32:22 +0000 (16:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 22 Oct 2024 22:10:17 +0000 (18:10 -0400)
disable deep sleep during the compute workload for the
potential performance loss on smu v14.0.2/3

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7d9af459f43436452103babb960fd0ecb13c714e)

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c

index 9ae7945e1d7c9b4f12d1daa99606f4f720de2088..e83ea2bc7f9c4ecf6e0e925572f13b045eb71564 100644 (file)
@@ -1799,7 +1799,7 @@ static int smu_v14_0_2_set_power_profile_mode(struct smu_context *smu,
        DpmActivityMonitorCoeffInt_t *activity_monitor =
                &(activity_monitor_external.DpmActivityMonitorCoeffInt);
        int workload_type, ret = 0;
-
+       uint32_t current_profile_mode = smu->power_profile_mode;
        smu->power_profile_mode = input[size];
 
        if (smu->power_profile_mode >= PP_SMC_POWER_PROFILE_COUNT) {
@@ -1857,6 +1857,11 @@ static int smu_v14_0_2_set_power_profile_mode(struct smu_context *smu,
                }
        }
 
+       if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_COMPUTE)
+               smu_v14_0_deep_sleep_control(smu, false);
+       else if (current_profile_mode == PP_SMC_POWER_PROFILE_COMPUTE)
+               smu_v14_0_deep_sleep_control(smu, true);
+
        /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
        workload_type = smu_cmn_to_asic_specific_index(smu,
                                                       CMN2ASIC_MAPPING_WORKLOAD,