Lines Matching full:gpu
25 * GPU Shared Virtual Memory (GPU SVM) layer for the Direct Rendering Manager (DRM)
27 * between the CPU and GPU. It enables efficient data exchange and processing
28 * for GPU-accelerated applications by allowing memory sharing and
29 * synchronization between the CPU's and GPU's virtual address spaces.
31 * Key GPU SVM Components:
34 * Used for tracking memory intervals and notifying the GPU of changes,
35 * notifiers are sized based on a GPU SVM initialization parameter, with a
38 * tracked within a GPU SVM Red-BlacK tree and list and are dynamically
42 * Represent memory ranges mapped in a DRM device and managed by GPU SVM.
43 * They are sized based on an array of chunk sizes, which is a GPU SVM
44 * initialization parameter, and the CPU address space. Upon GPU fault,
47 * dynamically allocated on GPU fault and removed on an MMU notifier UNMAP
52 * Define the interface for driver-specific GPU SVM operations such as
56 * Embedded structure containing enough information for GPU SVM to migrate
64 * releasing memory ranges between the CPU and GPU. It handles all core memory
72 * - GPU page fault handler:
74 * optionally migrate the range to device memory, and create GPU bindings.
77 * Used to unmap and destroy GPU bindings for ranges. Ranges are expected
82 * Used to invalidate and DMA unmap GPU bindings for ranges.
88 * GPU SVM handles locking for core MM interactions, i.e., it locks/unlocks the
91 * GPU SVM introduces a global notifier lock, which safeguards the notifier's
93 * number. GPU SVM manages all necessary locking and unlocking operations,
95 * (drm_gpusvm_range_pages_valid) when the driver is committing GPU bindings.
97 * Documentation/mm/hmm.rst. Future revisions may transition from a GPU SVM
102 * lock to safeguard core GPU SVM function calls that modify state, such as
105 * locking should also be possible for concurrent GPU fault processing within a
106 * single GPU SVM. The 'driver_svm_lock' can be via drm_gpusvm_driver_set_lock
107 * to add annotations to GPU SVM.
115 * being that a subset of the range still has CPU and GPU mappings. If the
120 * sizes are relatively small, GPU SVM does not support splitting of ranges.
132 * components: the GPU page fault handler, the garbage collector, and the
139 * 1) GPU page fault handler
167 * // Always process UNMAPs first so view of GPU SVM ranges is current
274 * drm_gpusvm_range_find() - Find GPU SVM range from GPU SVM notifier
275 * @notifier: Pointer to the GPU SVM notifier structure.
297 * drm_gpusvm_for_each_range_safe() - Safely iterate over GPU SVM ranges in a notifier
300 * @notifier__: Pointer to the GPU SVM notifier
304 * This macro is used to iterate over GPU SVM ranges in a notifier while
346 * drm_gpusvm_for_each_notifier() - Iterate over GPU SVM notifiers in a gpusvm
348 * @notifier__: Pointer to the GPU SVM notifier
352 * This macro is used to iterate over GPU SVM notifiers in a gpusvm.
360 * drm_gpusvm_for_each_notifier_safe() - Safely iterate over GPU SVM notifiers in a gpusvm
363 * @notifier__: Pointer to the GPU SVM notifier
367 * This macro is used to iterate over GPU SVM notifiers in a gpusvm while
377 * drm_gpusvm_notifier_invalidate() - Invalidate a GPU SVM notifier.
382 * This function serves as a generic MMU notifier for GPU SVM. It sets the MMU
409 * drm_gpusvm_notifier_ops - MMU interval notifier operations for GPU SVM
416 * drm_gpusvm_init() - Initialize the GPU SVM.
417 * @gpusvm: Pointer to the GPU SVM structure.
418 * @name: Name of the GPU SVM.
422 * @mm_start: Start address of GPU SVM.
423 * @mm_range: Range of the GPU SVM.
425 * @ops: Pointer to the operations structure for GPU SVM.
431 * This function initializes the GPU SVM.
476 * drm_gpusvm_notifier_find() - Find GPU SVM notifier
477 * @gpusvm: Pointer to the GPU SVM structure
480 * This function finds the GPU SVM notifier associated with the fault address.
482 * Return: Pointer to the GPU SVM notifier on success, NULL otherwise.
503 * drm_gpusvm_notifier_insert() - Insert GPU SVM notifier
504 * @gpusvm: Pointer to the GPU SVM structure
505 * @notifier: Pointer to the GPU SVM notifier structure
507 * This function inserts the GPU SVM notifier into the GPU SVM RB tree and list.
527 * drm_gpusvm_notifier_remove() - Remove GPU SVM notifier
528 * @gpusvm: Pointer to the GPU SVM tructure
529 * @notifier: Pointer to the GPU SVM notifier structure
531 * This function removes the GPU SVM notifier from the GPU SVM RB tree and list.
541 * drm_gpusvm_fini() - Finalize the GPU SVM.
542 * @gpusvm: Pointer to the GPU SVM structure.
544 * This function finalizes the GPU SVM by cleaning up any remaining ranges and
571 * drm_gpusvm_notifier_alloc() - Allocate GPU SVM notifier
572 * @gpusvm: Pointer to the GPU SVM structure
575 * This function allocates and initializes the GPU SVM notifier structure.
577 * Return: Pointer to the allocated GPU SVM notifier on success, ERR_PTR() on failure.
603 * drm_gpusvm_notifier_free() - Free GPU SVM notifier
604 * @gpusvm: Pointer to the GPU SVM structure
605 * @notifier: Pointer to the GPU SVM notifier structure
607 * This function frees the GPU SVM notifier structure.
632 * drm_gpusvm_range_insert() - Insert GPU SVM range
633 * @notifier: Pointer to the GPU SVM notifier structure
634 * @range: Pointer to the GPU SVM range structure
636 * This function inserts the GPU SVM range into the notifier RB tree and list.
658 * __drm_gpusvm_range_remove() - Remove GPU SVM range
659 * @notifier: Pointer to the GPU SVM notifier structure
660 * @range: Pointer to the GPU SVM range structure
662 * This macro removes the GPU SVM range from the notifier RB tree and list.
672 * drm_gpusvm_range_alloc() - Allocate GPU SVM range
673 * @gpusvm: Pointer to the GPU SVM structure
674 * @notifier: Pointer to the GPU SVM notifier structure
679 * This function allocates and initializes the GPU SVM range structure.
681 * Return: Pointer to the allocated GPU SVM range on success, ERR_PTR() on failure.
713 * @gpusvm: Pointer to the GPU SVM structure
714 * @notifier: Pointer to the GPU SVM notifier structure
778 * drm_gpusvm_range_chunk_size() - Determine chunk size for GPU SVM range
779 * @gpusvm: Pointer to the GPU SVM structure
780 * @notifier: Pointer to the GPU SVM notifier structure
787 * This function determines the chunk size for the GPU SVM range based on the
788 * fault address, GPU SVM chunk sizes, existing GPU SVM ranges, and the virtual
858 * drm_gpusvm_driver_lock_held() - Assert GPU SVM driver lock is held
859 * @gpusvm: Pointer to the GPU SVM structure.
876 * @gpusvm: Pointer to the GPU SVM structure
909 * drm_gpusvm_range_find_or_insert() - Find or insert GPU SVM range
910 * @gpusvm: Pointer to the GPU SVM structure
914 * @ctx: GPU SVM context
916 * This function finds or inserts a newly allocated a GPU SVM range based on the
919 * Return: Pointer to the GPU SVM range on success, ERR_PTR() on failure.
1027 * __drm_gpusvm_range_unmap_pages() - Unmap pages associated with a GPU SVM range (internal)
1028 * @gpusvm: Pointer to the GPU SVM structure
1029 * @range: Pointer to the GPU SVM range structure
1032 * This function unmap pages associated with a GPU SVM range. Assumes and
1074 * drm_gpusvm_range_free_pages() - Free pages associated with a GPU SVM range
1075 * @gpusvm: Pointer to the GPU SVM structure
1076 * @range: Pointer to the GPU SVM range structure
1078 * This function frees the dma address array associated with a GPU SVM range.
1092 * drm_gpusvm_range_remove() - Remove GPU SVM range
1093 * @gpusvm: Pointer to the GPU SVM structure
1094 * @range: Pointer to the GPU SVM range to be removed
1096 * This function removes the specified GPU SVM range and also removes the parent
1097 * GPU SVM notifier if no more ranges remain in the notifier. The caller must
1132 * drm_gpusvm_range_get() - Get a reference to GPU SVM range
1133 * @range: Pointer to the GPU SVM range
1135 * This function increments the reference count of the specified GPU SVM range.
1137 * Return: Pointer to the GPU SVM range.
1149 * drm_gpusvm_range_destroy() - Destroy GPU SVM range
1150 * @refcount: Pointer to the reference counter embedded in the GPU SVM range
1152 * This function destroys the specified GPU SVM range when its reference count
1169 * drm_gpusvm_range_put() - Put a reference to GPU SVM range
1170 * @range: Pointer to the GPU SVM range
1172 * This function decrements the reference count of the specified GPU SVM range
1182 * drm_gpusvm_range_pages_valid() - GPU SVM range pages valid
1183 * @gpusvm: Pointer to the GPU SVM structure
1184 * @range: Pointer to the GPU SVM range structure
1186 * This function determines if a GPU SVM range pages are valid. Expected be
1188 * GPU binding. This is akin to a notifier seqno check in the HMM documentation
1193 * Return: True if GPU SVM range has valid pages, False otherwise
1205 * drm_gpusvm_range_pages_valid_unlocked() - GPU SVM range pages valid unlocked
1206 * @gpusvm: Pointer to the GPU SVM structure
1207 * @range: Pointer to the GPU SVM range structure
1209 * This function determines if a GPU SVM range pages are valid. Expected be
1212 * Return: True if GPU SVM range has valid pages, False otherwise
1233 * drm_gpusvm_range_get_pages() - Get pages for a GPU SVM range
1234 * @gpusvm: Pointer to the GPU SVM structure
1235 * @range: Pointer to the GPU SVM range structure
1236 * @ctx: GPU SVM context
1238 * This function gets pages for a GPU SVM range and ensures they are mapped for
1439 * drm_gpusvm_range_unmap_pages() - Unmap pages associated with a GPU SVM range
1440 * drm_gpusvm_range_evict() - Evict GPU SVM range
1441 * @gpusvm: Pointer to the GPU SVM structure
1442 * @range: Pointer to the GPU SVM range structure
1443 * @ctx: GPU SVM context
1445 * This function unmaps pages associated with a GPU SVM range. If @in_notifier
1448 * each GPU SVM range attached to notifier in gpusvm->ops->invalidate for IOMMU
1471 * drm_gpusvm_range_evict() - Evict GPU SVM range
1472 * @gpusvm: Pointer to the GPU SVM structure
1473 * @range: Pointer to the GPU SVM range to be removed
1475 * This function evicts the specified GPU SVM range.
1528 * drm_gpusvm_has_mapping() - Check if GPU SVM has mapping for the given address range
1529 * @gpusvm: Pointer to the GPU SVM structure.
1533 * Return: True if GPU SVM has mapping, False otherwise
1552 * drm_gpusvm_range_set_unmapped() - Mark a GPU SVM range as unmapped
1553 * @range: Pointer to the GPU SVM range structure.
1556 * This function marks a GPU SVM range as unmapped and sets the partial_unmap flag