drm/radeon: fix UVD message buffer validation
Subsystems (2)
PATCH 1/1 drm/radeon: fix UVD message buffer validation
From: Christian König <[email protected]>
When the message buffer is currently moving block until it is idle again.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/radeon/radeon_uvd.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/radeon/radeon_uvd.c +8 -0
@@ -356,6 +356,14 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,return -EINVAL ; } +if (bo->tbo.sync_obj) { + r =radeon_fence_wait (bo->tbo.sync_obj, false); +if (r) { +DRM_ERROR ("Failed waiting for UVD message (%d)!\n" , r); +return r; + } + } + r =radeon_bo_kmap (bo, &ptr);if (r) {DRM_ERROR ("Failed mapping the UVD message (%d)!\n" , r);
Signature · 6 lines
1.7.9.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 6 lines · Christian König
From: Christian König <[email protected]>
When the message buffer is currently moving block until it is idle again.
Signed-off-by Christian König <[email protected]>
Applied to my fixes tree.
Alex
Quoted 26 lines
--- drivers/gpu/drm/radeon/radeon_uvd.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/gpu/drm/radeon/radeon_uvd.c +8
-1@@ -356,6 +356,14 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,return -EINVAL ; } +if (bo->tbo.sync_obj) { + r =radeon_fence_wait (bo->tbo.sync_obj, false); +if (r) { +DRM_ERROR ("Failed waiting for UVD message (%d)!\n" , r); +return r; + } + } + r =radeon_bo_kmap (bo, &ptr);if (r) {DRM_ERROR ("Failed mapping the UVD message (%d)!\n" , r); --1.7.9.5