Home
last modified time | relevance | path

Searched refs:tbo (Results 1 – 25 of 42) sorted by relevance

12

/linux/drivers/gpu/drm/loongson/
H A Dlsdc_ttm.c54 if (lbo->tbo.base.size <= PAGE_SIZE) in lsdc_bo_set_placement()
94 lsdc_ttm_tt_create(struct ttm_buffer_object *tbo, uint32_t page_flags) in lsdc_ttm_tt_create() argument
103 ret = ttm_sg_tt_init(tt, tbo, page_flags, ttm_cached); in lsdc_ttm_tt_create()
140 static void lsdc_bo_evict_flags(struct ttm_buffer_object *tbo, in lsdc_bo_evict_flags() argument
143 struct ttm_resource *resource = tbo->resource; in lsdc_bo_evict_flags()
144 struct lsdc_bo *lbo = to_lsdc_bo(tbo); in lsdc_bo_evict_flags()
159 static int lsdc_bo_move(struct ttm_buffer_object *tbo, in lsdc_bo_move() argument
165 struct drm_device *ddev = tbo->base.dev; in lsdc_bo_move()
166 struct ttm_resource *old_mem = tbo->resource; in lsdc_bo_move()
167 struct lsdc_bo *lbo = to_lsdc_bo(tbo); in lsdc_bo_move()
[all …]
H A Dlsdc_ttm.h24 struct ttm_buffer_object tbo; member
52 static inline struct lsdc_bo *to_lsdc_bo(struct ttm_buffer_object *tbo) in to_lsdc_bo() argument
54 return container_of(tbo, struct lsdc_bo, tbo); in to_lsdc_bo()
59 return container_of(gem, struct lsdc_bo, tbo.base); in gem_to_lsdc_bo()
H A Dlsdc_drv.c346 struct ttm_buffer_object *tbo = &lbo->tbo; in lsdc_drm_freeze() local
347 struct ttm_resource *resource = tbo->resource; in lsdc_drm_freeze()
348 unsigned int pin_count = tbo->pin_count; in lsdc_drm_freeze()
/linux/drivers/gpu/drm/qxl/
H A Dqxl_object.c32 static void qxl_ttm_bo_destroy(struct ttm_buffer_object *tbo) in qxl_ttm_bo_destroy() argument
37 bo = to_qxl_bo(tbo); in qxl_ttm_bo_destroy()
38 qdev = to_qxl(bo->tbo.base.dev); in qxl_ttm_bo_destroy()
45 drm_gem_object_release(&bo->tbo.base); in qxl_ttm_bo_destroy()
62 if (qbo->tbo.base.size <= PAGE_SIZE) in qxl_ttm_placement_from_domain()
123 r = drm_gem_object_init(&qdev->ddev, &bo->tbo.base, size); in qxl_bo_create()
128 bo->tbo.base.funcs = &qxl_object_funcs; in qxl_bo_create()
138 bo->tbo.priority = priority; in qxl_bo_create()
139 r = ttm_bo_init_reserved(&qdev->mman.bdev, &bo->tbo, type, in qxl_bo_create()
150 ttm_bo_pin(&bo->tbo); in qxl_bo_create()
[all …]
H A Dqxl_object.h34 r = ttm_bo_reserve(&bo->tbo, true, false, NULL); in qxl_bo_reserve()
37 struct drm_device *ddev = bo->tbo.base.dev; in qxl_bo_reserve()
48 ttm_bo_unreserve(&bo->tbo); in qxl_bo_unreserve()
53 return bo->tbo.base.size; in qxl_bo_size()
H A Dqxl_drv.h73 struct ttm_buffer_object tbo; member
94 #define gem_to_qxl_bo(gobj) container_of((gobj), struct qxl_bo, tbo.base)
95 #define to_qxl_bo(tobj) container_of((tobj), struct qxl_bo, tbo)
284 (bo->tbo.resource->mem_type == TTM_PL_VRAM) in qxl_bo_physical_address()
289 return slot->high_bits | ((bo->tbo.resource->start << PAGE_SHIFT) + offset); in qxl_bo_physical_address()
/linux/drivers/gpu/drm/radeon/
H A Dradeon_object.c52 static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo) in radeon_ttm_bo_destroy() argument
56 bo = container_of(tbo, struct radeon_bo, tbo); in radeon_ttm_bo_destroy()
63 if (bo->tbo.base.import_attach) in radeon_ttm_bo_destroy()
64 drm_prime_gem_destroy(&bo->tbo.base, bo->tbo.sg); in radeon_ttm_bo_destroy()
65 drm_gem_object_release(&bo->tbo.base); in radeon_ttm_bo_destroy()
153 drm_gem_private_object_init(rdev_to_drm(rdev), &bo->tbo.base, size); in radeon_bo_create()
154 bo->tbo.base.funcs = &radeon_gem_object_funcs; in radeon_bo_create()
204 r = ttm_bo_init_validate(&rdev->mman.bdev, &bo->tbo, type, in radeon_bo_create()
223 r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_KERNEL, in radeon_bo_kmap()
234 r = ttm_bo_kmap(&bo->tbo, 0, PFN_UP(bo->tbo.base.size), &bo->kmap); in radeon_bo_kmap()
[all …]
H A Dradeon_object.h68 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in radeon_bo_reserve()
79 ttm_bo_unreserve(&bo->tbo); in radeon_bo_unreserve()
96 rdev = radeon_get_rdev(bo->tbo.bdev); in radeon_bo_gpu_offset()
98 switch (bo->tbo.resource->mem_type) { in radeon_bo_gpu_offset()
107 return (bo->tbo.resource->start << PAGE_SHIFT) + start; in radeon_bo_gpu_offset()
112 return bo->tbo.base.size; in radeon_bo_size()
117 return bo->tbo.base.size / RADEON_GPU_PAGE_SIZE; in radeon_bo_ngpu_pages()
122 return (bo->tbo.page_alignment << PAGE_SHIFT) / RADEON_GPU_PAGE_SIZE; in radeon_bo_gpu_page_alignment()
133 return drm_vma_node_offset_addr(&bo->tbo.base.vma_node); in radeon_bo_mmap_offset()
H A Dradeon_mn.c57 if (!bo->tbo.ttm || !radeon_ttm_tt_is_bound(bo->tbo.bdev, bo->tbo.ttm)) in radeon_mn_invalidate()
69 r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_BOOKKEEP, in radeon_mn_invalidate()
75 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in radeon_mn_invalidate()
H A 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()
61 bo->tbo.base.funcs = &radeon_gem_object_funcs; in radeon_gem_prime_import_sg_table()
68 return &bo->tbo.base; in radeon_gem_prime_import_sg_table()
98 if (radeon_ttm_tt_has_userptr(bo->rdev, bo->tbo.ttm)) in radeon_gem_prime_export()
H A Dradeon_cs.c161 if (radeon_ttm_tt_has_userptr(p->rdev, p->relocs[i].robj->tbo.ttm)) { in radeon_cs_parser_relocs()
255 resv = reloc->robj->tbo.base.resv; in radeon_cs_sync_rings()
400 if (la->robj->tbo.base.size > lb->robj->tbo.base.size) in cmp_size_smaller_first()
402 if (la->robj->tbo.base.size < lb->robj->tbo.base.size) in cmp_size_smaller_first()
434 dma_resv_add_fence(reloc->robj->tbo.base.resv, in radeon_cs_parser_fini()
450 drm_gem_object_put(&bo->tbo.base); in radeon_cs_parser_fini()
522 rdev->ring_tmp_bo.bo->tbo.resource); in radeon_bo_vm_update_pte()
536 r = radeon_vm_bo_update(rdev, bo_va, bo->tbo.resource); in radeon_bo_vm_update_pte()
542 r = dma_resv_reserve_fences(bo->tbo.base.resv, 1); in radeon_bo_vm_update_pte()
H A Dradeon_benchmark.c125 dobj->tbo.base.resv); in radeon_benchmark_move()
136 dobj->tbo.base.resv); in radeon_benchmark_move()
H A Dradeon_test.c123 vram_obj->tbo.base.resv); in radeon_do_test_moves()
127 vram_obj->tbo.base.resv); in radeon_do_test_moves()
174 vram_obj->tbo.base.resv); in radeon_do_test_moves()
178 vram_obj->tbo.base.resv); in radeon_do_test_moves()
/linux/drivers/gpu/drm/vmwgfx/
H A Dvmwgfx_bo.c45 WARN_ON(kref_read(&vbo->tbo.base.refcount) != 0); in vmw_bo_free()
72 drm_gem_object_release(&vbo->tbo.base); in vmw_bo_free()
93 struct ttm_buffer_object *bo = &buf->tbo; in vmw_bo_pin_in_placement()
129 struct ttm_buffer_object *bo = &buf->tbo; in vmw_bo_pin_in_vram_or_gmr()
198 struct ttm_buffer_object *bo = &buf->tbo; in vmw_bo_pin_in_start_of_vram()
214 buf->tbo.pin_count == 0) { in vmw_bo_pin_in_start_of_vram()
255 struct ttm_buffer_object *bo = &buf->tbo; in vmw_bo_unpin()
302 struct ttm_buffer_object *bo = &vbo->tbo; in vmw_bo_pin_reserved()
347 return vmw_bo_map_and_cache_size(vbo, vbo->tbo.base.size); in vmw_bo_map_and_cache()
352 struct ttm_buffer_object *bo = &vbo->tbo; in vmw_bo_map_and_cache_size()
[all …]
H A Dvmwgfx_page_dirty.c71 pgoff_t offset = drm_vma_node_start(&vbo->tbo.base.vma_node); in vmw_bo_dirty_scan_pagetable()
72 struct address_space *mapping = vbo->tbo.bdev->dev_mapping; in vmw_bo_dirty_scan_pagetable()
109 unsigned long offset = drm_vma_node_start(&vbo->tbo.base.vma_node); in vmw_bo_dirty_scan_mkwrite()
110 struct address_space *mapping = vbo->tbo.bdev->dev_mapping; in vmw_bo_dirty_scan_mkwrite()
116 num_marked = wp_shared_mapping_range(vbo->tbo.bdev->dev_mapping, in vmw_bo_dirty_scan_mkwrite()
174 unsigned long offset = drm_vma_node_start(&vbo->tbo.base.vma_node); in vmw_bo_dirty_pre_unmap()
175 struct address_space *mapping = vbo->tbo.bdev->dev_mapping; in vmw_bo_dirty_pre_unmap()
198 unsigned long offset = drm_vma_node_start(&vbo->tbo.base.vma_node); in vmw_bo_dirty_unmap()
199 struct address_space *mapping = vbo->tbo.bdev->dev_mapping; in vmw_bo_dirty_unmap()
219 pgoff_t num_pages = PFN_UP(vbo->tbo.resource->size); in vmw_bo_dirty_add()
[all …]
H A Dvmwgfx_blit.c428 container_of(bo->tbo.bdev, struct vmw_private, bdev); in map_external()
432 if (drm_gem_is_imported(&bo->tbo.base)) { in map_external()
433 ret = dma_buf_vmap(bo->tbo.base.dma_buf, map); in map_external()
450 if (drm_gem_is_imported(&bo->tbo.base)) in unmap_external()
451 dma_buf_vunmap(bo->tbo.base.dma_buf, map); in unmap_external()
463 container_of(dst->tbo.bdev, struct vmw_private, bdev); in vmw_external_bo_copy()
464 size_t dst_size = dst->tbo.resource->size; in vmw_external_bo_copy()
465 size_t src_size = src->tbo.resource->size; in vmw_external_bo_copy()
548 struct ttm_buffer_object *src = &vmw_src->tbo; in vmw_bo_cpu_blit()
549 struct ttm_buffer_object *dst = &vmw_dst->tbo; in vmw_bo_cpu_blit()
H A Dvmwgfx_mob.c207 bo = &otable->page_table->pt_bo->tbo; in vmw_takedown_otable_base()
267 &batch->otable_bo->tbo, in vmw_otable_batch_setup()
284 vmw_bo_unpin_unlocked(&batch->otable_bo->tbo); in vmw_otable_batch_setup()
335 struct ttm_buffer_object *bo = &batch->otable_bo->tbo; in vmw_otable_batch_takedown()
501 struct ttm_buffer_object *bo = &mob->pt_bo->tbo; in vmw_mob_pt_setup()
538 vmw_bo_unpin_unlocked(&mob->pt_bo->tbo); in vmw_mob_destroy()
558 struct ttm_buffer_object *bo = &mob->pt_bo->tbo; in vmw_mob_unbind()
650 vmw_bo_unpin_unlocked(&mob->pt_bo->tbo); in vmw_mob_bind()
H A Dvmwgfx_shader.c283 BUG_ON(res->guest_memory_bo->tbo.resource->mem_type != VMW_PL_MOB); in vmw_gb_shader_unbind()
403 cmd->body.mobid = res->guest_memory_bo->tbo.resource->start; in vmw_dx_shader_unscrub()
514 BUG_ON(res->guest_memory_bo->tbo.resource->mem_type != VMW_PL_MOB); in vmw_dx_shader_unbind()
788 if ((u64)buffer->tbo.base.size < (u64)size + (u64)offset) { in vmw_shader_define()
911 ret = ttm_bo_kmap(&buf->tbo, 0, PFN_UP(size), &map); in vmw_compat_shader_add()
913 ttm_bo_unreserve(&buf->tbo); in vmw_compat_shader_add()
921 ret = ttm_bo_validate(&buf->tbo, &buf->placement, &ctx); in vmw_compat_shader_add()
923 ttm_bo_unreserve(&buf->tbo); in vmw_compat_shader_add()
H A Dvmwgfx_cotable.c185 struct ttm_buffer_object *bo = &res->guest_memory_bo->tbo; in vmw_cotable_unscrub()
233 val_buf->bo = &res->guest_memory_bo->tbo; in vmw_cotable_bind()
381 vmw_bo_fence_single(&res->guest_memory_bo->tbo, fence); in vmw_cotable_readback()
405 struct ttm_buffer_object *bo, *old_bo = &res->guest_memory_bo->tbo; in vmw_cotable_resize()
441 bo = &buf->tbo; in vmw_cotable_resize()
H A Dvmwgfx_ttm_buffer.c583 ret = vmw_ttm_populate(vbo->tbo.bdev, vbo->tbo.ttm, &ctx); in vmw_bo_create_and_populate()
586 container_of(vbo->tbo.ttm, struct vmw_ttm_tt, dma_ttm); in vmw_bo_create_and_populate()
590 ttm_bo_unreserve(&vbo->tbo); in vmw_bo_create_and_populate()
/linux/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_object.h109 struct ttm_buffer_object tbo; member
144 static inline struct amdgpu_bo *ttm_to_amdgpu_bo(struct ttm_buffer_object *tbo) in ttm_to_amdgpu_bo() argument
146 return container_of(tbo, struct amdgpu_bo, tbo); in ttm_to_amdgpu_bo()
189 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_reserve()
192 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in amdgpu_bo_reserve()
203 ttm_bo_unreserve(&bo->tbo); in amdgpu_bo_unreserve()
208 return bo->tbo.base.size; in amdgpu_bo_size()
213 return bo->tbo.base.size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_ngpu_pages()
218 return (bo->tbo.page_alignment << PAGE_SHIFT) / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_gpu_page_alignment()
229 return drm_vma_node_offset_addr(&bo->tbo.base.vma_node); in amdgpu_bo_mmap_offset()
H A Damdgpu_preempt_mgr.c60 struct ttm_buffer_object *tbo, in amdgpu_preempt_mgr_new() argument
68 ttm_resource_init(tbo, place, *res); in amdgpu_preempt_mgr_new()
H A Damdgpu_gart.c183 bo->tbo.sg = sg; in amdgpu_gart_table_ram_alloc()
184 bo->tbo.ttm->sg = sg; in amdgpu_gart_table_ram_alloc()
202 ret = amdgpu_ttm_alloc_gart(&adev->gart.bo->tbo); in amdgpu_gart_table_ram_alloc()
232 struct sg_table *sg = adev->gart.bo->tbo.sg; in amdgpu_gart_table_ram_free()
H A Damdgpu_seq64.c83 r = drm_exec_lock_obj(&exec, &bo->tbo.base); in amdgpu_seq64_map()
146 r = drm_exec_lock_obj(&exec, &bo->tbo.base); in amdgpu_seq64_unmap()
/linux/drivers/gpu/drm/xe/
H A Dxe_ttm_sys_mgr.c18 struct ttm_buffer_object *tbo; member
29 struct ttm_buffer_object *tbo, in xe_ttm_sys_mgr_new() argument
40 node->tbo = tbo; in xe_ttm_sys_mgr_new()
41 ttm_resource_init(tbo, place, &node->base.base); in xe_ttm_sys_mgr_new()

12