]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/ttm: cleanup ttm_buffer_object_transfer
authorChristian König <christian.koenig@amd.com>
Mon, 11 Nov 2019 12:52:03 +0000 (13:52 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 11 Feb 2020 13:30:58 +0000 (14:30 +0100)
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/
drivers/gpu/drm/ttm/ttm_bo.c

index 1fbc36f05d895f2c9b0578638fcc4a402e7efd2b..c1104c8857b776ad2dd07b36956aaa6b9858620b 100644 (file)
@@ -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
@@ -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;