Skip to content

Commit 89aae41

Browse files
drm/radeon: use dma_resv_wait_timeout() instead of manually waiting
Don't touch the exclusive fence manually here, but rather use the general dma_resv function. We did that for better hw reset handling but this doesn't necessary work correctly. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deuche <alexander.deucher@amd.com> Acked-by: Nirmoy Das <nirmoy.das@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211028132630.2330-6-christian.koenig@amd.com
1 parent c29d679 commit 89aae41

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/gpu/drm/radeon/radeon_uvd.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
469469
{
470470
int32_t *msg, msg_type, handle;
471471
unsigned img_size = 0;
472-
struct dma_fence *f;
473472
void *ptr;
474473

475474
int i, r;
@@ -479,13 +478,11 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
479478
return -EINVAL;
480479
}
481480

482-
f = dma_resv_excl_fence(bo->tbo.base.resv);
483-
if (f) {
484-
r = radeon_fence_wait((struct radeon_fence *)f, false);
485-
if (r) {
486-
DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
487-
return r;
488-
}
481+
r = dma_resv_wait_timeout(bo->tbo.base.resv, false, false,
482+
MAX_SCHEDULE_TIMEOUT);
483+
if (r <= 0) {
484+
DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
485+
return r ? r : -ETIME;
489486
}
490487

491488
r = radeon_bo_kmap(bo, &ptr);

0 commit comments

Comments
 (0)