All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/ttm: fix ttm_bo_bulk_move_helper
@ 2018-08-31 13:10 Christian König
       [not found] ` <20180831131019.2486-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Christian König @ 2018-08-31 13:10 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: michel.daenzer-5C7GfCeVMHo

Staring at the function for six hours, just to essentially move one line
of code.

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

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 35d53d81f486..138c98902033 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -250,15 +250,18 @@ EXPORT_SYMBOL(ttm_bo_move_to_lru_tail);
 static void ttm_bo_bulk_move_helper(struct ttm_lru_bulk_move_pos *pos,
 				    struct list_head *lru, bool is_swap)
 {
+	struct list_head *list;
 	LIST_HEAD(entries);
 	LIST_HEAD(before);
-	struct list_head *list1, *list2;
 
-	list1 = is_swap ? &pos->last->swap : &pos->last->lru;
-	list2 = is_swap ? pos->first->swap.prev : pos->first->lru.prev;
+	reservation_object_assert_held(pos->last->resv);
+	list = is_swap ? &pos->last->swap : &pos->last->lru;
+	list_cut_position(&entries, lru, list);
+
+	reservation_object_assert_held(pos->first->resv);
+	list = is_swap ? pos->first->swap.prev : pos->first->lru.prev;
+	list_cut_position(&before, &entries, list);
 
-	list_cut_position(&entries, lru, list1);
-	list_cut_position(&before, &entries, list2);
 	list_splice(&before, lru);
 	list_splice_tail(&entries, lru);
 }
-- 
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-09-08 10:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 13:10 [PATCH 1/3] drm/ttm: fix ttm_bo_bulk_move_helper Christian König
     [not found] ` <20180831131019.2486-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-31 13:10   ` [PATCH 2/3] drm/amdgpu: fix "use bulk moves for efficient VM LRU handling" v2 Christian König
     [not found]     ` <20180831131019.2486-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-03  2:05       ` Zhang, Jerry (Junwei)
2018-08-31 13:10   ` [PATCH 3/3] drm/amdgpu: fix idle state and bulk_moveavle flag Christian König
     [not found]     ` <20180831131019.2486-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-31 15:19       ` Michel Dänzer
2018-08-31 15:15   ` [PATCH 1/3] drm/ttm: fix ttm_bo_bulk_move_helper Michel Dänzer
     [not found]     ` <a186be44-e64b-f408-fa30-bb81b59322f6-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-31 15:17       ` Christian König
     [not found]         ` <c8d0d5c6-1221-26be-4005-2f7ae21ade80-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-06 10:02           ` Huang Rui
2018-09-06 10:06             ` Christian König
     [not found]               ` <3be7e67a-2ffe-21c0-2160-69a330413858-5C7GfCeVMHo@public.gmane.org>
2018-09-07 11:02                 ` Huang, Ray
     [not found]                   ` <CY1PR12MB0043539F7EE805B3A98E1FE2EC000-1s8aH8ViOEdbUNsZNX5b0gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-07 11:18                     ` Christian König
     [not found]                       ` <24dbe7c4-63df-b8a7-28c3-df0e9866841f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-08  7:54                         ` Huang Rui
2018-09-08 10:43                           ` Christian König
2018-09-03  2:05   ` Zhang, Jerry (Junwei)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.