Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit f8bee61

Browse files
jameszhu-amdalexdeucher
authored andcommitted
drm/amdgpu:Always save uvd vcpu_bo in VM Mode
When UVD is in VM mode, there is not uvd handle exchanged, uvd.handles are always 0. So vcpu_bo always need save, Otherwise amdgpu driver will fail during suspend/resume. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105021 Signed-off-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 0e5ee33 commit f8bee61

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,15 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)
299299

300300
cancel_delayed_work_sync(&adev->uvd.idle_work);
301301

302-
for (i = 0; i < adev->uvd.max_handles; ++i)
303-
if (atomic_read(&adev->uvd.handles[i]))
304-
break;
302+
/* only valid for physical mode */
303+
if (adev->asic_type < CHIP_POLARIS10) {
304+
for (i = 0; i < adev->uvd.max_handles; ++i)
305+
if (atomic_read(&adev->uvd.handles[i]))
306+
break;
305307

306-
if (i == adev->uvd.max_handles)
307-
return 0;
308+
if (i == adev->uvd.max_handles)
309+
return 0;
310+
}
308311

309312
size = amdgpu_bo_size(adev->uvd.vcpu_bo);
310313
ptr = adev->uvd.cpu_addr;

0 commit comments

Comments
 (0)