Lines Matching refs:ggtt
48 static int populate_ggtt(struct i915_ggtt *ggtt, struct list_head *objects) in populate_ggtt() argument
57 obj = i915_gem_object_create_internal(ggtt->vm.i915, in populate_ggtt()
75 count, ggtt->vm.total / PAGE_SIZE); in populate_ggtt()
77 if (list_empty(&ggtt->vm.bound_list)) { in populate_ggtt()
85 static void unpin_ggtt(struct i915_ggtt *ggtt) in unpin_ggtt() argument
89 list_for_each_entry(vma, &ggtt->vm.bound_list, vm_link) in unpin_ggtt()
94 static void cleanup_objects(struct i915_ggtt *ggtt, struct list_head *list) in cleanup_objects() argument
104 i915_gem_drain_freed_objects(ggtt->vm.i915); in cleanup_objects()
110 struct i915_ggtt *ggtt = gt->ggtt; in igt_evict_something() local
116 err = populate_ggtt(ggtt, &objects); in igt_evict_something()
121 mutex_lock(&ggtt->vm.mutex); in igt_evict_something()
122 err = i915_gem_evict_something(&ggtt->vm, NULL, in igt_evict_something()
126 mutex_unlock(&ggtt->vm.mutex); in igt_evict_something()
133 unpin_ggtt(ggtt); in igt_evict_something()
136 mutex_lock(&ggtt->vm.mutex); in igt_evict_something()
137 err = i915_gem_evict_something(&ggtt->vm, NULL, in igt_evict_something()
141 mutex_unlock(&ggtt->vm.mutex); in igt_evict_something()
149 cleanup_objects(ggtt, &objects); in igt_evict_something()
156 struct i915_ggtt *ggtt = gt->ggtt; in igt_overcommit() local
166 err = populate_ggtt(ggtt, &objects); in igt_overcommit()
186 cleanup_objects(ggtt, &objects); in igt_overcommit()
193 struct i915_ggtt *ggtt = gt->ggtt; in igt_evict_for_vma() local
203 err = populate_ggtt(ggtt, &objects); in igt_evict_for_vma()
208 mutex_lock(&ggtt->vm.mutex); in igt_evict_for_vma()
209 err = i915_gem_evict_for_node(&ggtt->vm, NULL, &target, 0); in igt_evict_for_vma()
210 mutex_unlock(&ggtt->vm.mutex); in igt_evict_for_vma()
217 unpin_ggtt(ggtt); in igt_evict_for_vma()
220 mutex_lock(&ggtt->vm.mutex); in igt_evict_for_vma()
221 err = i915_gem_evict_for_node(&ggtt->vm, NULL, &target, 0); in igt_evict_for_vma()
222 mutex_unlock(&ggtt->vm.mutex); in igt_evict_for_vma()
230 cleanup_objects(ggtt, &objects); in igt_evict_for_vma()
244 struct i915_ggtt *ggtt = gt->ggtt; in igt_evict_for_cache_color() local
262 ggtt->vm.mm.color_adjust = mock_color_adjust; in igt_evict_for_cache_color()
263 GEM_BUG_ON(!i915_vm_has_cache_coloring(&ggtt->vm)); in igt_evict_for_cache_color()
301 mutex_lock(&ggtt->vm.mutex); in igt_evict_for_cache_color()
302 err = i915_gem_evict_for_node(&ggtt->vm, NULL, &target, 0); in igt_evict_for_cache_color()
303 mutex_unlock(&ggtt->vm.mutex); in igt_evict_for_cache_color()
314 mutex_lock(&ggtt->vm.mutex); in igt_evict_for_cache_color()
315 err = i915_gem_evict_for_node(&ggtt->vm, NULL, &target, 0); in igt_evict_for_cache_color()
316 mutex_unlock(&ggtt->vm.mutex); in igt_evict_for_cache_color()
326 unpin_ggtt(ggtt); in igt_evict_for_cache_color()
327 cleanup_objects(ggtt, &objects); in igt_evict_for_cache_color()
328 ggtt->vm.mm.color_adjust = NULL; in igt_evict_for_cache_color()
335 struct i915_ggtt *ggtt = gt->ggtt; in igt_evict_vm() local
342 err = populate_ggtt(ggtt, &objects); in igt_evict_vm()
347 mutex_lock(&ggtt->vm.mutex); in igt_evict_vm()
348 err = i915_gem_evict_vm(&ggtt->vm, NULL, NULL); in igt_evict_vm()
349 mutex_unlock(&ggtt->vm.mutex); in igt_evict_vm()
356 unpin_ggtt(ggtt); in igt_evict_vm()
359 mutex_lock(&ggtt->vm.mutex); in igt_evict_vm()
360 err = i915_gem_evict_vm(&ggtt->vm, &ww, NULL); in igt_evict_vm()
361 mutex_unlock(&ggtt->vm.mutex); in igt_evict_vm()
371 cleanup_objects(ggtt, &objects); in igt_evict_vm()
379 struct i915_ggtt *ggtt = gt->ggtt; in igt_evict_contexts() local
410 mutex_lock(&ggtt->vm.mutex); in igt_evict_contexts()
411 err = i915_gem_gtt_insert(&ggtt->vm, NULL, &hole, in igt_evict_contexts()
413 0, ggtt->vm.total, in igt_evict_contexts()
423 mutex_unlock(&ggtt->vm.mutex); in igt_evict_contexts()
425 mutex_lock(&ggtt->vm.mutex); in igt_evict_contexts()
431 if (i915_gem_gtt_insert(&ggtt->vm, NULL, &r->node, in igt_evict_contexts()
433 0, ggtt->vm.total, in igt_evict_contexts()
445 mutex_unlock(&ggtt->vm.mutex); in igt_evict_contexts()
517 mutex_lock(&ggtt->vm.mutex); in igt_evict_contexts()
531 mutex_unlock(&ggtt->vm.mutex); in igt_evict_contexts()