Lines Matching refs:lru

1317 drm_gem_lru_init(struct drm_gem_lru *lru, struct mutex *lock)  in drm_gem_lru_init()  argument
1319 lru->lock = lock; in drm_gem_lru_init()
1320 lru->count = 0; in drm_gem_lru_init()
1321 INIT_LIST_HEAD(&lru->list); in drm_gem_lru_init()
1328 obj->lru->count -= obj->size >> PAGE_SHIFT; in drm_gem_lru_remove_locked()
1329 WARN_ON(obj->lru->count < 0); in drm_gem_lru_remove_locked()
1331 obj->lru = NULL; in drm_gem_lru_remove_locked()
1344 struct drm_gem_lru *lru = obj->lru; in drm_gem_lru_remove() local
1346 if (!lru) in drm_gem_lru_remove()
1349 mutex_lock(lru->lock); in drm_gem_lru_remove()
1351 mutex_unlock(lru->lock); in drm_gem_lru_remove()
1364 drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj) in drm_gem_lru_move_tail_locked() argument
1366 lockdep_assert_held_once(lru->lock); in drm_gem_lru_move_tail_locked()
1368 if (obj->lru) in drm_gem_lru_move_tail_locked()
1371 lru->count += obj->size >> PAGE_SHIFT; in drm_gem_lru_move_tail_locked()
1372 list_add_tail(&obj->lru_node, &lru->list); in drm_gem_lru_move_tail_locked()
1373 obj->lru = lru; in drm_gem_lru_move_tail_locked()
1388 drm_gem_lru_move_tail(struct drm_gem_lru *lru, struct drm_gem_object *obj) in drm_gem_lru_move_tail() argument
1390 mutex_lock(lru->lock); in drm_gem_lru_move_tail()
1391 drm_gem_lru_move_tail_locked(lru, obj); in drm_gem_lru_move_tail()
1392 mutex_unlock(lru->lock); in drm_gem_lru_move_tail()
1412 drm_gem_lru_scan(struct drm_gem_lru *lru, in drm_gem_lru_scan() argument
1421 drm_gem_lru_init(&still_in_lru, lru->lock); in drm_gem_lru_scan()
1423 mutex_lock(lru->lock); in drm_gem_lru_scan()
1426 obj = list_first_entry_or_null(&lru->list, typeof(*obj), lru_node); in drm_gem_lru_scan()
1446 mutex_unlock(lru->lock); in drm_gem_lru_scan()
1466 WARN_ON(obj->lru == &still_in_lru); in drm_gem_lru_scan()
1467 WARN_ON(obj->lru == lru); in drm_gem_lru_scan()
1474 mutex_lock(lru->lock); in drm_gem_lru_scan()
1482 obj->lru = lru; in drm_gem_lru_scan()
1483 list_splice_tail(&still_in_lru.list, &lru->list); in drm_gem_lru_scan()
1484 lru->count += still_in_lru.count; in drm_gem_lru_scan()
1486 mutex_unlock(lru->lock); in drm_gem_lru_scan()