Lines Matching full:vm
64 #define ggtt_total_entries(ggtt) ((ggtt)->vm.total >> PAGE_SHIFT)
215 void (*bind_vma)(struct i915_address_space *vm,
224 void (*unbind_vma)(struct i915_address_space *vm,
278 /* Flags used when creating page-table objects for this vm */
285 (*alloc_pt_dma)(struct i915_address_space *vm, int sz);
287 (*alloc_scratch_dma)(struct i915_address_space *vm, int sz);
295 void (*allocate_va_range)(struct i915_address_space *vm,
298 void (*clear_range)(struct i915_address_space *vm,
300 void (*insert_page)(struct i915_address_space *vm,
305 void (*insert_entries)(struct i915_address_space *vm,
309 void (*raw_insert_page)(struct i915_address_space *vm,
314 void (*raw_insert_entries)(struct i915_address_space *vm,
318 void (*cleanup)(struct i915_address_space *vm);
320 void (*foreach)(struct i915_address_space *vm,
322 void (*fn)(struct i915_address_space *vm,
342 struct i915_address_space vm; member
395 struct i915_address_space vm; member
400 #define i915_is_ggtt(vm) ((vm)->is_ggtt) argument
401 #define i915_is_dpt(vm) ((vm)->is_dpt) argument
402 #define i915_is_ggtt_or_dpt(vm) (i915_is_ggtt(vm) || i915_is_dpt(vm)) argument
407 i915_vm_lock_objects(struct i915_address_space *vm, struct i915_gem_ww_ctx *ww);
410 i915_vm_is_4lvl(const struct i915_address_space *vm) in i915_vm_is_4lvl() argument
412 return (vm->total - 1) >> 32; in i915_vm_is_4lvl()
416 i915_vm_has_scratch_64K(struct i915_address_space *vm) in i915_vm_has_scratch_64K() argument
418 return vm->scratch_order == get_order(I915_GTT_PAGE_SIZE_64K); in i915_vm_has_scratch_64K()
421 static inline u64 i915_vm_min_alignment(struct i915_address_space *vm, in i915_vm_min_alignment() argument
425 if ((int)type >= ARRAY_SIZE(vm->min_alignment)) in i915_vm_min_alignment()
428 return vm->min_alignment[type]; in i915_vm_min_alignment()
431 static inline u64 i915_vm_obj_min_alignment(struct i915_address_space *vm, in i915_vm_obj_min_alignment() argument
437 return i915_vm_min_alignment(vm, type); in i915_vm_obj_min_alignment()
441 i915_vm_has_cache_coloring(struct i915_address_space *vm) in i915_vm_has_cache_coloring() argument
443 return i915_is_ggtt(vm) && vm->mm.color_adjust; in i915_vm_has_cache_coloring()
447 i915_vm_to_ggtt(struct i915_address_space *vm) in i915_vm_to_ggtt() argument
449 BUILD_BUG_ON(offsetof(struct i915_ggtt, vm)); in i915_vm_to_ggtt()
450 GEM_BUG_ON(!i915_is_ggtt(vm)); in i915_vm_to_ggtt()
451 return container_of(vm, struct i915_ggtt, vm); in i915_vm_to_ggtt()
455 i915_vm_to_ppgtt(struct i915_address_space *vm) in i915_vm_to_ppgtt() argument
457 BUILD_BUG_ON(offsetof(struct i915_ppgtt, vm)); in i915_vm_to_ppgtt()
458 GEM_BUG_ON(i915_is_ggtt_or_dpt(vm)); in i915_vm_to_ppgtt()
459 return container_of(vm, struct i915_ppgtt, vm); in i915_vm_to_ppgtt()
463 i915_vm_get(struct i915_address_space *vm) in i915_vm_get() argument
465 kref_get(&vm->ref); in i915_vm_get()
466 return vm; in i915_vm_get()
470 i915_vm_tryget(struct i915_address_space *vm) in i915_vm_tryget() argument
472 return kref_get_unless_zero(&vm->ref) ? vm : NULL; in i915_vm_tryget()
475 static inline void assert_vm_alive(struct i915_address_space *vm) in assert_vm_alive() argument
477 GEM_BUG_ON(!kref_read(&vm->ref)); in assert_vm_alive()
481 * i915_vm_resv_get - Obtain a reference on the vm's reservation lock
482 * @vm: The vm whose reservation lock we want to share.
484 * Return: A pointer to the vm's reservation lock.
486 static inline struct dma_resv *i915_vm_resv_get(struct i915_address_space *vm) in i915_vm_resv_get() argument
488 kref_get(&vm->resv_ref); in i915_vm_resv_get()
489 return &vm->_resv; in i915_vm_resv_get()
496 static inline void i915_vm_put(struct i915_address_space *vm) in i915_vm_put() argument
498 kref_put(&vm->ref, i915_vm_release); in i915_vm_put()
502 * i915_vm_resv_put - Release a reference on the vm's reservation lock
505 static inline void i915_vm_resv_put(struct i915_address_space *vm) in i915_vm_resv_put() argument
507 kref_put(&vm->resv_ref, i915_vm_resv_release); in i915_vm_resv_put()
510 void i915_address_space_init(struct i915_address_space *vm, int subclass);
511 void i915_address_space_fini(struct i915_address_space *vm);
565 return __px_dma(pt ? px_base(pt) : ppgtt->vm.scratch[ppgtt->vm.top]); in i915_page_dir_dma_addr()
570 void intel_ggtt_bind_vma(struct i915_address_space *vm,
575 void intel_ggtt_unbind_vma(struct i915_address_space *vm,
597 void i915_ggtt_suspend_vm(struct i915_address_space *vm);
598 bool i915_ggtt_resume_vm(struct i915_address_space *vm);
622 int setup_scratch_page(struct i915_address_space *vm);
623 void free_scratch(struct i915_address_space *vm);
625 struct drm_i915_gem_object *alloc_pt_dma(struct i915_address_space *vm, int sz);
626 struct drm_i915_gem_object *alloc_pt_lmem(struct i915_address_space *vm, int sz);
627 struct i915_page_table *alloc_pt(struct i915_address_space *vm, int sz);
628 struct i915_page_directory *alloc_pd(struct i915_address_space *vm);
631 int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj);
632 int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_object *obj);
634 void free_px(struct i915_address_space *vm,
636 #define free_pt(vm, px) free_px(vm, px, 0) argument
637 #define free_pd(vm, px) free_px(vm, px_pt(px), 1) argument
660 void ppgtt_bind_vma(struct i915_address_space *vm,
665 void ppgtt_unbind_vma(struct i915_address_space *vm,
672 int i915_vm_alloc_pt_stash(struct i915_address_space *vm,
675 int i915_vm_map_pt_stash(struct i915_address_space *vm,
677 void i915_vm_free_pt_stash(struct i915_address_space *vm,
681 __vm_create_scratch_for_read(struct i915_address_space *vm, unsigned long size);
684 __vm_create_scratch_for_read_pinned(struct i915_address_space *vm, unsigned long size);