diff options
author | Christian König <christian.koenig@amd.com> | 2015-05-07 09:19:25 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-05-07 11:00:18 -0400 |
commit | 12e49feadff6d7b7ebbe852b36943a71524d8d34 (patch) | |
tree | 0b7fc8935f3d35ee26654c19f2c296d4a1e7b067 /drivers/gpu/drm/radeon | |
parent | d52cdfa4a0c6406bbfb33206341eaf1fb1555994 (diff) |
drm/radeon: stop trying to suspend UVD sessions
Saving the current UVD state on suspend and restoring it on resume
just doesn't work reliable. Just close cleanup all sessions on suspend.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_uvd.c | 39 |
2 files changed, 19 insertions, 21 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index d2abe481954f..46eb0fa75a61 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -1673,7 +1673,6 @@ struct radeon_uvd { | |||
1673 | struct radeon_bo *vcpu_bo; | 1673 | struct radeon_bo *vcpu_bo; |
1674 | void *cpu_addr; | 1674 | void *cpu_addr; |
1675 | uint64_t gpu_addr; | 1675 | uint64_t gpu_addr; |
1676 | void *saved_bo; | ||
1677 | atomic_t handles[RADEON_MAX_UVD_HANDLES]; | 1676 | atomic_t handles[RADEON_MAX_UVD_HANDLES]; |
1678 | struct drm_file *filp[RADEON_MAX_UVD_HANDLES]; | 1677 | struct drm_file *filp[RADEON_MAX_UVD_HANDLES]; |
1679 | unsigned img_size[RADEON_MAX_UVD_HANDLES]; | 1678 | unsigned img_size[RADEON_MAX_UVD_HANDLES]; |
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index cd630287cf0a..6edcb5485092 100644 --- a/drivers/gpu/drm/radeon/radeon_uvd.c +++ b/drivers/gpu/drm/radeon/radeon_uvd.c | |||
@@ -204,28 +204,32 @@ void radeon_uvd_fini(struct radeon_device *rdev) | |||
204 | 204 | ||
205 | int radeon_uvd_suspend(struct radeon_device *rdev) | 205 | int radeon_uvd_suspend(struct radeon_device *rdev) |
206 | { | 206 | { |
207 | unsigned size; | 207 | int i, r; |
208 | void *ptr; | ||
209 | int i; | ||
210 | 208 | ||
211 | if (rdev->uvd.vcpu_bo == NULL) | 209 | if (rdev->uvd.vcpu_bo == NULL) |
212 | return 0; | 210 | return 0; |
213 | 211 | ||
214 | for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) | 212 | for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) { |
215 | if (atomic_read(&rdev->uvd.handles[i])) | 213 | uint32_t handle = atomic_read(&rdev->uvd.handles[i]); |
216 | break; | 214 | if (handle != 0) { |
215 | struct radeon_fence *fence; | ||
217 | 216 | ||
218 | if (i == RADEON_MAX_UVD_HANDLES) | 217 | radeon_uvd_note_usage(rdev); |
219 | return 0; | ||
220 | 218 | ||
221 | size = radeon_bo_size(rdev->uvd.vcpu_bo); | 219 | r = radeon_uvd_get_destroy_msg(rdev, |
222 | size -= rdev->uvd_fw->size; | 220 | R600_RING_TYPE_UVD_INDEX, handle, &fence); |
221 | if (r) { | ||
222 | DRM_ERROR("Error destroying UVD (%d)!\n", r); | ||
223 | continue; | ||
224 | } | ||
223 | 225 | ||
224 | ptr = rdev->uvd.cpu_addr; | 226 | radeon_fence_wait(fence, false); |
225 | ptr += rdev->uvd_fw->size; | 227 | radeon_fence_unref(&fence); |
226 | 228 | ||
227 | rdev->uvd.saved_bo = kmalloc(size, GFP_KERNEL); | 229 | rdev->uvd.filp[i] = NULL; |
228 | memcpy(rdev->uvd.saved_bo, ptr, size); | 230 | atomic_set(&rdev->uvd.handles[i], 0); |
231 | } | ||
232 | } | ||
229 | 233 | ||
230 | return 0; | 234 | return 0; |
231 | } | 235 | } |
@@ -246,12 +250,7 @@ int radeon_uvd_resume(struct radeon_device *rdev) | |||
246 | ptr = rdev->uvd.cpu_addr; | 250 | ptr = rdev->uvd.cpu_addr; |
247 | ptr += rdev->uvd_fw->size; | 251 | ptr += rdev->uvd_fw->size; |
248 | 252 | ||
249 | if (rdev->uvd.saved_bo != NULL) { | 253 | memset(ptr, 0, size); |
250 | memcpy(ptr, rdev->uvd.saved_bo, size); | ||
251 | kfree(rdev->uvd.saved_bo); | ||
252 | rdev->uvd.saved_bo = NULL; | ||
253 | } else | ||
254 | memset(ptr, 0, size); | ||
255 | 254 | ||
256 | return 0; | 255 | return 0; |
257 | } | 256 | } |