* [PATCH] drm/amdgpu: Fix uvd ib test timeout when use pre-allocated BO
@ 2021-09-16 6:19 xinhui pan
2021-09-16 6:28 ` Christian König
0 siblings, 1 reply; 2+ messages in thread
From: xinhui pan @ 2021-09-16 6:19 UTC (permalink / raw)
To: amd-gfx; +Cc: alexander.deucher, christian.koenig, leo.liu, xinhui pan
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>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index b6e2abf26e18..8a26459bd80b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdgpu: Fix uvd ib test timeout when use pre-allocated BO
2021-09-16 6:19 [PATCH] drm/amdgpu: Fix uvd ib test timeout when use pre-allocated BO xinhui pan
@ 2021-09-16 6:28 ` Christian König
0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2021-09-16 6:28 UTC (permalink / raw)
To: xinhui pan, amd-gfx; +Cc: alexander.deucher, christian.koenig, leo.liu
Am 16.09.21 um 08:19 schrieb xinhui pan:
> 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>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index b6e2abf26e18..8a26459bd80b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-16 6:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 6:19 [PATCH] drm/amdgpu: Fix uvd ib test timeout when use pre-allocated BO xinhui pan
2021-09-16 6:28 ` Christian König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.