Home
last modified time | relevance | path

Searched refs:bo (Results 1 – 25 of 246) sorted by relevance

12345678910

/linux/drivers/gpu/drm/xe/
H A Dxe_bo.h119 void xe_bo_free(struct xe_bo *bo);
121 struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo,
149 void xe_managed_bo_unpin_map_no_vm(struct xe_bo *bo);
154 int xe_bo_placement_for_flags(struct xe_device *xe, struct xe_bo *bo,
157 static inline struct xe_bo *ttm_to_xe_bo(const struct ttm_buffer_object *bo) in ttm_to_xe_bo() argument
159 return container_of(bo, struct xe_bo, ttm); in ttm_to_xe_bo()
167 #define xe_bo_device(bo) ttm_to_xe_device((bo)->ttm.bdev) argument
169 static inline struct xe_bo *xe_bo_get(struct xe_bo *bo) in xe_bo_get() argument
171 if (bo) in xe_bo_get()
193 xe_bo_get_unless_zero(struct xe_bo * bo) xe_bo_get_unless_zero() argument
201 __xe_bo_unset_bulk_move(struct xe_bo * bo) __xe_bo_unset_bulk_move() argument
207 xe_bo_assert_held(struct xe_bo * bo) xe_bo_assert_held() argument
217 xe_bo_unlock_vm_held(struct xe_bo * bo) xe_bo_unlock_vm_held() argument
235 xe_bo_is_pinned(struct xe_bo * bo) xe_bo_is_pinned() argument
240 xe_bo_is_protected(const struct xe_bo * bo) xe_bo_is_protected() argument
256 xe_bo_is_purged(struct xe_bo * bo) xe_bo_is_purged() argument
273 xe_bo_madv_is_dontneed(struct xe_bo * bo) xe_bo_madv_is_dontneed() argument
290 xe_bo_willneed_get_locked(struct xe_bo * bo) xe_bo_willneed_get_locked() argument
315 xe_bo_willneed_put_locked(struct xe_bo * bo) xe_bo_willneed_put_locked() argument
336 xe_bo_vma_count_inc_locked(struct xe_bo * bo) xe_bo_vma_count_inc_locked() argument
354 xe_bo_vma_count_dec_locked(struct xe_bo * bo) xe_bo_vma_count_dec_locked() argument
365 xe_bo_unpin_map_no_vm(struct xe_bo * bo) xe_bo_unpin_map_no_vm() argument
381 xe_bo_main_addr(struct xe_bo * bo,size_t page_size) xe_bo_main_addr() argument
394 xe_bo_size(struct xe_bo * bo) xe_bo_size() argument
400 __xe_bo_ggtt_addr(struct xe_bo * bo,u8 tile_id) __xe_bo_ggtt_addr() argument
414 xe_bo_ggtt_addr(struct xe_bo * bo) xe_bo_ggtt_addr() argument
464 xe_bo_ccs_pages_start(struct xe_bo * bo) xe_bo_ccs_pages_start() argument
478 xe_bo_has_valid_ccs_bb(struct xe_bo * bo) xe_bo_has_valid_ccs_bb() argument
484 xe_bo_has_pages(struct xe_bo * bo) xe_bo_has_pages() argument
519 xe_bo_put_deferred(struct xe_bo * bo,struct llist_head * deferred) xe_bo_put_deferred() argument
541 xe_bo_put_async(struct xe_bo * bo) xe_bo_put_async() argument
563 xe_bo_sg_is_contiguous(struct xe_bo * bo,size_t len) xe_bo_sg_is_contiguous() argument
631 xe_bo_is_mem_type(struct xe_bo * bo,u32 mem_type) xe_bo_is_mem_type() argument
[all...]
H A Dxe_bo.c105 bool xe_bo_is_vram(struct xe_bo *bo) in xe_bo_is_vram() argument
107 return resource_is_vram(bo->ttm.resource) || in xe_bo_is_vram()
108 resource_is_stolen_vram(xe_bo_device(bo), bo->ttm.resource); in xe_bo_is_vram()
111 bool xe_bo_is_stolen(struct xe_bo *bo) in xe_bo_is_stolen() argument
113 return bo->ttm.resource->mem_type == XE_PL_STOLEN; in xe_bo_is_stolen()
118 * @bo: The BO
125 bool xe_bo_has_single_placement(struct xe_bo *bo) in xe_bo_has_single_placement() argument
127 return bo->placement.num_placement == 1; in xe_bo_has_single_placement()
132 * @bo
139 xe_bo_is_stolen_devmem(struct xe_bo * bo) xe_bo_is_stolen_devmem() argument
154 xe_bo_is_vm_bound(struct xe_bo * bo) xe_bo_is_vm_bound() argument
161 xe_bo_is_user(struct xe_bo * bo) xe_bo_is_user() argument
176 try_add_system(struct xe_device * xe,struct xe_bo * bo,u32 bo_flags,u32 * c) try_add_system() argument
230 add_vram(struct xe_device * xe,struct xe_bo * bo,struct ttm_place * places,u32 bo_flags,u32 mem_type,u32 * c) add_vram() argument
261 try_add_vram(struct xe_device * xe,struct xe_bo * bo,u32 bo_flags,enum ttm_bo_type type,u32 * c) try_add_vram() argument
273 try_add_stolen(struct xe_device * xe,struct xe_bo * bo,u32 bo_flags,u32 * c) try_add_stolen() argument
288 __xe_bo_placement_for_flags(struct xe_device * xe,struct xe_bo * bo,u32 bo_flags,enum ttm_bo_type type) __xe_bo_placement_for_flags() argument
308 xe_bo_placement_for_flags(struct xe_device * xe,struct xe_bo * bo,u32 bo_flags,enum ttm_bo_type type) xe_bo_placement_for_flags() argument
320 struct xe_bo *bo; xe_evict_flags() local
426 xe_bo_sg(struct xe_bo * bo) xe_bo_sg() argument
474 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_ttm_tt_create() local
624 xe_bo_is_visible_vram(struct xe_bo * bo) xe_bo_is_visible_vram() argument
669 xe_bo_trigger_rebind(struct xe_device * xe,struct xe_bo * bo,const struct ttm_operation_ctx * ctx) xe_bo_trigger_rebind() argument
805 xe_bo_move_notify(struct xe_bo * bo,const struct ttm_operation_ctx * ctx) xe_bo_move_notify() argument
854 xe_bo_set_purgeable_shrinker(struct xe_bo * bo,enum xe_madv_purgeable_state new_state) xe_bo_set_purgeable_shrinker() argument
892 xe_bo_set_purgeable_state(struct xe_bo * bo,enum xe_madv_purgeable_state new_state) xe_bo_set_purgeable_state() argument
926 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_ttm_bo_purge() local
968 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_bo_move() local
1210 xe_bo_shrink_purge(struct ttm_operation_ctx * ctx,struct ttm_buffer_object * bo,unsigned long * scanned) xe_bo_shrink_purge() argument
1248 xe_bo_eviction_valuable(struct ttm_buffer_object * bo,const struct ttm_place * place) xe_bo_eviction_valuable() argument
1284 xe_bo_shrink(struct ttm_operation_ctx * ctx,struct ttm_buffer_object * bo,const struct xe_bo_shrink_flags flags,unsigned long * scanned) xe_bo_shrink() argument
1352 xe_bo_notifier_prepare_pinned(struct xe_bo * bo) xe_bo_notifier_prepare_pinned() argument
1408 xe_bo_notifier_unprepare_pinned(struct xe_bo * bo) xe_bo_notifier_unprepare_pinned() argument
1421 xe_bo_evict_pinned_copy(struct xe_bo * bo,struct xe_bo * backup) xe_bo_evict_pinned_copy() argument
1489 xe_bo_evict_pinned(struct xe_bo * bo) xe_bo_evict_pinned() argument
1555 xe_bo_restore_pinned(struct xe_bo * bo) xe_bo_restore_pinned() argument
1633 xe_bo_dma_unmap_pinned(struct xe_bo * bo) xe_bo_dma_unmap_pinned() argument
1662 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_ttm_io_mem_pfn() local
1706 struct xe_bo *bo; xe_ttm_bo_release_notify() local
1743 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_ttm_bo_delete_mem_notify() local
1786 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_ttm_access_memory() local
1853 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_ttm_bo_destroy() local
1911 struct xe_bo *bo = gem_to_xe_bo(obj); xe_gem_object_close() local
1922 should_migrate_to_smem(struct xe_bo * bo) should_migrate_to_smem() argument
1934 xe_bo_wait_usage_kernel(struct xe_bo * bo,struct ttm_operation_ctx * ctx) xe_bo_wait_usage_kernel() argument
1953 xe_bo_fault_migrate(struct xe_bo * bo,struct ttm_operation_ctx * ctx,struct drm_exec * exec) xe_bo_fault_migrate() argument
1972 __xe_bo_cpu_fault(struct vm_fault * vmf,struct xe_device * xe,struct xe_bo * bo) __xe_bo_cpu_fault() argument
2025 xe_bo_cpu_fault_fastpath(struct vm_fault * vmf,struct xe_device * xe,struct xe_bo * bo,bool needs_rpm) xe_bo_cpu_fault_fastpath() argument
2095 struct xe_bo *bo = ttm_to_xe_bo(tbo); xe_bo_cpu_fault() local
2200 struct xe_bo *bo = ttm_to_xe_bo(ttm_bo); xe_bo_vm_access() local
2218 xe_bo_read(struct xe_bo * bo,u64 offset,void * dst,int size) xe_bo_read() argument
2240 struct xe_bo *bo = gem_to_xe_bo(obj); xe_gem_object_mmap() local
2286 struct xe_bo *bo = kzalloc_obj(*bo); xe_bo_alloc() local
2300 xe_bo_free(struct xe_bo * bo) xe_bo_free() argument
2328 xe_bo_init_locked(struct xe_device * xe,struct xe_bo * bo,struct xe_tile * tile,struct dma_resv * resv,struct ttm_lru_bulk_move * bulk,size_t size,u16 cpu_caching,enum ttm_bo_type type,u32 flags,struct dma_buf * dma_buf,struct drm_exec * exec) xe_bo_init_locked() argument
2488 __xe_bo_fixed_placement(struct xe_device * xe,struct xe_bo * bo,enum ttm_bo_type type,u32 flags,u64 start,u64 end,u64 size) __xe_bo_fixed_placement() argument
2535 struct xe_bo *bo = NULL; __xe_bo_create_locked() local
2643 struct xe_bo *bo; xe_bo_create_novm() local
2663 xe_bo_debug_mixed_mode_cur_index_advance(struct xe_device * xe,struct xe_bo * bo) xe_bo_debug_mixed_mode_cur_index_advance() argument
2796 xe_bo_debug_mixed_mode_cur_index_advance(struct xe_device * xe,struct xe_bo * bo) xe_bo_debug_mixed_mode_cur_index_advance() argument
2820 struct xe_bo *bo; xe_bo_create_user() local
2869 struct xe_bo *bo; xe_bo_create_pin_range_novm() local
2902 struct xe_bo *bo; xe_bo_create_pin_map_at_aligned() local
2963 struct xe_bo *bo; xe_bo_create_pin_map_at_novm() local
3041 struct xe_bo *bo; xe_managed_bo_create_pin_map() local
3056 xe_managed_bo_unpin_map_no_vm(struct xe_bo * bo) xe_managed_bo_unpin_map_no_vm() argument
3064 struct xe_bo *bo = xe_managed_bo_create_pin_map(xe, tile, ALIGN(size, PAGE_SIZE), flags); xe_managed_bo_create_from_data() local
3089 struct xe_bo *bo; xe_managed_bo_reinit_in_vram() local
3141 xe_bo_pin_external(struct xe_bo * bo,bool in_place,struct drm_exec * exec) xe_bo_pin_external() argument
3184 xe_bo_pin(struct xe_bo * bo,struct drm_exec * exec) xe_bo_pin() argument
3242 xe_bo_unpin_external(struct xe_bo * bo) xe_bo_unpin_external() argument
3266 xe_bo_unpin(struct xe_bo * bo) xe_bo_unpin() argument
3309 xe_bo_validate(struct xe_bo * bo,struct xe_vm * vm,bool allow_res_evict,struct drm_exec * exec) xe_bo_validate() argument
3339 xe_bo_is_xe_bo(struct ttm_buffer_object * bo) xe_bo_is_xe_bo() argument
3353 __xe_bo_addr(struct xe_bo * bo,u64 offset,size_t page_size) __xe_bo_addr() argument
3378 xe_bo_addr(struct xe_bo * bo,u64 offset,size_t page_size) xe_bo_addr() argument
3385 xe_bo_vmap(struct xe_bo * bo) xe_bo_vmap() argument
3421 __xe_bo_vunmap(struct xe_bo * bo) __xe_bo_vunmap() argument
3429 xe_bo_vunmap(struct xe_bo * bo) xe_bo_vunmap() argument
3435 gem_create_set_pxp_type(struct xe_device * xe,struct xe_bo * bo,u64 value) gem_create_set_pxp_type() argument
3456 gem_create_user_ext_set_property(struct xe_device * xe,struct xe_bo * bo,u64 extension) gem_create_user_ext_set_property() argument
3490 gem_create_user_extensions(struct xe_device * xe,struct xe_bo * bo,u64 extensions,int ext_number) gem_create_user_extensions() argument
3531 struct xe_bo *bo; xe_gem_create_ioctl() local
3721 xe_bo_decompress(struct xe_bo * bo) xe_bo_decompress() argument
3774 xe_bo_lock(struct xe_bo * bo,bool intr) xe_bo_lock() argument
3790 xe_bo_unlock(struct xe_bo * bo) xe_bo_unlock() argument
3810 xe_bo_can_migrate(struct xe_bo * bo,u32 mem_type) xe_bo_can_migrate() argument
3853 xe_bo_migrate(struct xe_bo * bo,u32 mem_type,struct ttm_operation_ctx * tctx,struct drm_exec * exec) xe_bo_migrate() argument
3908 xe_bo_evict(struct xe_bo * bo,struct drm_exec * exec) xe_bo_evict() argument
3936 xe_bo_needs_ccs_pages(struct xe_bo * bo) xe_bo_needs_ccs_pages() argument
3990 struct xe_bo *bo, *next; xe_bo_put_commit() local
4028 xe_bo_put(struct xe_bo * bo) xe_bo_put() argument
4061 struct xe_bo *bo; xe_bo_dumb_create() local
4087 xe_bo_runtime_pm_release_mmap_offset(struct xe_bo * bo) xe_bo_runtime_pm_release_mmap_offset() argument
[all...]
H A Dxe_drm_client.c133 struct xe_bo *bo) in xe_drm_client_add_bo() argument
135 XE_WARN_ON(bo->client); in xe_drm_client_add_bo()
136 XE_WARN_ON(!list_empty(&bo->client_link)); in xe_drm_client_add_bo()
138 bo->client = xe_drm_client_get(client); in xe_drm_client_add_bo()
140 list_add_tail(&bo->client_link, &client->bos_list); in xe_drm_client_add_bo()
153 void xe_drm_client_remove_bo(struct xe_bo *bo) in xe_drm_client_remove_bo() argument
155 struct xe_device *xe = ttm_to_xe_device(bo->ttm.bdev); in xe_drm_client_remove_bo()
156 struct xe_drm_client *client = bo->client; in xe_drm_client_remove_bo()
158 xe_assert(xe, !kref_read(&bo->ttm.base.refcount)); in xe_drm_client_remove_bo()
161 list_del_init(&bo->client_link); in xe_drm_client_remove_bo()
[all …]
H A Dxe_dma_buf.c53 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_pin() local
54 struct xe_device *xe = xe_bo_device(bo); in xe_dma_buf_pin()
66 if (xe_bo_is_pinned(bo) && !xe_bo_is_mem_type(bo, XE_PL_TT) && in xe_dma_buf_pin()
67 !(xe_bo_is_vram(bo) && allow_vram)) { in xe_dma_buf_pin()
73 ret = xe_bo_migrate(bo, XE_PL_TT, NULL, exec); in xe_dma_buf_pin()
83 ret = xe_bo_pin_external(bo, !allow_vram, exec); in xe_dma_buf_pin()
92 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_unpin() local
94 xe_bo_unpin_external(bo); in xe_dma_buf_unpin()
102 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_map() local
107 if (!attach->peer2peer && !xe_bo_can_migrate(bo, XE_PL_TT)) in xe_dma_buf_map()
[all …]
/linux/drivers/gpu/drm/ttm/
H A Dttm_bo.c55 static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo, in ttm_bo_mem_space_debug() argument
66 man = ttm_manager_type(bo->bdev, mem_type); in ttm_bo_mem_space_debug()
80 void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo) in ttm_bo_move_to_lru_tail() argument
82 dma_resv_assert_held(bo->base.resv); in ttm_bo_move_to_lru_tail()
84 if (bo->resource) in ttm_bo_move_to_lru_tail()
85 ttm_resource_move_to_lru_tail(bo->resource); in ttm_bo_move_to_lru_tail()
103 void ttm_bo_set_bulk_move(struct ttm_buffer_object *bo, in ttm_bo_set_bulk_move() argument
106 dma_resv_assert_held(bo->base.resv); in ttm_bo_set_bulk_move()
108 if (bo->bulk_move == bulk) in ttm_bo_set_bulk_move()
111 spin_lock(&bo->bdev->lru_lock); in ttm_bo_set_bulk_move()
[all …]
H A Dttm_bo_vm.c44 static vm_fault_t ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo, in ttm_bo_vm_fault_idle() argument
52 if (dma_resv_test_signaled(bo->base.resv, DMA_RESV_USAGE_KERNEL)) in ttm_bo_vm_fault_idle()
64 drm_gem_object_get(&bo->base); in ttm_bo_vm_fault_idle()
66 (void)dma_resv_wait_timeout(bo->base.resv, in ttm_bo_vm_fault_idle()
69 dma_resv_unlock(bo->base.resv); in ttm_bo_vm_fault_idle()
70 drm_gem_object_put(&bo->base); in ttm_bo_vm_fault_idle()
77 err = dma_resv_wait_timeout(bo->base.resv, DMA_RESV_USAGE_KERNEL, true, in ttm_bo_vm_fault_idle()
87 static unsigned long ttm_bo_io_mem_pfn(struct ttm_buffer_object *bo, in ttm_bo_io_mem_pfn() argument
90 struct ttm_device *bdev = bo->bdev; in ttm_bo_io_mem_pfn()
93 return bdev->funcs->io_mem_pfn(bo, page_offset); in ttm_bo_io_mem_pfn()
[all …]
/linux/drivers/gpu/drm/qxl/
H A Dqxl_object.c34 struct qxl_bo *bo; in qxl_ttm_bo_destroy() local
37 bo = to_qxl_bo(tbo); in qxl_ttm_bo_destroy()
38 qdev = to_qxl(bo->tbo.base.dev); in qxl_ttm_bo_destroy()
40 qxl_surface_evict(qdev, bo, false); in qxl_ttm_bo_destroy()
41 WARN_ON_ONCE(bo->map_count > 0); in qxl_ttm_bo_destroy()
43 list_del_init(&bo->list); in qxl_ttm_bo_destroy()
45 drm_gem_object_release(&bo->tbo.base); in qxl_ttm_bo_destroy()
46 kfree(bo); in qxl_ttm_bo_destroy()
49 bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo) in qxl_ttm_bo_is_qxl_bo() argument
51 if (bo->destroy == &qxl_ttm_bo_destroy) in qxl_ttm_bo_is_qxl_bo()
[all …]
H A Dqxl_object.h30 static inline int qxl_bo_reserve(struct qxl_bo *bo) in qxl_bo_reserve() argument
34 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()
39 dev_err(ddev->dev, "%p reserve failed\n", bo); in qxl_bo_reserve()
46 static inline void qxl_bo_unreserve(struct qxl_bo *bo) in qxl_bo_unreserve() argument
48 ttm_bo_unreserve(&bo->tbo); in qxl_bo_unreserve()
51 static inline unsigned long qxl_bo_size(struct qxl_bo *bo) in qxl_bo_size() argument
53 return bo->tbo.base.size; in qxl_bo_size()
62 int qxl_bo_pin_and_vmap(struct qxl_bo *bo, struct iosys_map *map);
63 int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map);
[all …]
/linux/drivers/gpu/drm/panthor/
H A Dpanthor_gem.c46 static void panthor_gem_debugfs_bo_init(struct panthor_gem_object *bo) in panthor_gem_debugfs_bo_init() argument
48 INIT_LIST_HEAD(&bo->debugfs.node); in panthor_gem_debugfs_bo_init()
51 static void panthor_gem_debugfs_bo_add(struct panthor_gem_object *bo) in panthor_gem_debugfs_bo_add() argument
53 struct panthor_device *ptdev = container_of(bo->base.dev, in panthor_gem_debugfs_bo_add()
56 bo->debugfs.creator.tgid = current->tgid; in panthor_gem_debugfs_bo_add()
57 get_task_comm(bo->debugfs.creator.process_name, current->group_leader); in panthor_gem_debugfs_bo_add()
60 list_add_tail(&bo->debugfs.node, &ptdev->gems.node); in panthor_gem_debugfs_bo_add()
64 static void panthor_gem_debugfs_bo_rm(struct panthor_gem_object *bo) in panthor_gem_debugfs_bo_rm() argument
66 struct panthor_device *ptdev = container_of(bo->base.dev, in panthor_gem_debugfs_bo_rm()
69 if (list_empty(&bo->debugfs.node)) in panthor_gem_debugfs_bo_rm()
[all …]
/linux/drivers/gpu/drm/radeon/
H A Dradeon_object.c45 static void radeon_bo_clear_surface_reg(struct radeon_bo *bo);
54 struct radeon_bo *bo; in radeon_ttm_bo_destroy() local
56 bo = container_of(tbo, struct radeon_bo, tbo); in radeon_ttm_bo_destroy()
58 mutex_lock(&bo->rdev->gem.mutex); in radeon_ttm_bo_destroy()
59 list_del_init(&bo->list); in radeon_ttm_bo_destroy()
60 mutex_unlock(&bo->rdev->gem.mutex); in radeon_ttm_bo_destroy()
61 radeon_bo_clear_surface_reg(bo); in radeon_ttm_bo_destroy()
62 WARN_ON_ONCE(!list_empty(&bo->va)); 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()
[all …]
H A Dradeon_object.h64 static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr) in radeon_bo_reserve() argument
68 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in radeon_bo_reserve()
71 dev_err(bo->rdev->dev, "%p reserve failed\n", bo); in radeon_bo_reserve()
77 static inline void radeon_bo_unreserve(struct radeon_bo *bo) in radeon_bo_unreserve() argument
79 ttm_bo_unreserve(&bo->tbo); in radeon_bo_unreserve()
91 static inline u64 radeon_bo_gpu_offset(struct radeon_bo *bo) in radeon_bo_gpu_offset() argument
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()
110 static inline unsigned long radeon_bo_size(struct radeon_bo *bo) in radeon_bo_size() argument
[all …]
H A Dradeon_mn.c53 struct radeon_bo *bo = container_of(mn, struct radeon_bo, notifier); in radeon_mn_invalidate() local
57 if (!bo->tbo.ttm || !radeon_ttm_tt_is_bound(bo->tbo.bdev, bo->tbo.ttm)) in radeon_mn_invalidate()
63 r = radeon_bo_reserve(bo, true); in radeon_mn_invalidate()
69 r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_BOOKKEEP, in radeon_mn_invalidate()
74 radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU); in radeon_mn_invalidate()
75 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in radeon_mn_invalidate()
79 radeon_bo_unreserve(bo); in radeon_mn_invalidate()
96 int radeon_mn_register(struct radeon_bo *bo, unsigned long addr) in radeon_mn_register() argument
100 ret = mmu_interval_notifier_insert(&bo->notifier, current->mm, addr, in radeon_mn_register()
101 radeon_bo_size(bo), &radeon_mn_ops); in radeon_mn_register()
[all …]
H A Dradeon_prime.c39 struct radeon_bo *bo = gem_to_radeon_bo(obj); in radeon_gem_prime_get_sg_table() local
41 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()
51 struct radeon_bo *bo; in radeon_gem_prime_import_sg_table() local
56 RADEON_GEM_DOMAIN_GTT, 0, sg, resv, &bo); in radeon_gem_prime_import_sg_table()
61 bo->tbo.base.funcs = &radeon_gem_object_funcs; in radeon_gem_prime_import_sg_table()
64 list_add_tail(&bo->list, &rdev->gem.objects); in radeon_gem_prime_import_sg_table()
67 bo->prime_shared_count = 1; in radeon_gem_prime_import_sg_table()
68 return &bo->tbo.base; in radeon_gem_prime_import_sg_table()
73 struct radeon_bo *bo = gem_to_radeon_bo(obj); in radeon_gem_prime_pin() local
[all …]
/linux/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_object.c63 struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); in amdgpu_bo_destroy() local
65 amdgpu_bo_kunmap(bo); in amdgpu_bo_destroy()
67 if (drm_gem_is_imported(&bo->tbo.base)) in amdgpu_bo_destroy()
68 drm_prime_gem_destroy(&bo->tbo.base, bo->tbo.sg); in amdgpu_bo_destroy()
69 drm_gem_object_release(&bo->tbo.base); in amdgpu_bo_destroy()
70 amdgpu_bo_unref(&bo->parent); in amdgpu_bo_destroy()
71 kvfree(bo); in amdgpu_bo_destroy()
76 struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); in amdgpu_bo_user_destroy() local
79 ubo = to_amdgpu_bo_user(bo); in amdgpu_bo_user_destroy()
94 bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo) in amdgpu_bo_is_amdgpu_bo() argument
[all …]
H A Damdgpu_dma_buf.c63 struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj); in dma_buf_attach_adev() local
65 return amdgpu_ttm_adev(bo->tbo.bdev); in dma_buf_attach_adev()
84 struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj); in amdgpu_dma_buf_attach() local
85 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_dma_buf_attach()
97 bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC) in amdgpu_dma_buf_attach()
100 if (!amdgpu_dmabuf_is_xgmi_accessible(attach_adev, bo) && in amdgpu_dma_buf_attach()
119 r = dma_resv_lock(bo->tbo.base.resv, NULL); in amdgpu_dma_buf_attach()
123 amdgpu_vm_bo_update_shared(bo); in amdgpu_dma_buf_attach()
125 dma_resv_unlock(bo->tbo.base.resv); in amdgpu_dma_buf_attach()
147 struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj); in amdgpu_dma_buf_detach() local
[all …]
H A Damdgpu_amdkfd_gpuvm.c309 void amdgpu_amdkfd_release_notify(struct amdgpu_bo *bo) in amdgpu_amdkfd_release_notify() argument
311 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_amdkfd_release_notify()
312 u32 alloc_flags = bo->kfd_bo->alloc_flags; in amdgpu_amdkfd_release_notify()
313 u64 size = amdgpu_bo_size(bo); in amdgpu_amdkfd_release_notify()
316 bo->xcp_id); in amdgpu_amdkfd_release_notify()
318 kfree(bo->kfd_bo); in amdgpu_amdkfd_release_notify()
338 ret = amdgpu_bo_reserve(mem->bo, false); in create_dmamap_sg_bo()
343 flags |= mem->bo->flags & (AMDGPU_GEM_CREATE_COHERENT | in create_dmamap_sg_bo()
346 ret = amdgpu_gem_object_create(adev, mem->bo->tbo.base.size, 1, in create_dmamap_sg_bo()
348 ttm_bo_type_sg, mem->bo->tbo.base.resv, &gem_obj, 0); in create_dmamap_sg_bo()
[all …]
/linux/drivers/gpu/drm/vc4/
H A Dvc4_bo.c134 struct vc4_bo *bo = to_vc4_bo(gem_obj); in vc4_bo_set_label() local
144 vc4->bo_labels[bo->label].num_allocated--; in vc4_bo_set_label()
145 vc4->bo_labels[bo->label].size_allocated -= gem_obj->size; in vc4_bo_set_label()
147 if (vc4->bo_labels[bo->label].num_allocated == 0 && in vc4_bo_set_label()
148 is_user_label(bo->label)) { in vc4_bo_set_label()
154 kfree(vc4->bo_labels[bo->label].name); in vc4_bo_set_label()
155 vc4->bo_labels[bo->label].name = NULL; in vc4_bo_set_label()
158 bo->label = label; in vc4_bo_set_label()
166 static void vc4_bo_destroy(struct vc4_bo *bo) in vc4_bo_destroy() argument
168 struct drm_gem_object *obj = &bo in vc4_bo_destroy()
186 vc4_bo_remove_from_cache(struct vc4_bo * bo) vc4_bo_remove_from_cache() argument
241 struct vc4_bo *bo = list_last_entry(&vc4->bo_cache.time_list, vc4_bo_cache_purge() local
249 vc4_bo_add_to_purgeable_pool(struct vc4_bo * bo) vc4_bo_add_to_purgeable_pool() argument
263 vc4_bo_remove_from_purgeable_pool_locked(struct vc4_bo * bo) vc4_bo_remove_from_purgeable_pool_locked() argument
287 vc4_bo_remove_from_purgeable_pool(struct vc4_bo * bo) vc4_bo_remove_from_purgeable_pool() argument
298 struct vc4_bo *bo = to_vc4_bo(obj); vc4_bo_purge() local
317 struct vc4_bo *bo = list_first_entry(&vc4->purgeable.list, vc4_bo_userspace_cache_purge() local
364 struct vc4_bo *bo = NULL; vc4_bo_get_from_cache() local
396 struct vc4_bo *bo; vc4_create_object() local
427 struct vc4_bo *bo; vc4_bo_create() local
495 struct vc4_bo *bo = NULL; vc4_bo_dumb_create() local
525 struct vc4_bo *bo = list_last_entry(&vc4->bo_cache.time_list, vc4_bo_cache_free_old() local
546 struct vc4_bo *bo = to_vc4_bo(gem_bo); vc4_free_object() local
619 vc4_bo_inc_usecnt(struct vc4_bo * bo) vc4_bo_inc_usecnt() argument
659 vc4_bo_dec_usecnt(struct vc4_bo * bo) vc4_bo_dec_usecnt() argument
688 struct vc4_bo *bo = to_vc4_bo(obj); vc4_prime_export() local
719 struct vc4_bo *bo = to_vc4_bo(obj); vc4_fault() local
733 struct vc4_bo *bo = to_vc4_bo(obj); vc4_gem_object_mmap() local
789 struct vc4_bo *bo = NULL; vc4_create_bo_ioctl() local
845 struct vc4_bo *bo = NULL; vc4_create_shader_bo_ioctl() local
924 struct vc4_bo *bo; vc4_set_tiling_ioctl() local
971 struct vc4_bo *bo; vc4_get_tiling_ioctl() local
[all...]
/linux/drivers/gpu/drm/virtio/
H A Dvirtgpu_object.c66 void virtio_gpu_remove_from_restore_list(struct virtio_gpu_object *bo) in virtio_gpu_remove_from_restore_list() argument
68 struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; in virtio_gpu_remove_from_restore_list()
71 list_del_init(&bo->restore_node); in virtio_gpu_remove_from_restore_list()
75 void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo) in virtio_gpu_cleanup_object() argument
77 struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; in virtio_gpu_cleanup_object()
79 virtio_gpu_resource_id_put(vgdev, bo->hw_res_handle); in virtio_gpu_cleanup_object()
80 if (virtio_gpu_is_shmem(bo)) { in virtio_gpu_cleanup_object()
81 drm_gem_shmem_free(&bo->base); in virtio_gpu_cleanup_object()
82 } else if (virtio_gpu_is_vram(bo)) { in virtio_gpu_cleanup_object()
83 struct virtio_gpu_object_vram *vram = to_virtio_gpu_vram(bo); in virtio_gpu_cleanup_object()
[all …]
H A Dvirtgpu_prime.c37 struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); in virtgpu_virtio_get_uuid() local
40 wait_event(vgdev->resp_wq, bo->uuid_state != STATE_INITIALIZING); in virtgpu_virtio_get_uuid()
41 if (bo->uuid_state != STATE_OK) in virtgpu_virtio_get_uuid()
44 uuid_copy(uuid, &bo->uuid); in virtgpu_virtio_get_uuid()
54 struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); in virtgpu_gem_map_dma_buf() local
56 if (virtio_gpu_is_vram(bo)) in virtgpu_gem_map_dma_buf()
57 return virtio_gpu_vram_map_dma_buf(bo, attach->dev, dir); in virtgpu_gem_map_dma_buf()
67 struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); in virtgpu_gem_unmap_dma_buf() local
69 if (virtio_gpu_is_vram(bo)) { in virtgpu_gem_unmap_dma_buf()
93 struct virtio_gpu_object *bo) in virtio_gpu_resource_assign_uuid() argument
[all …]
/linux/drivers/gpu/drm/lima/
H A Dlima_gem.c21 int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm) in lima_heap_alloc() argument
24 struct address_space *mapping = bo->base.base.filp->f_mapping; in lima_heap_alloc()
25 struct device *dev = bo->base.base.dev->dev; in lima_heap_alloc()
26 size_t old_size = bo->heap_size; in lima_heap_alloc()
27 size_t new_size = bo->heap_size ? bo->heap_size * 2 : in lima_heap_alloc()
32 if (bo->heap_size >= bo->base.base.size) in lima_heap_alloc()
35 new_size = min(new_size, bo->base.base.size); in lima_heap_alloc()
37 dma_resv_lock(bo->base.base.resv, NULL); in lima_heap_alloc()
39 if (bo->base.pages) { in lima_heap_alloc()
40 pages = bo->base.pages; in lima_heap_alloc()
[all …]
/linux/drivers/gpu/drm/ttm/tests/
H A Dttm_bo_test.c62 struct ttm_buffer_object *bo; in ttm_bo_reserve_optimistic_no_ticket() local
65 bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL); in ttm_bo_reserve_optimistic_no_ticket()
67 err = ttm_bo_reserve(bo, params->interruptible, params->no_wait, NULL); in ttm_bo_reserve_optimistic_no_ticket()
70 dma_resv_unlock(bo->base.resv); in ttm_bo_reserve_optimistic_no_ticket()
75 struct ttm_buffer_object *bo; in ttm_bo_reserve_locked_no_sleep() local
80 bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL); in ttm_bo_reserve_locked_no_sleep()
83 dma_resv_lock(bo->base.resv, NULL); in ttm_bo_reserve_locked_no_sleep()
85 err = ttm_bo_reserve(bo, interruptible, no_wait, NULL); in ttm_bo_reserve_locked_no_sleep()
86 dma_resv_unlock(bo->base.resv); in ttm_bo_reserve_locked_no_sleep()
93 struct ttm_buffer_object *bo; in ttm_bo_reserve_no_wait_ticket() local
[all …]
H A Dttm_tt_test.c42 struct ttm_buffer_object *bo; in ttm_tt_init_basic() local
53 bo = ttm_bo_kunit_init(test, test->priv, params->size, NULL); in ttm_tt_init_basic()
55 err = ttm_tt_init(tt, bo, page_flags, caching, extra_pages); in ttm_tt_init_basic()
69 struct ttm_buffer_object *bo; in ttm_tt_init_misaligned() local
79 bo = ttm_bo_kunit_init(test, test->priv, size, NULL); in ttm_tt_init_misaligned()
82 bo->base.size += 1; in ttm_tt_init_misaligned()
84 err = ttm_tt_init(tt, bo, 0, caching, 0); in ttm_tt_init_misaligned()
92 struct ttm_buffer_object *bo; in ttm_tt_fini_basic() local
100 bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL); in ttm_tt_fini_basic()
102 err = ttm_tt_init(tt, bo, 0, caching, 0); in ttm_tt_fini_basic()
[all …]
/linux/drivers/accel/ivpu/
H A Divpu_gem.h27 int ivpu_bo_bind(struct ivpu_bo *bo);
36 void ivpu_bo_free(struct ivpu_bo *bo);
52 static inline void *ivpu_bo_vaddr(struct ivpu_bo *bo) in ivpu_bo_vaddr() argument
54 return bo->base.vaddr; in ivpu_bo_vaddr()
57 static inline size_t ivpu_bo_size(struct ivpu_bo *bo) in ivpu_bo_size() argument
59 return bo->base.base.size; in ivpu_bo_size()
62 static inline u32 ivpu_bo_cache_mode(struct ivpu_bo *bo) in ivpu_bo_cache_mode() argument
64 return bo->flags & DRM_IVPU_BO_CACHE_MASK; in ivpu_bo_cache_mode()
67 static inline struct ivpu_device *ivpu_bo_to_vdev(struct ivpu_bo *bo) in ivpu_bo_to_vdev() argument
69 return to_ivpu_device(bo->base.base.dev); in ivpu_bo_to_vdev()
[all …]
/linux/drivers/gpu/drm/v3d/
H A Dv3d_bo.c28 struct v3d_bo *bo = to_v3d_bo(obj); in v3d_gem_status() local
31 if (bo->base.pages) in v3d_gem_status()
43 struct v3d_bo *bo = to_v3d_bo(obj); in v3d_free_object() local
45 if (bo->vaddr) in v3d_free_object()
46 v3d_put_bo_vaddr(bo); in v3d_free_object()
48 v3d_mmu_remove_ptes(bo); in v3d_free_object()
56 drm_mm_remove_node(&bo->node); in v3d_free_object()
60 bo->base.pages_mark_dirty_on_put = true; in v3d_free_object()
62 drm_gem_shmem_free(&bo->base); in v3d_free_object()
83 struct v3d_bo *bo; in v3d_create_object() local
[all …]
/linux/drivers/gpu/drm/vmwgfx/
H A Dvmwgfx_bo.c40 static void vmw_bo_free(struct ttm_buffer_object *bo) in vmw_bo_free() argument
43 struct vmw_bo *vbo = to_vmw_bo(&bo->base); in vmw_bo_free()
93 struct ttm_buffer_object *bo = &buf->tbo; in vmw_bo_pin_in_placement() local
98 ret = ttm_bo_reserve(bo, interruptible, false, NULL); in vmw_bo_pin_in_placement()
102 ret = ttm_bo_validate(bo, placement, &ctx); in vmw_bo_pin_in_placement()
106 ttm_bo_unreserve(bo); in vmw_bo_pin_in_placement()
129 struct ttm_buffer_object *bo = &buf->tbo; in vmw_bo_pin_in_vram_or_gmr() local
134 ret = ttm_bo_reserve(bo, interruptible, false, NULL); in vmw_bo_pin_in_vram_or_gmr()
141 ret = ttm_bo_validate(bo, &buf->placement, &ctx); in vmw_bo_pin_in_vram_or_gmr()
148 ret = ttm_bo_validate(bo, &buf->placement, &ctx); in vmw_bo_pin_in_vram_or_gmr()
[all …]

12345678910