[PATCH 5/6] drm/ttm: enable eviction for Per-VM-BO

Roger He Hongbo.He at amd.com
Tue Dec 12 09:33:47 UTC 2017


Change-Id: I491d4ceb8c98bb3d8e6e0ddef2330284ce2fe5f6
Signed-off-by: Roger He <Hongbo.He at amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index eb8c568..22b6ca5 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -722,10 +722,9 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
 	spin_lock(&glob->lru_lock);
 	for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
 		list_for_each_entry(bo, &man->lru[i], lru) {
-			if (bo->resv == resv) {
-				if (list_empty(&bo->ddestroy))
-					continue;
-			} else {
+			if (!ctx ||
+				!(ctx->on_alloc_stage &&
+				bo->resv == ctx->resv)) {
 				locked = reservation_object_trylock(bo->resv);
 				if (!locked)
 					continue;
-- 
2.7.4



More information about the amd-gfx mailing list