summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-04-27 15:48:56 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-04-28 17:33:16 -0400
commit8b9242eddd51f17b8306d6c96172fd68ef1106c6 (patch)
treee5af18519679d9f773cd1cf6548bc9f2d0c23de0 /drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
parentf8dc9476d9fe25b982e642a733967d7b5fbe5ae3 (diff)
downloadop-kernel-dev-8b9242eddd51f17b8306d6c96172fd68ef1106c6.zip
op-kernel-dev-8b9242eddd51f17b8306d6c96172fd68ef1106c6.tar.gz
drm/amd/powerplay: implement stop dpm task for vega10.
Add functions to disable dpm for S3/S4. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
index f1e244c..692f752 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
@@ -113,6 +113,29 @@ int vega10_enable_power_containment(struct pp_hwmgr *hwmgr)
return result;
}
+int vega10_disable_power_containment(struct pp_hwmgr *hwmgr)
+{
+ struct vega10_hwmgr *data =
+ (struct vega10_hwmgr *)(hwmgr->backend);
+
+ if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
+ PHM_PlatformCaps_PowerContainment)) {
+ if (data->smu_features[GNLD_PPT].supported)
+ PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr->smumgr,
+ false, data->smu_features[GNLD_PPT].smu_feature_bitmap),
+ "Attempt to disable PPT feature Failed!",
+ data->smu_features[GNLD_PPT].supported = false);
+
+ if (data->smu_features[GNLD_TDC].supported)
+ PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr->smumgr,
+ false, data->smu_features[GNLD_TDC].smu_feature_bitmap),
+ "Attempt to disable PPT feature Failed!",
+ data->smu_features[GNLD_TDC].supported = false);
+ }
+
+ return 0;
+}
+
static int vega10_set_overdrive_target_percentage(struct pp_hwmgr *hwmgr,
uint32_t adjust_percent)
{
OpenPOWER on IntegriCloud