[11/11] drm/ttm: bulk move per vm bo

Submitted by Zhou, David(ChunMing) on April 12, 2018, 10:09 a.m.

Details

Message ID 20180412100940.25039-12-david1.zhou@amd.com
State New
Headers show
Series "***[WIP] TTM per process lru ***" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Zhou, David(ChunMing) April 12, 2018, 10:09 a.m.
Change-Id: I5b6afbdd715e28e5266b5099ca9a34399d1fc3a1
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index dc9545eeb5d6..d6e7c835f4c1 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -261,8 +261,13 @@  void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo)
 {
 	reservation_object_assert_held(bo->resv);
 
-	ttm_bo_del_from_lru(bo);
-	ttm_bo_add_to_lru(bo);
+	if (bo->resv == bo->process->resv) {
+		list_move_tail(&bo->process->process_list,
+			       &bo->bdev->process_list);
+	} else {
+		ttm_bo_del_from_lru(bo);
+		ttm_bo_add_to_lru(bo);
+	}
 }
 EXPORT_SYMBOL(ttm_bo_move_to_lru_tail);