Skip to content

Commit

Permalink
drm/amdgpu: Fix uvd ib test timeout when use pre-allocated BO
Browse files Browse the repository at this point in the history
Now we use same BO for create/destroy msg. So destroy will wait for the
fence returned from create to be signaled. The default timeout value in
destroy is 10ms which is too short.

Lets wait both fences with the specific timeout.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
xinhui pan authored and Alex Deucher committed Sep 23, 2021
1 parent b2fe31c commit 0a22678
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,10 +1336,17 @@ int amdgpu_uvd_ring_test_ib(struct amdgpu_ring *ring, long timeout)
struct dma_fence *fence;
long r;

r = amdgpu_uvd_get_create_msg(ring, 1, NULL);
r = amdgpu_uvd_get_create_msg(ring, 1, &fence);
if (r)
goto error;

r = dma_fence_wait_timeout(fence, false, timeout);
dma_fence_put(fence);
if (r == 0)
r = -ETIMEDOUT;
if (r < 0)
goto error;

r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence);
if (r)
goto error;
Expand Down

0 comments on commit 0a22678

Please sign in to comment.