mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
drm/amd: Save and restore all limit types
Vangogh has separate limits for default PPT and fast PPT. Add infrastructure to save both of these limits and restore both of them. Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
56a207c39d
commit
3cd7ceee9a
|
|
@ -508,11 +508,14 @@ static void smu_restore_dpm_user_profile(struct smu_context *smu)
|
|||
/* Enable restore flag */
|
||||
smu->user_dpm_profile.flags |= SMU_DPM_USER_PROFILE_RESTORE;
|
||||
|
||||
/* set the user dpm power limit */
|
||||
if (smu->user_dpm_profile.power_limit) {
|
||||
ret = smu_set_power_limit(smu, SMU_DEFAULT_PPT_LIMIT, smu->current_power_limit);
|
||||
/* set the user dpm power limits */
|
||||
for (int i = SMU_DEFAULT_PPT_LIMIT; i < SMU_LIMIT_TYPE_COUNT; i++) {
|
||||
if (!smu->user_dpm_profile.power_limits[i])
|
||||
continue;
|
||||
ret = smu_set_power_limit(smu, i,
|
||||
smu->user_dpm_profile.power_limits[i]);
|
||||
if (ret)
|
||||
dev_err(smu->adev->dev, "Failed to set power limit value\n");
|
||||
dev_err(smu->adev->dev, "Failed to set %d power limit value\n", i);
|
||||
}
|
||||
|
||||
/* set the user dpm clock configurations */
|
||||
|
|
@ -2979,11 +2982,13 @@ static int smu_set_power_limit(void *handle, uint32_t limit_type, uint32_t limit
|
|||
|
||||
if (smu->ppt_funcs->set_power_limit) {
|
||||
ret = smu->ppt_funcs->set_power_limit(smu, limit_type, limit);
|
||||
if (!ret && !(smu->user_dpm_profile.flags & SMU_DPM_USER_PROFILE_RESTORE))
|
||||
smu->user_dpm_profile.power_limit = limit;
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!(smu->user_dpm_profile.flags & SMU_DPM_USER_PROFILE_RESTORE))
|
||||
smu->user_dpm_profile.power_limits[limit_type] = limit;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smu_print_smuclk_levels(struct smu_context *smu, enum smu_clk_type clk_type, char *buf)
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ enum smu_power_src_type {
|
|||
enum smu_ppt_limit_type {
|
||||
SMU_DEFAULT_PPT_LIMIT = 0,
|
||||
SMU_FAST_PPT_LIMIT,
|
||||
SMU_LIMIT_TYPE_COUNT,
|
||||
};
|
||||
|
||||
enum smu_ppt_limit_level {
|
||||
|
|
@ -231,7 +232,7 @@ enum smu_memory_pool_size {
|
|||
|
||||
struct smu_user_dpm_profile {
|
||||
uint32_t fan_mode;
|
||||
uint32_t power_limit;
|
||||
uint32_t power_limits[SMU_LIMIT_TYPE_COUNT];
|
||||
uint32_t fan_speed_pwm;
|
||||
uint32_t fan_speed_rpm;
|
||||
uint32_t flags;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user