drm/amdgpu:Correct max uvd handles
Subsystems (2)
PATCH 1/2 drm/amdgpu:Correct max uvd handles
Max uvd handles should use adev->uvd.max_handles instead of AMDGPU_MAX_UVD_HANDLES here.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1 -1
@@ -303,7 +303,7 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)if (atomic_read (&adev->uvd.handles[i]))break ; -if (i ==AMDGPU_MAX_UVD_HANDLES ) +if (i == adev->uvd.max_handles)return 0 ; size =amdgpu_bo_size (adev->uvd.vcpu_bo);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1520367246-8734-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 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
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2 -1
@@ -303,7 +303,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)if (atomic_read (&adev->uvd.handles[i]))break ; -if (i == adev->uvd.max_handles) +/* only valid for physical mode */ +if (i == adev->uvd.max_handles && adev->asic_type <CHIP_POLARIS10 )return 0 ; size =amdgpu_bo_size (adev->uvd.vcpu_bo);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1520367246-8734-2-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org
Leo Liu
Reviewed-byRe: [PATCH 2/2] drm/amdgpu:Always save uvd vcpu_bo in VM Mode
Series are:
Quoted 15 lines · James Zhu
When UVD is in VM mode, there is not uvd handle exchanged, uvd.handles are always 0. So
vcpu_boalways 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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device *adev) · line 310
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1@@ -303,7 +303,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)if (atomic_read (&adev->uvd.handles[i]))break ; -if (i == adev->uvd.max_handles) +/* only valid for physical mode */ +if (i == adev->uvd.max_handles && adev->asic_type <CHIP_POLARIS10 )return 0 ; size =amdgpu_bo_size (adev->uvd.vcpu_bo);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amdgpu:Always save uvd vcpu_bo in VM Mode
In reply to a message not in the archiveAm 06.03.2018 um 21:14 schrieb James Zhu:
Quoted 15 lines
When UVD is in VM mode, there is not uvd handle exchanged, uvd.handles are always 0. So
vcpu_boalways 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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device *adev) · line 307
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1@@ -303,7 +303,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)if (atomic_read (&adev->uvd.handles[i]))break ; -if (i == adev->uvd.max_handles) +/* only valid for physical mode */ +if (i == adev->uvd.max_handles && adev->asic_type <CHIP_POLARIS10 )
Would be nice to completely skip the check on Polaris and newer. In other words:
If (adev->asic_type < CHIP_POLARIS10) {
for (i= 0;.....
if (i== adev->uvd.max_handles)
return 0;
}
But that is purely nice to have, both patches are Reviewed-by: Christian König <[email protected]>.
Regards,
Christian.
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device *adev) · line 310
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0return 0 ; size =amdgpu_bo_size (adev->uvd.vcpu_bo);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 2/2 drm/amdgpu:Always save uvd vcpu_bo in VM Mode
In reply to a message not in the archiveWhen 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
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +8 -5
@@ -299,12 +299,15 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)cancel_delayed_work_sync (&adev->uvd.idle_work); -for (i =0 ; i < adev->uvd.max_handles; ++i) -if (atomic_read (&adev->uvd.handles[i])) -break ; +/* only valid for physical mode */ +if (adev->asic_type <CHIP_POLARIS10 ) { +for (i =0 ; i < adev->uvd.max_handles; ++i) +if (atomic_read (&adev->uvd.handles[i])) +break ; -if (i == adev->uvd.max_handles) -return 0 ; +if (i == adev->uvd.max_handles) +return 0 ; + } size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx