Commit 89aae41d authored by Christian König's avatar Christian König

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: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deuche <alexander.deucher@amd.com>
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211028132630.2330-6-christian.koenig@amd.com
parent c29d6797
...@@ -469,7 +469,6 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo, ...@@ -469,7 +469,6 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
{ {
int32_t *msg, msg_type, handle; int32_t *msg, msg_type, handle;
unsigned img_size = 0; unsigned img_size = 0;
struct dma_fence *f;
void *ptr; void *ptr;
int i, r; int i, r;
...@@ -479,13 +478,11 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo, ...@@ -479,13 +478,11 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
return -EINVAL; return -EINVAL;
} }
f = dma_resv_excl_fence(bo->tbo.base.resv); r = dma_resv_wait_timeout(bo->tbo.base.resv, false, false,
if (f) { MAX_SCHEDULE_TIMEOUT);
r = radeon_fence_wait((struct radeon_fence *)f, false); if (r <= 0) {
if (r) { DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
DRM_ERROR("Failed waiting for UVD message (%d)!\n", r); return r ? r : -ETIME;
return r;
}
} }
r = radeon_bo_kmap(bo, &ptr); r = radeon_bo_kmap(bo, &ptr);
......
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