Commit f0d51d20 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/pm: disable/enable deep sleep features on UMD pstate enter/exit

Add deep sleep disablement/enablement on UMD pstate entering/exiting.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e988026f
...@@ -597,6 +597,7 @@ struct pptable_funcs { ...@@ -597,6 +597,7 @@ struct pptable_funcs {
ssize_t (*get_gpu_metrics)(struct smu_context *smu, void **table); ssize_t (*get_gpu_metrics)(struct smu_context *smu, void **table);
int (*enable_mgpu_fan_boost)(struct smu_context *smu); int (*enable_mgpu_fan_boost)(struct smu_context *smu);
int (*gfx_ulv_control)(struct smu_context *smu, bool enablement); int (*gfx_ulv_control)(struct smu_context *smu, bool enablement);
int (*deep_sleep_control)(struct smu_context *smu, bool enablement);
}; };
typedef enum { typedef enum {
......
...@@ -1441,6 +1441,7 @@ static int smu_enable_umd_pstate(void *handle, ...@@ -1441,6 +1441,7 @@ static int smu_enable_umd_pstate(void *handle,
AMD_IP_BLOCK_TYPE_GFX, AMD_IP_BLOCK_TYPE_GFX,
AMD_CG_STATE_UNGATE); AMD_CG_STATE_UNGATE);
smu_gfx_ulv_control(smu, false); smu_gfx_ulv_control(smu, false);
smu_deep_sleep_control(smu, false);
} }
} else { } else {
/* exit umd pstate, restore level, enable gfx cg*/ /* exit umd pstate, restore level, enable gfx cg*/
...@@ -1448,6 +1449,7 @@ static int smu_enable_umd_pstate(void *handle, ...@@ -1448,6 +1449,7 @@ static int smu_enable_umd_pstate(void *handle,
if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT) if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT)
*level = smu_dpm_ctx->saved_dpm_level; *level = smu_dpm_ctx->saved_dpm_level;
smu_dpm_ctx->enable_umd_pstate = false; smu_dpm_ctx->enable_umd_pstate = false;
smu_deep_sleep_control(smu, true);
smu_gfx_ulv_control(smu, true); smu_gfx_ulv_control(smu, true);
amdgpu_device_ip_set_clockgating_state(smu->adev, amdgpu_device_ip_set_clockgating_state(smu->adev,
AMD_IP_BLOCK_TYPE_GFX, AMD_IP_BLOCK_TYPE_GFX,
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
#define smu_get_pp_feature_mask(smu, buf) smu_ppt_funcs(get_pp_feature_mask, 0, smu, buf) #define smu_get_pp_feature_mask(smu, buf) smu_ppt_funcs(get_pp_feature_mask, 0, smu, buf)
#define smu_set_pp_feature_mask(smu, new_mask) smu_ppt_funcs(set_pp_feature_mask, 0, smu, new_mask) #define smu_set_pp_feature_mask(smu, new_mask) smu_ppt_funcs(set_pp_feature_mask, 0, smu, new_mask)
#define smu_gfx_ulv_control(smu, enablement) smu_ppt_funcs(gfx_ulv_control, 0, smu, enablement) #define smu_gfx_ulv_control(smu, enablement) smu_ppt_funcs(gfx_ulv_control, 0, smu, enablement)
#define smu_deep_sleep_control(smu, enablement) smu_ppt_funcs(deep_sleep_control, 0, smu, enablement)
#endif #endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment