summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2015-12-29 05:25:19 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-01-08 23:39:24 +0300
commite0b71a7eff644ca256aee6478bf220ba0a835bed (patch)
tree62ac7e9ce18e47c2bff687b826f06a01668fb771 /drivers/gpu/drm/amd/powerplay/amd_powerplay.c
parenta969e163a4ac1b0cfa2dc7ab890aaa9ab092951c (diff)
downloadlinux-e0b71a7eff644ca256aee6478bf220ba0a835bed.tar.xz
drm/amd/powerplay: Reload and initialize the smc firmware on powerplay resume.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amd_powerplay.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 2764bd327034..8f5d5edcf193 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -203,13 +203,29 @@ static int pp_resume(void *handle)
struct pp_instance *pp_handle;
struct pp_eventmgr *eventmgr;
struct pem_event_data event_data = { {0} };
+ struct pp_smumgr *smumgr;
+ int ret;
if (handle == NULL)
return -EINVAL;
pp_handle = (struct pp_instance *)handle;
+ smumgr = pp_handle->smu_mgr;
+
+ if (smumgr == NULL || smumgr->smumgr_funcs == NULL ||
+ smumgr->smumgr_funcs->start_smu == NULL)
+ return -EINVAL;
+
+ ret = smumgr->smumgr_funcs->start_smu(smumgr);
+ if (ret) {
+ printk(KERN_ERR "[ powerplay ] smc start failed\n");
+ smumgr->smumgr_funcs->smu_fini(smumgr);
+ return ret;
+ }
+
eventmgr = pp_handle->eventmgr;
pem_handle_event(eventmgr, AMD_PP_EVENT_RESUME, &event_data);
+
return 0;
}
@@ -624,6 +640,7 @@ int amd_powerplay_display_configuration_change(void *handle, const void *input)
hwmgr = ((struct pp_instance *)handle)->hwmgr;
phm_store_dal_configuration_data(hwmgr, display_config);
+
return 0;
}