drm/ttm: cleanup ttm_buffer_object_transfer

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/
This commit is contained in:
Christian König 2019-11-11 13:52:03 +01:00
parent 5b34406f54
commit 832c90df89

View File

@ -522,14 +522,9 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
bool interruptible, bool no_wait_gpu, bool interruptible, bool no_wait_gpu,
bool unlock_resv) bool unlock_resv)
{ {
struct dma_resv *resv; struct dma_resv *resv = &bo->base._resv;
int ret; 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)) if (dma_resv_test_signaled_rcu(resv, true))
ret = 0; ret = 0;
else else
@ -542,9 +537,8 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
dma_resv_unlock(bo->base.resv); dma_resv_unlock(bo->base.resv);
spin_unlock(&ttm_bo_glob.lru_lock); spin_unlock(&ttm_bo_glob.lru_lock);
lret = dma_resv_wait_timeout_rcu(resv, true, lret = dma_resv_wait_timeout_rcu(resv, true, interruptible,
interruptible, 30 * HZ);
30 * HZ);
if (lret < 0) if (lret < 0)
return lret; return lret;