From: Felix Kuehling Date: Sat, 27 Feb 2021 03:43:04 +0000 (-0500) Subject: drm/ttm: Ignore signaled move fences X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e92b0ff603435c200256524dd234618d91bbd8e1;p=linux.git drm/ttm: Ignore signaled move fences Move fences that have already signaled should not prevent memory allocations with no_wait_gpu. Signed-off-by: Felix Kuehling Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210227034524.21763-1-Felix.Kuehling@amd.com Signed-off-by: Christian König --- diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 6ab7b66ce36d0..cfd0b92923973 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -705,8 +705,9 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo, return 0; if (no_wait_gpu) { + ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY; dma_fence_put(fence); - return -EBUSY; + return ret; } dma_resv_add_shared_fence(bo->base.resv, fence);