Skip to content

Commit

Permalink
drm/ttm: cleanup ttm_buffer_object_transfer
Browse files Browse the repository at this point in the history
The function is always called with deleted BOs.

While at it cleanup the indentation as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: xinhui pan <xinhui.pan@amd.com>
Link: https://patchwork.freedesktop.org/patch/352743/
  • Loading branch information
Christian König committed Feb 11, 2020
1 parent 5b34406 commit 832c90d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,9 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
bool interruptible, bool no_wait_gpu,
bool unlock_resv)
{
struct dma_resv *resv;
struct dma_resv *resv = &bo->base._resv;
int ret;

if (unlikely(list_empty(&bo->ddestroy)))
resv = bo->base.resv;
else
resv = &bo->base._resv;

if (dma_resv_test_signaled_rcu(resv, true))
ret = 0;
else
Expand All @@ -542,9 +537,8 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
dma_resv_unlock(bo->base.resv);
spin_unlock(&ttm_bo_glob.lru_lock);

lret = dma_resv_wait_timeout_rcu(resv, true,
interruptible,
30 * HZ);
lret = dma_resv_wait_timeout_rcu(resv, true, interruptible,
30 * HZ);

if (lret < 0)
return lret;
Expand Down

0 comments on commit 832c90d

Please sign in to comment.