Lines Matching refs:va
870 #define GPUVA_START(node) ((node)->va.addr)
871 #define GPUVA_LAST(node) ((node)->va.addr + (node)->va.range - 1)
881 struct drm_gpuva *va);
882 static void __drm_gpuva_remove(struct drm_gpuva *va);
913 u64 kstart = gpuvm->kernel_alloc_node.va.addr; in drm_gpuvm_in_kernel_node()
914 u64 krange = gpuvm->kernel_alloc_node.va.range; in drm_gpuvm_in_kernel_node()
1030 gpuvm->kernel_alloc_node.va.addr = reserve_offset; in drm_gpuvm_init()
1031 gpuvm->kernel_alloc_node.va.range = reserve_range; in drm_gpuvm_init()
1045 if (gpuvm->kernel_alloc_node.va.range) in drm_gpuvm_fini()
1215 struct drm_gpuva *va; in drm_gpuvm_prepare_range() local
1219 drm_gpuvm_for_each_va_range(va, gpuvm, addr, end) { in drm_gpuvm_prepare_range()
1220 struct drm_gem_object *obj = va->gem.obj; in drm_gpuvm_prepare_range()
1718 struct drm_gpuva *va) in __drm_gpuva_insert() argument
1724 GPUVA_START(va), in __drm_gpuva_insert()
1725 GPUVA_LAST(va))) in __drm_gpuva_insert()
1728 va->vm = gpuvm; in __drm_gpuva_insert()
1730 drm_gpuva_it_insert(va, &gpuvm->rb.tree); in __drm_gpuva_insert()
1732 node = rb_prev(&va->rb.node); in __drm_gpuva_insert()
1738 list_add(&va->rb.entry, head); in __drm_gpuva_insert()
1759 struct drm_gpuva *va) in drm_gpuva_insert() argument
1761 u64 addr = va->va.addr; in drm_gpuva_insert()
1762 u64 range = va->va.range; in drm_gpuva_insert()
1768 ret = __drm_gpuva_insert(gpuvm, va); in drm_gpuva_insert()
1782 __drm_gpuva_remove(struct drm_gpuva *va) in __drm_gpuva_remove() argument
1784 drm_gpuva_it_remove(va, &va->vm->rb.tree); in __drm_gpuva_remove()
1785 list_del_init(&va->rb.entry); in __drm_gpuva_remove()
1799 drm_gpuva_remove(struct drm_gpuva *va) in drm_gpuva_remove() argument
1801 struct drm_gpuvm *gpuvm = va->vm; in drm_gpuva_remove()
1803 if (unlikely(va == &gpuvm->kernel_alloc_node)) { in drm_gpuva_remove()
1809 __drm_gpuva_remove(va); in drm_gpuva_remove()
1810 drm_gpuvm_put(va->vm); in drm_gpuva_remove()
1830 drm_gpuva_link(struct drm_gpuva *va, struct drm_gpuvm_bo *vm_bo) in drm_gpuva_link() argument
1832 struct drm_gem_object *obj = va->gem.obj; in drm_gpuva_link()
1833 struct drm_gpuvm *gpuvm = va->vm; in drm_gpuva_link()
1840 va->vm_bo = drm_gpuvm_bo_get(vm_bo); in drm_gpuva_link()
1843 list_add_tail(&va->gem.entry, &vm_bo->list.gpuva); in drm_gpuva_link()
1866 drm_gpuva_unlink(struct drm_gpuva *va) in drm_gpuva_unlink() argument
1868 struct drm_gem_object *obj = va->gem.obj; in drm_gpuva_unlink()
1869 struct drm_gpuvm_bo *vm_bo = va->vm_bo; in drm_gpuva_unlink()
1875 list_del_init(&va->gem.entry); in drm_gpuva_unlink()
1877 va->vm_bo = NULL; in drm_gpuva_unlink()
1912 struct drm_gpuva *va; in drm_gpuva_find() local
1914 va = drm_gpuva_find_first(gpuvm, addr, range); in drm_gpuva_find()
1915 if (!va) in drm_gpuva_find()
1918 if (va->va.addr != addr || in drm_gpuva_find()
1919 va->va.range != range) in drm_gpuva_find()
1922 return va; in drm_gpuva_find()
2000 struct drm_gpuva *va, in drm_gpuva_map() argument
2003 drm_gpuva_init_from_op(va, op); in drm_gpuva_map()
2004 drm_gpuva_insert(gpuvm, va); in drm_gpuva_map()
2023 struct drm_gpuva *va = op->unmap->va; in drm_gpuva_remap() local
2024 struct drm_gpuvm *gpuvm = va->vm; in drm_gpuva_remap()
2026 drm_gpuva_remove(va); in drm_gpuva_remap()
2050 drm_gpuva_remove(op->va); in drm_gpuva_unmap()
2062 op.map.va.addr = addr; in op_map_cb()
2063 op.map.va.range = range; in op_map_cb()
2090 struct drm_gpuva *va, bool merge) in op_unmap_cb() argument
2095 op.unmap.va = va; in op_unmap_cb()
2107 struct drm_gpuva *va, *next; in __drm_gpuvm_sm_map() local
2114 drm_gpuvm_for_each_va_range_safe(va, next, gpuvm, req_addr, req_end) { in __drm_gpuvm_sm_map()
2115 struct drm_gem_object *obj = va->gem.obj; in __drm_gpuvm_sm_map()
2116 u64 offset = va->gem.offset; in __drm_gpuvm_sm_map()
2117 u64 addr = va->va.addr; in __drm_gpuvm_sm_map()
2118 u64 range = va->va.range; in __drm_gpuvm_sm_map()
2120 bool merge = !!va->gem.obj; in __drm_gpuvm_sm_map()
2127 ret = op_unmap_cb(ops, priv, va, merge); in __drm_gpuvm_sm_map()
2134 ret = op_unmap_cb(ops, priv, va, merge); in __drm_gpuvm_sm_map()
2142 .va.addr = req_end, in __drm_gpuvm_sm_map()
2143 .va.range = range - req_range, in __drm_gpuvm_sm_map()
2148 .va = va, in __drm_gpuvm_sm_map()
2160 .va.addr = addr, in __drm_gpuvm_sm_map()
2161 .va.range = ls_range, in __drm_gpuvm_sm_map()
2165 struct drm_gpuva_op_unmap u = { .va = va }; in __drm_gpuvm_sm_map()
2187 .va.addr = req_end, in __drm_gpuvm_sm_map()
2188 .va.range = end - req_end, in __drm_gpuvm_sm_map()
2205 ret = op_unmap_cb(ops, priv, va, merge); in __drm_gpuvm_sm_map()
2212 ret = op_unmap_cb(ops, priv, va, merge); in __drm_gpuvm_sm_map()
2220 .va.addr = req_end, in __drm_gpuvm_sm_map()
2221 .va.range = end - req_end, in __drm_gpuvm_sm_map()
2226 .va = va, in __drm_gpuvm_sm_map()
2248 struct drm_gpuva *va, *next; in __drm_gpuvm_sm_unmap() local
2255 drm_gpuvm_for_each_va_range_safe(va, next, gpuvm, req_addr, req_end) { in __drm_gpuvm_sm_unmap()
2258 struct drm_gem_object *obj = va->gem.obj; in __drm_gpuvm_sm_unmap()
2259 u64 offset = va->gem.offset; in __drm_gpuvm_sm_unmap()
2260 u64 addr = va->va.addr; in __drm_gpuvm_sm_unmap()
2261 u64 range = va->va.range; in __drm_gpuvm_sm_unmap()
2265 prev.va.addr = addr; in __drm_gpuvm_sm_unmap()
2266 prev.va.range = req_addr - addr; in __drm_gpuvm_sm_unmap()
2274 next.va.addr = req_end; in __drm_gpuvm_sm_unmap()
2275 next.va.range = end - req_end; in __drm_gpuvm_sm_unmap()
2283 struct drm_gpuva_op_unmap unmap = { .va = va }; in __drm_gpuvm_sm_unmap()
2292 ret = op_unmap_cb(ops, priv, va, false); in __drm_gpuvm_sm_unmap()
2637 struct drm_gpuva *va; in drm_gpuvm_prefetch_ops_create() local
2647 drm_gpuvm_for_each_va_range(va, gpuvm, addr, end) { in drm_gpuvm_prefetch_ops_create()
2655 op->prefetch.va = va; in drm_gpuvm_prefetch_ops_create()
2690 struct drm_gpuva *va; in drm_gpuvm_bo_unmap_ops_create() local
2701 drm_gpuvm_bo_for_each_va(va, vm_bo) { in drm_gpuvm_bo_unmap_ops_create()
2709 op->unmap.va = va; in drm_gpuvm_bo_unmap_ops_create()