Lines Matching +full:start +full:- +full:up

2  * Copyright © 2008-2010 Intel Corporation
25 * Chris Wilson <chris@chris-wilson.co.uuk>
61 list_add(&vma->evict_link, unwind); in mark_free()
62 return drm_mm_scan_add_block(scan, &vma->node); in mark_free()
77 * i915_gem_evict_something - Evict vmas to make room for binding a new one
82 * @start: start (inclusive) of the range from which to evict objects
92 * Since this function is only used to free up virtual address space it only
94 * pinned. Hence obj->pages_pin_count does not protect against eviction.
96 * To clarify: This is for freeing up virtual address space, not for freeing
103 u64 start, u64 end, in i915_gem_evict_something() argument
114 lockdep_assert_held(&vm->mutex); in i915_gem_evict_something()
133 drm_mm_scan_init_with_range(&scan, &vm->mm, in i915_gem_evict_something()
135 start, end, mode); in i915_gem_evict_something()
137 intel_gt_retire_requests(vm->gt); in i915_gem_evict_something()
142 list_for_each_entry_safe(vma, next, &vm->bound_list, vm_link) { in i915_gem_evict_something()
147 active = ERR_PTR(-EAGAIN); in i915_gem_evict_something()
151 * We keep this list in a rough least-recently scanned order in i915_gem_evict_something()
157 * frequently replaced after a frame, which are self-evicting! in i915_gem_evict_something()
159 * fairly static, and keeping it in least-recently scan order in i915_gem_evict_something()
165 if (active != ERR_PTR(-EAGAIN) && defer_evict(vma)) { in i915_gem_evict_something()
169 list_move_tail(&vma->vm_link, &vm->bound_list); in i915_gem_evict_something()
177 /* Nothing found, clean up and bail out! */ in i915_gem_evict_something()
179 ret = drm_mm_scan_remove_block(&scan, &vma->node); in i915_gem_evict_something()
187 * purge when inspecting per-process local address spaces. in i915_gem_evict_something()
190 return -ENOSPC; in i915_gem_evict_something()
201 * a switch to the perma-pinned kernel context. This all also gives in i915_gem_evict_something()
206 return -EBUSY; in i915_gem_evict_something()
208 ret = ggtt_flush(vm->gt); in i915_gem_evict_something()
219 * scanning, therefore store to-be-evicted objects on a in i915_gem_evict_something()
225 if (drm_mm_scan_remove_block(&scan, &vma->node)) in i915_gem_evict_something()
228 list_del(&vma->evict_link); in i915_gem_evict_something()
242 /* If we find any non-objects (!vma), we cannot evict them */ in i915_gem_evict_something()
243 if (vma->node.color != I915_COLOR_UNEVICTABLE) in i915_gem_evict_something()
246 ret = -ENOSPC; /* XXX search failed, try again? */ in i915_gem_evict_something()
253 * i915_gem_evict_for_node - Evict vmas to make room for binding a new one
260 * To clarify: This is for freeing up virtual address space, not for freeing
269 u64 start = target->start; in i915_gem_evict_for_node() local
270 u64 end = start + target->size; in i915_gem_evict_for_node()
274 lockdep_assert_held(&vm->mutex); in i915_gem_evict_for_node()
275 GEM_BUG_ON(!IS_ALIGNED(start, I915_GTT_PAGE_SIZE)); in i915_gem_evict_for_node()
286 intel_gt_retire_requests(vm->gt); in i915_gem_evict_for_node()
290 if (start) in i915_gem_evict_for_node()
291 start -= I915_GTT_PAGE_SIZE; in i915_gem_evict_for_node()
293 /* Always look at the page afterwards to avoid the end-of-GTT */ in i915_gem_evict_for_node()
296 GEM_BUG_ON(start >= end); in i915_gem_evict_for_node()
298 drm_mm_for_each_node_in_range(node, &vm->mm, start, end) { in i915_gem_evict_for_node()
299 /* If we find any non-objects (!vma), we cannot evict them */ in i915_gem_evict_for_node()
300 if (node->color == I915_COLOR_UNEVICTABLE) { in i915_gem_evict_for_node()
301 ret = -ENOSPC; in i915_gem_evict_for_node()
316 if (node->start + node->size == target->start) { in i915_gem_evict_for_node()
317 if (node->color == target->color) in i915_gem_evict_for_node()
320 if (node->start == target->start + target->size) { in i915_gem_evict_for_node()
321 if (node->color == target->color) in i915_gem_evict_for_node()
327 ret = -ENOSPC; in i915_gem_evict_for_node()
332 ret = -ENOSPC; in i915_gem_evict_for_node()
346 list_add(&vma->evict_link, &eviction_list); in i915_gem_evict_for_node()
359 * i915_gem_evict_vm - Evict all idle vmas from a vm
364 * This is used by the execbuf code as a last-ditch effort to defragment the
367 * To clarify: This is for freeing up virtual address space, not for freeing
374 lockdep_assert_held(&vm->mutex); in i915_gem_evict_vm()
383 ret = ggtt_flush(vm->gt); in i915_gem_evict_vm()
392 list_for_each_entry(vma, &vm->bound_list, vm_link) { in i915_gem_evict_vm()
397 list_add(&vma->evict_link, &eviction_list); in i915_gem_evict_vm()
407 if (ret != -EINTR) /* "Get me out of here!" */ in i915_gem_evict_vm()