Lines Matching +full:start +full:- +full:up
2 * Copyright © 2008-2010 Intel Corporation
25 * Chris Wilson <chris@chris-wilson.co.uuk>
60 list_add(&vma->evict_link, unwind); in mark_free()
61 return drm_mm_scan_add_block(scan, &vma->node); in mark_free()
65 * i915_gem_evict_something - Evict vmas to make room for binding a new one
70 * @start: start (inclusive) of the range from which to evict objects
80 * Since this function is only used to free up virtual address space it only
82 * pinned. Hence obj->pages_pin_count does not protect against eviction.
84 * To clarify: This is for freeing up virtual address space, not for freeing
91 u64 start, u64 end, in i915_gem_evict_something() argument
102 lockdep_assert_held(&vm->mutex); in i915_gem_evict_something()
121 drm_mm_scan_init_with_range(&scan, &vm->mm, in i915_gem_evict_something()
123 start, end, mode); in i915_gem_evict_something()
125 intel_gt_retire_requests(vm->gt); in i915_gem_evict_something()
130 list_for_each_entry_safe(vma, next, &vm->bound_list, vm_link) { in i915_gem_evict_something()
135 active = ERR_PTR(-EAGAIN); in i915_gem_evict_something()
139 * We keep this list in a rough least-recently scanned order in i915_gem_evict_something()
145 * frequently replaced after a frame, which are self-evicting! in i915_gem_evict_something()
147 * fairly static, and keeping it in least-recently scan order in i915_gem_evict_something()
153 if (active != ERR_PTR(-EAGAIN) && i915_vma_is_active(vma)) { in i915_gem_evict_something()
157 list_move_tail(&vma->vm_link, &vm->bound_list); in i915_gem_evict_something()
165 /* Nothing found, clean up and bail out! */ in i915_gem_evict_something()
167 ret = drm_mm_scan_remove_block(&scan, &vma->node); in i915_gem_evict_something()
175 * purge when inspecting per-process local address spaces. in i915_gem_evict_something()
178 return -ENOSPC; in i915_gem_evict_something()
189 * a switch to the perma-pinned kernel context. This all also gives in i915_gem_evict_something()
194 return -EBUSY; in i915_gem_evict_something()
196 ret = ggtt_flush(vm->gt); in i915_gem_evict_something()
207 * scanning, therefore store to-be-evicted objects on a in i915_gem_evict_something()
213 if (drm_mm_scan_remove_block(&scan, &vma->node)) in i915_gem_evict_something()
216 list_del(&vma->evict_link); in i915_gem_evict_something()
230 /* If we find any non-objects (!vma), we cannot evict them */ in i915_gem_evict_something()
231 if (vma->node.color != I915_COLOR_UNEVICTABLE) in i915_gem_evict_something()
234 ret = -ENOSPC; /* XXX search failed, try again? */ in i915_gem_evict_something()
241 * i915_gem_evict_for_vma - Evict vmas to make room for binding a new one
248 * To clarify: This is for freeing up virtual address space, not for freeing
257 u64 start = target->start; in i915_gem_evict_for_node() local
258 u64 end = start + target->size; in i915_gem_evict_for_node()
262 lockdep_assert_held(&vm->mutex); in i915_gem_evict_for_node()
263 GEM_BUG_ON(!IS_ALIGNED(start, I915_GTT_PAGE_SIZE)); in i915_gem_evict_for_node()
274 intel_gt_retire_requests(vm->gt); in i915_gem_evict_for_node()
278 if (start) in i915_gem_evict_for_node()
279 start -= I915_GTT_PAGE_SIZE; in i915_gem_evict_for_node()
281 /* Always look at the page afterwards to avoid the end-of-GTT */ in i915_gem_evict_for_node()
284 GEM_BUG_ON(start >= end); in i915_gem_evict_for_node()
286 drm_mm_for_each_node_in_range(node, &vm->mm, start, end) { in i915_gem_evict_for_node()
287 /* If we find any non-objects (!vma), we cannot evict them */ in i915_gem_evict_for_node()
288 if (node->color == I915_COLOR_UNEVICTABLE) { in i915_gem_evict_for_node()
289 ret = -ENOSPC; in i915_gem_evict_for_node()
304 if (node->start + node->size == target->start) { in i915_gem_evict_for_node()
305 if (node->color == target->color) in i915_gem_evict_for_node()
308 if (node->start == target->start + target->size) { in i915_gem_evict_for_node()
309 if (node->color == target->color) in i915_gem_evict_for_node()
315 ret = -ENOSPC; in i915_gem_evict_for_node()
320 ret = -ENOSPC; in i915_gem_evict_for_node()
334 list_add(&vma->evict_link, &eviction_list); in i915_gem_evict_for_node()
347 * i915_gem_evict_vm - Evict all idle vmas from a vm
352 * This is used by the execbuf code as a last-ditch effort to defragment the
355 * To clarify: This is for freeing up virtual address space, not for freeing
362 lockdep_assert_held(&vm->mutex); in i915_gem_evict_vm()
371 ret = ggtt_flush(vm->gt); in i915_gem_evict_vm()
380 list_for_each_entry(vma, &vm->bound_list, vm_link) { in i915_gem_evict_vm()
385 list_add(&vma->evict_link, &eviction_list); in i915_gem_evict_vm()
395 if (ret != -EINTR) /* "Get me out of here!" */ in i915_gem_evict_vm()