drm/amdgpu: use the reservation obj wait for the UVD msg
authorChristian König <christian.koenig@amd.com>
Thu, 6 Aug 2015 18:44:47 +0000 (20:44 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2015 20:51:08 +0000 (16:51 -0400)
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

index f114c6b49b9dc9feedd1794d98b624099ae3ba9f..b56cace92fc6e193bd62b0bdd87b1205e152a567 100644 (file)
@@ -513,7 +513,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
 {
        struct amdgpu_device *adev = ctx->parser->adev;
        int32_t *msg, msg_type, handle;
-       struct fence *f;
        void *ptr;
 
        int i, r;
@@ -523,13 +522,11 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
                return -EINVAL;
        }
 
-       f = reservation_object_get_excl(bo->tbo.resv);
-       if (f) {
-               r = amdgpu_fence_wait((struct amdgpu_fence *)f, false);
-               if (r) {
-                       DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
-                       return r;
-               }
+       r = reservation_object_wait_timeout_rcu(bo->tbo.resv, true, false,
+                                               MAX_SCHEDULE_TIMEOUT);
+       if (r) {
+               DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
+               return r;
        }
 
        r = amdgpu_bo_kmap(bo, &ptr);