Lines Matching refs:vm
64 #define ggtt_total_entries(ggtt) ((ggtt)->vm.total >> PAGE_SHIFT)
233 void (*bind_vma)(struct i915_address_space *vm,
242 void (*unbind_vma)(struct i915_address_space *vm,
308 (*alloc_pt_dma)(struct i915_address_space *vm, int sz);
310 (*alloc_scratch_dma)(struct i915_address_space *vm, int sz);
318 void (*allocate_va_range)(struct i915_address_space *vm,
321 void (*clear_range)(struct i915_address_space *vm,
323 void (*scratch_range)(struct i915_address_space *vm,
325 void (*insert_page)(struct i915_address_space *vm,
330 void (*insert_entries)(struct i915_address_space *vm,
334 void (*raw_insert_page)(struct i915_address_space *vm,
339 void (*raw_insert_entries)(struct i915_address_space *vm,
343 void (*cleanup)(struct i915_address_space *vm);
345 void (*foreach)(struct i915_address_space *vm,
347 void (*fn)(struct i915_address_space *vm,
367 struct i915_address_space vm; member
410 struct i915_address_space vm; member
415 #define i915_is_ggtt(vm) ((vm)->is_ggtt) argument
416 #define i915_is_dpt(vm) ((vm)->is_dpt) argument
417 #define i915_is_ggtt_or_dpt(vm) (i915_is_ggtt(vm) || i915_is_dpt(vm)) argument
422 i915_vm_lock_objects(struct i915_address_space *vm, struct i915_gem_ww_ctx *ww);
425 i915_vm_is_4lvl(const struct i915_address_space *vm) in i915_vm_is_4lvl() argument
427 return (vm->total - 1) >> 32; in i915_vm_is_4lvl()
431 i915_vm_has_scratch_64K(struct i915_address_space *vm) in i915_vm_has_scratch_64K() argument
433 return vm->scratch_order == get_order(I915_GTT_PAGE_SIZE_64K); in i915_vm_has_scratch_64K()
436 static inline u64 i915_vm_min_alignment(struct i915_address_space *vm, in i915_vm_min_alignment() argument
440 if ((int)type >= ARRAY_SIZE(vm->min_alignment)) in i915_vm_min_alignment()
443 return vm->min_alignment[type]; in i915_vm_min_alignment()
446 static inline u64 i915_vm_obj_min_alignment(struct i915_address_space *vm, in i915_vm_obj_min_alignment() argument
452 return i915_vm_min_alignment(vm, type); in i915_vm_obj_min_alignment()
456 i915_vm_has_cache_coloring(struct i915_address_space *vm) in i915_vm_has_cache_coloring() argument
458 return i915_is_ggtt(vm) && vm->mm.color_adjust; in i915_vm_has_cache_coloring()
462 i915_vm_to_ggtt(struct i915_address_space *vm) in i915_vm_to_ggtt() argument
464 BUILD_BUG_ON(offsetof(struct i915_ggtt, vm)); in i915_vm_to_ggtt()
465 GEM_BUG_ON(!i915_is_ggtt(vm)); in i915_vm_to_ggtt()
466 return container_of(vm, struct i915_ggtt, vm); in i915_vm_to_ggtt()
470 i915_vm_to_ppgtt(struct i915_address_space *vm) in i915_vm_to_ppgtt() argument
472 BUILD_BUG_ON(offsetof(struct i915_ppgtt, vm)); in i915_vm_to_ppgtt()
473 GEM_BUG_ON(i915_is_ggtt_or_dpt(vm)); in i915_vm_to_ppgtt()
474 return container_of(vm, struct i915_ppgtt, vm); in i915_vm_to_ppgtt()
478 i915_vm_get(struct i915_address_space *vm) in i915_vm_get() argument
480 kref_get(&vm->ref); in i915_vm_get()
481 return vm; in i915_vm_get()
485 i915_vm_tryget(struct i915_address_space *vm) in i915_vm_tryget() argument
487 return kref_get_unless_zero(&vm->ref) ? vm : NULL; in i915_vm_tryget()
490 static inline void assert_vm_alive(struct i915_address_space *vm) in assert_vm_alive() argument
492 GEM_BUG_ON(!kref_read(&vm->ref)); in assert_vm_alive()
501 static inline struct dma_resv *i915_vm_resv_get(struct i915_address_space *vm) in i915_vm_resv_get() argument
503 kref_get(&vm->resv_ref); in i915_vm_resv_get()
504 return &vm->_resv; in i915_vm_resv_get()
511 static inline void i915_vm_put(struct i915_address_space *vm) in i915_vm_put() argument
513 kref_put(&vm->ref, i915_vm_release); in i915_vm_put()
520 static inline void i915_vm_resv_put(struct i915_address_space *vm) in i915_vm_resv_put() argument
522 kref_put(&vm->resv_ref, i915_vm_resv_release); in i915_vm_resv_put()
525 void i915_address_space_init(struct i915_address_space *vm, int subclass);
526 void i915_address_space_fini(struct i915_address_space *vm);
580 return __px_dma(pt ? px_base(pt) : ppgtt->vm.scratch[ppgtt->vm.top]); in i915_page_dir_dma_addr()
585 void intel_ggtt_bind_vma(struct i915_address_space *vm,
590 void intel_ggtt_unbind_vma(struct i915_address_space *vm,
611 void i915_ggtt_suspend_vm(struct i915_address_space *vm);
612 bool i915_ggtt_resume_vm(struct i915_address_space *vm);
625 int setup_scratch_page(struct i915_address_space *vm);
626 void free_scratch(struct i915_address_space *vm);
628 struct drm_i915_gem_object *alloc_pt_dma(struct i915_address_space *vm, int sz);
629 struct drm_i915_gem_object *alloc_pt_lmem(struct i915_address_space *vm, int sz);
630 struct i915_page_table *alloc_pt(struct i915_address_space *vm, int sz);
631 struct i915_page_directory *alloc_pd(struct i915_address_space *vm);
634 int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj);
635 int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_object *obj);
637 void free_px(struct i915_address_space *vm,
639 #define free_pt(vm, px) free_px(vm, px, 0) argument
640 #define free_pd(vm, px) free_px(vm, px_pt(px), 1) argument
663 void ppgtt_bind_vma(struct i915_address_space *vm,
668 void ppgtt_unbind_vma(struct i915_address_space *vm,
675 int i915_vm_alloc_pt_stash(struct i915_address_space *vm,
678 int i915_vm_map_pt_stash(struct i915_address_space *vm,
680 void i915_vm_free_pt_stash(struct i915_address_space *vm,
684 __vm_create_scratch_for_read(struct i915_address_space *vm, unsigned long size);
687 __vm_create_scratch_for_read_pinned(struct i915_address_space *vm, unsigned long size);