Commit 12e49fea authored by Christian König's avatar Christian König Committed by Alex Deucher

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: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d52cdfa4
...@@ -1673,7 +1673,6 @@ struct radeon_uvd { ...@@ -1673,7 +1673,6 @@ struct radeon_uvd {
struct radeon_bo *vcpu_bo; struct radeon_bo *vcpu_bo;
void *cpu_addr; void *cpu_addr;
uint64_t gpu_addr; uint64_t gpu_addr;
void *saved_bo;
atomic_t handles[RADEON_MAX_UVD_HANDLES]; atomic_t handles[RADEON_MAX_UVD_HANDLES];
struct drm_file *filp[RADEON_MAX_UVD_HANDLES]; struct drm_file *filp[RADEON_MAX_UVD_HANDLES];
unsigned img_size[RADEON_MAX_UVD_HANDLES]; unsigned img_size[RADEON_MAX_UVD_HANDLES];
......
...@@ -204,28 +204,32 @@ void radeon_uvd_fini(struct radeon_device *rdev) ...@@ -204,28 +204,32 @@ void radeon_uvd_fini(struct radeon_device *rdev)
int radeon_uvd_suspend(struct radeon_device *rdev) int radeon_uvd_suspend(struct radeon_device *rdev)
{ {
unsigned size; int i, r;
void *ptr;
int i;
if (rdev->uvd.vcpu_bo == NULL) if (rdev->uvd.vcpu_bo == NULL)
return 0; return 0;
for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
if (atomic_read(&rdev->uvd.handles[i])) uint32_t handle = atomic_read(&rdev->uvd.handles[i]);
break; if (handle != 0) {
struct radeon_fence *fence;
if (i == RADEON_MAX_UVD_HANDLES) radeon_uvd_note_usage(rdev);
return 0;
size = radeon_bo_size(rdev->uvd.vcpu_bo); r = radeon_uvd_get_destroy_msg(rdev,
size -= rdev->uvd_fw->size; R600_RING_TYPE_UVD_INDEX, handle, &fence);
if (r) {
DRM_ERROR("Error destroying UVD (%d)!\n", r);
continue;
}
ptr = rdev->uvd.cpu_addr; radeon_fence_wait(fence, false);
ptr += rdev->uvd_fw->size; radeon_fence_unref(&fence);
rdev->uvd.saved_bo = kmalloc(size, GFP_KERNEL); rdev->uvd.filp[i] = NULL;
memcpy(rdev->uvd.saved_bo, ptr, size); atomic_set(&rdev->uvd.handles[i], 0);
}
}
return 0; return 0;
} }
...@@ -246,12 +250,7 @@ int radeon_uvd_resume(struct radeon_device *rdev) ...@@ -246,12 +250,7 @@ int radeon_uvd_resume(struct radeon_device *rdev)
ptr = rdev->uvd.cpu_addr; ptr = rdev->uvd.cpu_addr;
ptr += rdev->uvd_fw->size; ptr += rdev->uvd_fw->size;
if (rdev->uvd.saved_bo != NULL) { memset(ptr, 0, size);
memcpy(ptr, rdev->uvd.saved_bo, size);
kfree(rdev->uvd.saved_bo);
rdev->uvd.saved_bo = NULL;
} else
memset(ptr, 0, size);
return 0; return 0;
} }
......
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