aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-06-09 17:46:30 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-06-10 09:32:25 -0400
commitb97aab014c6ba6133df1e26bd20c1ad7f50a5bff (patch)
tree104b846562aa9f11cbd108620104d83a84841a66
parentaaf4ee3c0233893ac9586ede9cdcaa4a77ccb475 (diff)
drm/amdgpu/iceland: don't call smu_init on resume
smu_init allocates buffers and initializes them. It does not touch the hw. There is no need to do it again on resume. It should really be part of sw_init (and smu_fini should be part of sw_fini), but we need the firmware sizes from the other IPs for firmware loading so we have to wait until sw init is done for all other IPs. Reviewed-by: Sonny Jiang <Sonny.Jiang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/iceland_dpm.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_dpm.c b/drivers/gpu/drm/amd/amdgpu/iceland_dpm.c
index 4b773f29167a..208d55f41c7f 100644
--- a/drivers/gpu/drm/amd/amdgpu/iceland_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/iceland_dpm.c
@@ -82,6 +82,10 @@ static int iceland_dpm_hw_init(void *handle)
82 82
83 mutex_lock(&adev->pm.mutex); 83 mutex_lock(&adev->pm.mutex);
84 84
85 /* smu init only needs to be called at startup, not resume.
86 * It should be in sw_init, but requires the fw info gathered
87 * in sw_init from other IP modules.
88 */
85 ret = iceland_smu_init(adev); 89 ret = iceland_smu_init(adev);
86 if (ret) { 90 if (ret) {
87 DRM_ERROR("SMU initialization failed\n"); 91 DRM_ERROR("SMU initialization failed\n");
@@ -108,6 +112,10 @@ static int iceland_dpm_hw_fini(void *handle)
108 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 112 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
109 113
110 mutex_lock(&adev->pm.mutex); 114 mutex_lock(&adev->pm.mutex);
115 /* smu fini only needs to be called at teardown, not suspend.
116 * It should be in sw_fini, but we put it here for symmetry
117 * with smu init.
118 */
111 iceland_smu_fini(adev); 119 iceland_smu_fini(adev);
112 mutex_unlock(&adev->pm.mutex); 120 mutex_unlock(&adev->pm.mutex);
113 return 0; 121 return 0;
@@ -115,20 +123,25 @@ static int iceland_dpm_hw_fini(void *handle)
115 123
116static int iceland_dpm_suspend(void *handle) 124static int iceland_dpm_suspend(void *handle)
117{ 125{
118 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
119
120 iceland_dpm_hw_fini(adev);
121
122 return 0; 126 return 0;
123} 127}
124 128
125static int iceland_dpm_resume(void *handle) 129static int iceland_dpm_resume(void *handle)
126{ 130{
131 int ret;
127 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 132 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
128 133
129 iceland_dpm_hw_init(adev); 134 mutex_lock(&adev->pm.mutex);
130 135
131 return 0; 136 ret = iceland_smu_start(adev);
137 if (ret) {
138 DRM_ERROR("SMU start failed\n");
139 goto fail;
140 }
141
142fail:
143 mutex_unlock(&adev->pm.mutex);
144 return ret;
132} 145}
133 146
134static int iceland_dpm_set_clockgating_state(void *handle, 147static int iceland_dpm_set_clockgating_state(void *handle,