Home
last modified time | relevance | path

Searched refs:ttm (Results 1 – 25 of 36) sorted by relevance

12

/openbsd/src/sys/dev/pci/drm/ttm/
Dttm_tt.c72 if (bo->ttm) in ttm_tt_create()
99 bo->ttm = bdev->funcs->ttm_tt_create(bo, page_flags); in ttm_tt_create()
100 if (unlikely(bo->ttm == NULL)) in ttm_tt_create()
103 WARN_ON(bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL_MAPPABLE && in ttm_tt_create()
104 !(bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL)); in ttm_tt_create()
113 static int ttm_tt_alloc_page_directory(struct ttm_tt *ttm) in ttm_tt_alloc_page_directory() argument
115 ttm->pages = kvcalloc(ttm->num_pages, sizeof(void*), GFP_KERNEL); in ttm_tt_alloc_page_directory()
116 if (!ttm->pages) in ttm_tt_alloc_page_directory()
118 ttm->orders = kvmalloc_array(ttm->num_pages, in ttm_tt_alloc_page_directory()
120 if (!ttm->orders) in ttm_tt_alloc_page_directory()
[all …]
Dttm_agp_backend.c45 struct ttm_tt ttm; member
50 int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem) in ttm_agp_bind() argument
55 struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); in ttm_agp_bind()
58 int ret, cached = ttm->caching == ttm_cached; in ttm_agp_bind()
64 mem = agp_allocate_memory(agp_be->bridge, ttm->num_pages, AGP_USER_MEMORY); in ttm_agp_bind()
69 for (i = 0; i < ttm->num_pages; i++) { in ttm_agp_bind()
70 struct vm_page *page = ttm->pages[i]; in ttm_agp_bind()
91 void ttm_agp_unbind(struct ttm_tt *ttm) in ttm_agp_unbind() argument
95 struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); in ttm_agp_unbind()
109 bool ttm_agp_is_bound(struct ttm_tt *ttm) in ttm_agp_is_bound() argument
[all …]
Dttm_bo_util.c150 struct ttm_tt *ttm = bo->ttm; in ttm_bo_move_memcpy() local
165 if (ttm && ((ttm->page_flags & TTM_TT_FLAG_SWAPPED) || in ttm_bo_move_memcpy()
167 ret = ttm_tt_populate(bdev, ttm, ctx); in ttm_bo_move_memcpy()
174 dst_iter = ttm_kmap_iter_tt_init(&_dst_iter.tt, bo->ttm); in ttm_bo_move_memcpy()
180 src_iter = ttm_kmap_iter_tt_init(&_src_iter.tt, bo->ttm); in ttm_bo_move_memcpy()
186 clear = src_iter->ops->maps_tt && (!ttm || !ttm_tt_is_populated(ttm)); in ttm_bo_move_memcpy()
187 if (!(clear && ttm && !(ttm->page_flags & TTM_TT_FLAG_ZERO_ALLOC))) in ttm_bo_move_memcpy()
300 caching = bo->ttm->caching; in ttm_io_prot()
301 if (bo->ttm->page_flags & TTM_TT_FLAG_DECRYPTED) in ttm_io_prot()
356 struct ttm_tt *ttm = bo->ttm; in ttm_bo_kmap_ttm() local
[all …]
Dttm_bo_vm.c154 if (bo->ttm && (bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL)) { in ttm_bo_vm_reserve()
155 if (!(bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL_MAPPABLE)) { in ttm_bo_vm_reserve()
193 struct ttm_tt *ttm = NULL; in ttm_bo_vm_fault_reserved() local
228 ttm = bo->ttm; in ttm_bo_vm_fault_reserved()
229 err = ttm_tt_populate(bdev, bo->ttm, &ctx); in ttm_bo_vm_fault_reserved()
251 page = ttm->pages[page_offset]; in ttm_bo_vm_fault_reserved()
469 if (bo->ttm && (bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL)) { in ttm_bo_vm_reserve()
470 if (!(bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL_MAPPABLE)) { in ttm_bo_vm_reserve()
490 struct ttm_tt *ttm = NULL; in ttm_bo_vm_fault_reserved() local
531 ttm = bo->ttm; in ttm_bo_vm_fault_reserved()
[all …]
Dttm_bo.c142 ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx); in ttm_bo_handle_move_mem()
274 (want_init_on_free() && (bo->ttm != NULL)) || in ttm_bo_release()
1030 } else if (bo->ttm) { in ttm_bo_unmap_virtual()
1031 for (i = 0; i < bo->ttm->num_pages; i++) { in ttm_bo_unmap_virtual()
1032 pg = bo->ttm->pages[i]; in ttm_bo_unmap_virtual()
1105 if (!bo->ttm || !ttm_tt_is_populated(bo->ttm) || in ttm_bo_swapout_cb()
1106 bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL || in ttm_bo_swapout_cb()
1107 bo->ttm->page_flags & TTM_TT_FLAG_SWAPPED) { in ttm_bo_swapout_cb()
1113 pgoff_t num_pages = bo->ttm->num_pages; in ttm_bo_swapout_cb()
1157 if (ttm_tt_is_populated(bo->ttm)) in ttm_bo_swapout_cb()
[all …]
Dttm_device.c268 if (bo->ttm) in ttm_device_clear_lru_dma_mappings()
269 ttm_tt_unpopulate(bo->bdev, bo->ttm); in ttm_device_clear_lru_dma_mappings()
/openbsd/src/sys/dev/pci/drm/radeon/
Dradeon_ttm.c64 static int radeon_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm,
66 static void radeon_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm);
206 r = radeon_ttm_tt_bind(bo->bdev, bo->ttm, new_mem); in radeon_bo_move()
217 bo->ttm == NULL)) { in radeon_bo_move()
229 radeon_ttm_tt_unbind(bo->bdev, bo->ttm); in radeon_bo_move()
322 struct ttm_tt ttm; member
332 static int radeon_ttm_tt_pin_userptr(struct ttm_device *bdev, struct ttm_tt *ttm) in radeon_ttm_tt_pin_userptr() argument
338 struct radeon_ttm_tt *gtt = (void *)ttm; in radeon_ttm_tt_pin_userptr()
352 unsigned long end = gtt->userptr + (u64)ttm->num_pages * PAGE_SIZE; in radeon_ttm_tt_pin_userptr()
360 unsigned num_pages = ttm->num_pages - pinned; in radeon_ttm_tt_pin_userptr()
[all …]
Dradeon_prime.c41 return drm_prime_pages_to_sg(obj->dev, bo->tbo.ttm->pages, in radeon_gem_prime_get_sg_table()
42 bo->tbo.ttm->num_pages); in radeon_gem_prime_get_sg_table()
100 if (radeon_ttm_tt_has_userptr(bo->rdev, bo->tbo.ttm)) in radeon_gem_prime_export()
Dradeon_mn.c57 if (!bo->tbo.ttm || !radeon_ttm_tt_is_bound(bo->tbo.bdev, bo->tbo.ttm)) in radeon_mn_invalidate()
Dradeon_gem.c347 if (radeon_ttm_tt_has_userptr(rdev, bo->tbo.ttm)) in radeon_gem_object_mmap()
360 if (radeon_ttm_tt_has_userptr(rdev, bo->tbo.ttm)) in radeon_gem_object_mmap()
482 r = radeon_ttm_tt_set_userptr(rdev, bo->tbo.ttm, args->addr, args->flags); in radeon_gem_userptr_ioctl()
570 if (radeon_ttm_tt_has_userptr(robj->rdev, robj->tbo.ttm)) { in radeon_mode_dumb_mmap()
872 if (radeon_ttm_tt_has_userptr(robj->rdev, robj->tbo.ttm)) in radeon_gem_op_ioctl()
/openbsd/src/sys/dev/pci/drm/include/drm/ttm/
Dttm_tt.h163 int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
176 void ttm_tt_fini(struct ttm_tt *ttm);
186 void ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *ttm);
195 int ttm_tt_swapin(struct ttm_tt *ttm);
196 int ttm_tt_swapout(struct ttm_device *bdev, struct ttm_tt *ttm,
208 int ttm_tt_populate(struct ttm_device *bdev, struct ttm_tt *ttm,
219 void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm);
229 static inline void ttm_tt_mark_for_clear(struct ttm_tt *ttm) in ttm_tt_mark_for_clear() argument
231 ttm->page_flags |= TTM_TT_FLAG_ZERO_ALLOC; in ttm_tt_mark_for_clear()
257 int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem);
[all …]
Dttm_device.h86 struct ttm_tt *ttm,
97 struct ttm_tt *ttm);
108 void (*ttm_tt_destroy)(struct ttm_device *bdev, struct ttm_tt *ttm);
/openbsd/src/sys/dev/pci/drm/i915/gem/
Di915_gem_ttm.c50 struct ttm_tt ttm; member
182 struct ttm_tt *ttm, in i915_ttm_tt_shmem_populate() argument
190 struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm); in i915_ttm_tt_shmem_populate()
192 const size_t size = (size_t)ttm->num_pages << PAGE_SHIFT; in i915_ttm_tt_shmem_populate()
230 ttm->pages[i++] = page; in i915_ttm_tt_shmem_populate()
232 if (ttm->page_flags & TTM_TT_FLAG_SWAPPED) in i915_ttm_tt_shmem_populate()
233 ttm->page_flags &= ~TTM_TT_FLAG_SWAPPED; in i915_ttm_tt_shmem_populate()
244 static void i915_ttm_tt_shmem_unpopulate(struct ttm_tt *ttm) in i915_ttm_tt_shmem_unpopulate() argument
248 struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm); in i915_ttm_tt_shmem_unpopulate()
249 bool backup = ttm->page_flags & TTM_TT_FLAG_SWAPPED; in i915_ttm_tt_shmem_unpopulate()
[all …]
Di915_gem_ttm_pm.c24 if (obj->ttm.backup) { in i915_ttm_backup_free()
25 i915_gem_object_put(obj->ttm.backup); in i915_ttm_backup_free()
26 obj->ttm.backup = NULL; in i915_ttm_backup_free()
56 if (!i915_ttm_cpu_maps_iomem(bo->resource) || obj->ttm.backup) in i915_ttm_backup()
93 err = ttm_tt_populate(backup_bo->bdev, backup_bo->ttm, &ctx); in i915_ttm_backup()
106 obj->ttm.backup = backup; in i915_ttm_backup()
173 struct drm_i915_gem_object *backup = obj->ttm.backup; in i915_ttm_restore()
192 err = ttm_tt_populate(backup_bo->bdev, backup_bo->ttm, &ctx); in i915_ttm_restore()
199 obj->ttm.backup = NULL; in i915_ttm_restore()
Di915_gem_ttm_move.c53 struct ttm_tt *ttm) in i915_ttm_cache_level() argument
57 ttm->caching == ttm_cached) ? I915_CACHE_LLC : in i915_ttm_cache_level()
86 if (i915_ttm_cpu_maps_iomem(bo->resource) || bo->ttm->caching != ttm_cached) { in i915_ttm_adjust_domains_after_move()
125 bo->ttm); in i915_ttm_adjust_gem_after_move()
198 struct ttm_tt *src_ttm = bo->ttm; in i915_ttm_accel_move()
331 ttm_kmap_iter_tt_init(&arg->_src_iter.tt, bo->ttm) : in i915_ttm_memcpy_init()
333 &obj->ttm.cached_io_rsgt->table, in i915_ttm_memcpy_init()
582 struct ttm_tt *ttm = bo->ttm; in i915_ttm_move() local
629 if (ttm && (dst_man->use_tt || (ttm->page_flags & TTM_TT_FLAG_SWAPPED))) { in i915_ttm_move()
630 ret = ttm_tt_populate(bo->bdev, ttm, ctx); in i915_ttm_move()
[all …]
Di915_gem_object_types.h704 } ttm; member
/openbsd/src/sys/dev/pci/drm/amd/amdgpu/
Damdgpu_ttm.c69 struct ttm_tt *ttm,
72 struct ttm_tt *ttm);
244 flags = amdgpu_ttm_tt_pte_flags(adev, bo->ttm, mem); in amdgpu_ttm_map_buffer()
253 dma_addr = &bo->ttm->dma_address[mm_cur->start >> PAGE_SHIFT]; in amdgpu_ttm_map_buffer()
497 r = amdgpu_ttm_backend_bind(bo->bdev, bo->ttm, new_mem); in amdgpu_bo_move()
506 bo->ttm == NULL)) { in amdgpu_bo_move()
525 amdgpu_ttm_backend_unbind(bo->bdev, bo->ttm); in amdgpu_bo_move()
673 struct ttm_tt ttm; member
683 #define ttm_to_amdgpu_ttm_tt(ptr) container_of(ptr, struct amdgpu_ttm_tt, ttm)
696 struct ttm_tt *ttm = bo->tbo.ttm; in amdgpu_ttm_tt_get_user_pages() local
[all …]
Damdgpu_ttm.h190 void amdgpu_ttm_tt_discard_user_pages(struct ttm_tt *ttm,
192 bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm,
201 static inline void amdgpu_ttm_tt_discard_user_pages(struct ttm_tt *ttm, in amdgpu_ttm_tt_discard_user_pages() argument
205 static inline bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm, in amdgpu_ttm_tt_get_user_pages_done() argument
212 void amdgpu_ttm_tt_set_user_pages(struct ttm_tt *ttm, struct vm_page **pages);
217 bool amdgpu_ttm_tt_has_userptr(struct ttm_tt *ttm);
218 struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm);
219 bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start,
221 bool amdgpu_ttm_tt_userptr_invalidated(struct ttm_tt *ttm,
223 bool amdgpu_ttm_tt_is_userptr(struct ttm_tt *ttm);
[all …]
Damdgpu_amdkfd_gpuvm.c415 if (WARN(amdgpu_ttm_tt_get_usermm(bo->tbo.ttm), in amdgpu_amdkfd_bo_validate()
560 struct ttm_tt *src_ttm = mem->bo->tbo.ttm; in kfd_mem_dmamap_userptr()
561 struct ttm_tt *ttm = bo->tbo.ttm; in kfd_mem_dmamap_userptr() local
564 if (WARN_ON(ttm->num_pages != src_ttm->num_pages)) in kfd_mem_dmamap_userptr()
567 ttm->sg = kmalloc(sizeof(*ttm->sg), GFP_KERNEL); in kfd_mem_dmamap_userptr()
568 if (unlikely(!ttm->sg)) in kfd_mem_dmamap_userptr()
572 ret = sg_alloc_table_from_pages(ttm->sg, src_ttm->pages, in kfd_mem_dmamap_userptr()
573 ttm->num_pages, 0, in kfd_mem_dmamap_userptr()
574 (u64)ttm->num_pages << PAGE_SHIFT, in kfd_mem_dmamap_userptr()
579 ret = dma_map_sgtable(adev->dev, ttm->sg, direction, 0); in kfd_mem_dmamap_userptr()
[all …]
Damdgpu_dma_buf.c146 bo->tbo.ttm->pages, in amdgpu_dma_buf_map()
147 bo->tbo.ttm->num_pages); in amdgpu_dma_buf_map()
273 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm) || in amdgpu_gem_prime_export()
Damdgpu_gmc.c111 *addr = bo->tbo.ttm->dma_address[0]; in amdgpu_gmc_get_pde_for_bo()
120 *flags = amdgpu_ttm_tt_pde_flags(bo->tbo.ttm, bo->tbo.resource); in amdgpu_gmc_get_pde_for_bo()
184 if (!bo->ttm) in amdgpu_gmc_agp_addr()
187 if (bo->ttm->num_pages != 1 || bo->ttm->caching == ttm_cached) in amdgpu_gmc_agp_addr()
190 if (bo->ttm->dma_address[0] + PAGE_SIZE >= adev->gmc.agp_size) in amdgpu_gmc_agp_addr()
193 return adev->gmc.agp_start + bo->ttm->dma_address[0]; in amdgpu_gmc_agp_addr()
Damdgpu_gem.c260 mm = amdgpu_ttm_tt_get_usermm(abo->tbo.ttm);
370 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm))
392 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm))
581 r = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages,
605 amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, range);
626 if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm) ||
1000 if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm)) {
Damdgpu_cs.c143 if (amdgpu_ttm_tt_get_usermm(p->uf_bo->tbo.ttm)) in amdgpu_cs_p1_user_fence()
878 e->user_pages = kvcalloc(bo->tbo.ttm->num_pages, in amdgpu_cs_parser_bos()
894 for (i = 0; i < bo->tbo.ttm->num_pages; i++) { in amdgpu_cs_parser_bos()
895 if (bo->tbo.ttm->pages[i] != e->user_pages[i]) { in amdgpu_cs_parser_bos()
933 usermm = amdgpu_ttm_tt_get_usermm(e->bo->tbo.ttm); in amdgpu_cs_parser_bos()
940 if (amdgpu_ttm_tt_is_userptr(e->bo->tbo.ttm) && in amdgpu_cs_parser_bos()
949 amdgpu_ttm_tt_set_user_pages(e->bo->tbo.ttm, in amdgpu_cs_parser_bos()
998 amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, e->range); in amdgpu_cs_parser_bos()
1324 r |= !amdgpu_ttm_tt_get_user_pages_done(e->bo->tbo.ttm, in amdgpu_cs_submit()
/openbsd/src/sys/dev/pci/drm/
Dfiles.drm98 define ttm
99 file dev/pci/drm/drm_gem_ttm_helper.c ttm
100 file dev/pci/drm/ttm/ttm_agp_backend.c ttm & agp
101 file dev/pci/drm/ttm/ttm_bo.c ttm
102 file dev/pci/drm/ttm/ttm_bo_util.c ttm
103 file dev/pci/drm/ttm/ttm_bo_vm.c ttm
104 file dev/pci/drm/ttm/ttm_device.c ttm
105 file dev/pci/drm/ttm/ttm_execbuf_util.c ttm
106 file dev/pci/drm/ttm/ttm_module.c ttm
107 file dev/pci/drm/ttm/ttm_pool.c ttm
[all …]
/openbsd/src/sys/dev/pci/drm/i915/
DTODO.txt20 This is the matching task on the vm side compared to ttm/dma_resv on the

12