Lines Matching full:bulk
40 /* Detach the cursor from the bulk move list*/
46 cursor->bulk = NULL; in ttm_resource_cursor_clear_bulk()
50 /* Move the cursor to the end of the bulk move list it's in */
51 static void ttm_resource_cursor_move_bulk_tail(struct ttm_lru_bulk_move *bulk, in ttm_resource_cursor_move_bulk_tail() argument
58 if (WARN_ON_ONCE(bulk != cursor->bulk)) { in ttm_resource_cursor_move_bulk_tail()
63 pos = &bulk->pos[cursor->mem_type][cursor->priority]; in ttm_resource_cursor_move_bulk_tail()
69 /* Move all cursors attached to a bulk move to its end */
70 static void ttm_bulk_move_adjust_cursors(struct ttm_lru_bulk_move *bulk) in ttm_bulk_move_adjust_cursors() argument
74 list_for_each_entry_safe(cursor, next, &bulk->cursor_list, bulk_link) in ttm_bulk_move_adjust_cursors()
75 ttm_resource_cursor_move_bulk_tail(bulk, cursor); in ttm_bulk_move_adjust_cursors()
78 /* Remove a cursor from an empty bulk move list */
79 static void ttm_bulk_move_drop_cursors(struct ttm_lru_bulk_move *bulk) in ttm_bulk_move_drop_cursors() argument
83 list_for_each_entry_safe(cursor, next, &bulk->cursor_list, bulk_link) in ttm_bulk_move_drop_cursors()
120 * ttm_lru_bulk_move_init - initialize a bulk move structure
121 * @bulk: the structure to init
125 void ttm_lru_bulk_move_init(struct ttm_lru_bulk_move *bulk) in ttm_lru_bulk_move_init() argument
127 memset(bulk, 0, sizeof(*bulk)); in ttm_lru_bulk_move_init()
128 INIT_LIST_HEAD(&bulk->cursor_list); in ttm_lru_bulk_move_init()
133 * ttm_lru_bulk_move_fini - finalize a bulk move structure
135 * @bulk: the structure to finalize
137 * Sanity checks that bulk moves don't have any
141 struct ttm_lru_bulk_move *bulk) in ttm_lru_bulk_move_fini() argument
144 ttm_bulk_move_drop_cursors(bulk); in ttm_lru_bulk_move_fini()
150 * ttm_lru_bulk_move_tail - bulk move range of resources to the LRU tail.
152 * @bulk: bulk move structure
154 * Bulk move BOs to the LRU tail, only valid to use when driver makes sure that
157 void ttm_lru_bulk_move_tail(struct ttm_lru_bulk_move *bulk) in ttm_lru_bulk_move_tail() argument
161 ttm_bulk_move_adjust_cursors(bulk); in ttm_lru_bulk_move_tail()
164 struct ttm_lru_bulk_move_pos *pos = &bulk->pos[i][j]; in ttm_lru_bulk_move_tail()
182 /* Return the bulk move pos object for this resource */
184 ttm_lru_bulk_move_pos(struct ttm_lru_bulk_move *bulk, struct ttm_resource *res) in ttm_lru_bulk_move_pos() argument
186 return &bulk->pos[res->mem_type][res->bo->priority]; in ttm_lru_bulk_move_pos()
213 /* Move the resource to the tail of the bulk move range */
226 static void ttm_lru_bulk_move_add(struct ttm_lru_bulk_move *bulk, in ttm_lru_bulk_move_add() argument
229 struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res); in ttm_lru_bulk_move_add()
241 static void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk, in ttm_lru_bulk_move_del() argument
244 struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res); in ttm_lru_bulk_move_del()
279 /* Add the resource to a bulk move if the BO is configured for it */
287 /* Remove the resource from a bulk move if the BO is configured for it */
295 /* Move a resource to the LRU or bulk tail */
631 struct ttm_lru_bulk_move *bulk = NULL; in ttm_resource_cursor_check_bulk() local
635 bulk = bo->bulk_move; in ttm_resource_cursor_check_bulk()
637 if (cursor->bulk != bulk) { in ttm_resource_cursor_check_bulk()
638 if (bulk) { in ttm_resource_cursor_check_bulk()
639 list_move_tail(&cursor->bulk_link, &bulk->cursor_list); in ttm_resource_cursor_check_bulk()
644 cursor->bulk = bulk; in ttm_resource_cursor_check_bulk()