Lines Matching +full:negative +full:- +full:phase

1 // SPDX-License-Identifier: MIT
24 spin_lock(&xe->pinned.lock); in xe_bo_apply_to_pinned()
31 list_move_tail(&bo->pinned_link, &still_in_list); in xe_bo_apply_to_pinned()
32 spin_unlock(&xe->pinned.lock); in xe_bo_apply_to_pinned()
36 spin_lock(&xe->pinned.lock); in xe_bo_apply_to_pinned()
42 if (!list_empty(&bo->pinned_link)) in xe_bo_apply_to_pinned()
43 list_move(&bo->pinned_link, pinned_list); in xe_bo_apply_to_pinned()
44 spin_unlock(&xe->pinned.lock); in xe_bo_apply_to_pinned()
47 spin_lock(&xe->pinned.lock); in xe_bo_apply_to_pinned()
50 spin_unlock(&xe->pinned.lock); in xe_bo_apply_to_pinned()
56 * xe_bo_notifier_prepare_all_pinned() - Pre-allocate the backing pages for all
62 * Return: 0 on success, negative error code on error.
68 ret = xe_bo_apply_to_pinned(xe, &xe->pinned.early.kernel_bo_present, in xe_bo_notifier_prepare_all_pinned()
69 &xe->pinned.early.kernel_bo_present, in xe_bo_notifier_prepare_all_pinned()
72 ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.kernel_bo_present, in xe_bo_notifier_prepare_all_pinned()
73 &xe->pinned.late.kernel_bo_present, in xe_bo_notifier_prepare_all_pinned()
80 * xe_bo_notifier_unprepare_all_pinned() - Remove the backing pages for all
89 (void)xe_bo_apply_to_pinned(xe, &xe->pinned.early.kernel_bo_present, in xe_bo_notifier_unprepare_all_pinned()
90 &xe->pinned.early.kernel_bo_present, in xe_bo_notifier_unprepare_all_pinned()
93 (void)xe_bo_apply_to_pinned(xe, &xe->pinned.late.kernel_bo_present, in xe_bo_notifier_unprepare_all_pinned()
94 &xe->pinned.late.kernel_bo_present, in xe_bo_notifier_unprepare_all_pinned()
99 * xe_bo_evict_all_user - evict all non-pinned user BOs from VRAM
102 * Evict non-pinned user BOs (via GPU).
108 struct ttm_device *bdev = &xe->ttm; in xe_bo_evict_all_user()
139 * xe_bo_evict_all - evict all BOs from VRAM
142 * Evict non-pinned user BOs first (via GPU), evict pinned external BOs next
161 ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.external, in xe_bo_evict_all()
162 &xe->pinned.late.external, xe_bo_evict_pinned); in xe_bo_evict_all()
165 ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.kernel_bo_present, in xe_bo_evict_all()
166 &xe->pinned.late.evicted, xe_bo_evict_pinned); in xe_bo_evict_all()
178 return xe_bo_apply_to_pinned(xe, &xe->pinned.early.kernel_bo_present, in xe_bo_evict_all()
179 &xe->pinned.early.evicted, in xe_bo_evict_all()
191 if (bo->flags & XE_BO_FLAG_GGTT) { in xe_bo_restore_and_map_ggtt()
196 if (tile != bo->tile && !(bo->flags & XE_BO_FLAG_GGTTx(tile))) in xe_bo_restore_and_map_ggtt()
199 xe_ggtt_map_bo_unlocked(tile->mem.ggtt, bo); in xe_bo_restore_and_map_ggtt()
207 * xe_bo_restore_early - restore early phase kernel BOs to VRAM
219 return xe_bo_apply_to_pinned(xe, &xe->pinned.early.evicted, in xe_bo_restore_early()
220 &xe->pinned.early.kernel_bo_present, in xe_bo_restore_early()
225 * xe_bo_restore_late - restore pinned late phase BOs
239 ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.evicted, in xe_bo_restore_late()
240 &xe->pinned.late.kernel_bo_present, in xe_bo_restore_late()
253 ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.external, in xe_bo_restore_late()
254 &xe->pinned.late.external, in xe_bo_restore_late()
269 (void)xe_bo_apply_to_pinned(xe, &xe->pinned.late.external, in xe_bo_pci_dev_remove_pinned()
270 &xe->pinned.late.external, in xe_bo_pci_dev_remove_pinned()
277 * xe_bo_pci_dev_remove_all() - Handle bos when the pci_device is about to be removed
282 * exported dma-buf bos. This is done by evicting all bos, but
294 * Move pagemap bos and exported dma-buf to system, and in xe_bo_pci_dev_remove_all()
297 for (mem_type = XE_PL_VRAM1; mem_type >= XE_PL_TT; --mem_type) { in xe_bo_pci_dev_remove_all()
299 ttm_manager_type(&xe->ttm, mem_type); in xe_bo_pci_dev_remove_all()
302 int ret = ttm_resource_manager_evict_all(&xe->ttm, man); in xe_bo_pci_dev_remove_all()
304 drm_WARN_ON(&xe->drm, ret); in xe_bo_pci_dev_remove_all()
315 (void)xe_bo_apply_to_pinned(xe, &xe->pinned.late.kernel_bo_present, in xe_bo_pinned_fini()
316 &xe->pinned.late.kernel_bo_present, in xe_bo_pinned_fini()
318 (void)xe_bo_apply_to_pinned(xe, &xe->pinned.early.kernel_bo_present, in xe_bo_pinned_fini()
319 &xe->pinned.early.kernel_bo_present, in xe_bo_pinned_fini()
324 * xe_bo_pinned_init() - Initialize pinned bo tracking
328 * tracking and registers a callback to dma-unmap
331 * Return: %0 on success, negative error code on error.
335 spin_lock_init(&xe->pinned.lock); in xe_bo_pinned_init()
336 INIT_LIST_HEAD(&xe->pinned.early.kernel_bo_present); in xe_bo_pinned_init()
337 INIT_LIST_HEAD(&xe->pinned.early.evicted); in xe_bo_pinned_init()
338 INIT_LIST_HEAD(&xe->pinned.late.kernel_bo_present); in xe_bo_pinned_init()
339 INIT_LIST_HEAD(&xe->pinned.late.evicted); in xe_bo_pinned_init()
340 INIT_LIST_HEAD(&xe->pinned.late.external); in xe_bo_pinned_init()
342 return devm_add_action_or_reset(xe->drm.dev, xe_bo_pinned_fini, xe); in xe_bo_pinned_init()