[PATCH 08/11] drm/ttm: put new BOs immediately on the LRU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This way they are available for eviction immediately.

Signed-off-by: Christian König <christian.koenig@xxxxxxx>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 233bfb86068b..a301c876ae31 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1390,21 +1390,18 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
 		WARN_ON(!locked);
 	}
 
-	if (likely(!ret))
+	if (likely(!ret)) {
+		spin_lock(&bdev->glob->lru_lock);
+		ttm_bo_add_to_lru(bo);
+		spin_unlock(&bdev->glob->lru_lock);
 		ret = ttm_bo_validate(bo, placement, ctx);
+	}
 
 	if (unlikely(ret)) {
 		if (!resv)
 			ttm_bo_unreserve(bo);
 
 		ttm_bo_put(bo);
-		return ret;
-	}
-
-	if (resv && !(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
-		spin_lock(&bdev->glob->lru_lock);
-		ttm_bo_add_to_lru(bo);
-		spin_unlock(&bdev->glob->lru_lock);
 	}
 
 	return ret;
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux