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_notifier_find() - Find GPU SVM notifier from GPU SVM
275 * @gpusvm: Pointer to the GPU SVM structure.
297 * drm_gpusvm_range_find() - Find GPU SVM range from GPU SVM notifier
298 * @notifier: Pointer to the GPU SVM notifier structure.
320 * drm_gpusvm_notifier_invalidate() - Invalidate a GPU SVM notifier.
325 * This function serves as a generic MMU notifier for GPU SVM. It sets the MMU
352 * drm_gpusvm_notifier_ops - MMU interval notifier operations for GPU SVM
359 * drm_gpusvm_init() - Initialize the GPU SVM.
360 * @gpusvm: Pointer to the GPU SVM structure.
361 * @name: Name of the GPU SVM.
364 * @mm_start: Start address of GPU SVM.
365 * @mm_range: Range of the GPU SVM.
367 * @ops: Pointer to the operations structure for GPU SVM.
373 * This function initializes the GPU SVM.
440 * drm_gpusvm_notifier_insert() - Insert GPU SVM notifier
441 * @gpusvm: Pointer to the GPU SVM structure
442 * @notifier: Pointer to the GPU SVM notifier structure
444 * This function inserts the GPU SVM notifier into the GPU SVM RB tree and list.
464 * drm_gpusvm_notifier_remove() - Remove GPU SVM notifier
465 * @gpusvm: Pointer to the GPU SVM tructure
466 * @notifier: Pointer to the GPU SVM notifier structure
468 * This function removes the GPU SVM notifier from the GPU SVM RB tree and list.
478 * drm_gpusvm_fini() - Finalize the GPU SVM.
479 * @gpusvm: Pointer to the GPU SVM structure.
481 * This function finalizes the GPU SVM by cleaning up any remaining ranges and
509 * drm_gpusvm_notifier_alloc() - Allocate GPU SVM notifier
510 * @gpusvm: Pointer to the GPU SVM structure
513 * This function allocates and initializes the GPU SVM notifier structure.
515 * Return: Pointer to the allocated GPU SVM notifier on success, ERR_PTR() on failure.
541 * drm_gpusvm_notifier_free() - Free GPU SVM notifier
542 * @gpusvm: Pointer to the GPU SVM structure
543 * @notifier: Pointer to the GPU SVM notifier structure
545 * This function frees the GPU SVM notifier structure.
570 * drm_gpusvm_range_insert() - Insert GPU SVM range
571 * @notifier: Pointer to the GPU SVM notifier structure
572 * @range: Pointer to the GPU SVM range structure
574 * This function inserts the GPU SVM range into the notifier RB tree and list.
596 * __drm_gpusvm_range_remove() - Remove GPU SVM range
597 * @notifier: Pointer to the GPU SVM notifier structure
598 * @range: Pointer to the GPU SVM range structure
600 * This macro removes the GPU SVM range from the notifier RB tree and list.
610 * drm_gpusvm_range_alloc() - Allocate GPU SVM range
611 * @gpusvm: Pointer to the GPU SVM structure
612 * @notifier: Pointer to the GPU SVM notifier structure
617 * This function allocates and initializes the GPU SVM range structure.
619 * Return: Pointer to the allocated GPU SVM range on success, ERR_PTR() on failure.
680 * @gpusvm: Pointer to the GPU SVM structure
681 * @notifier: Pointer to the GPU SVM notifier structure
747 * drm_gpusvm_range_chunk_size() - Determine chunk size for GPU SVM range
748 * @gpusvm: Pointer to the GPU SVM structure
749 * @notifier: Pointer to the GPU SVM notifier structure
757 * This function determines the chunk size for the GPU SVM range based on the
758 * fault address, GPU SVM chunk sizes, existing GPU SVM ranges, and the virtual
829 * drm_gpusvm_driver_lock_held() - Assert GPU SVM driver lock is held
830 * @gpusvm: Pointer to the GPU SVM structure.
847 * @gpusvm: Pointer to the GPU SVM structure
880 * drm_gpusvm_range_find_or_insert() - Find or insert GPU SVM range
881 * @gpusvm: Pointer to the GPU SVM structure
885 * @ctx: GPU SVM context
887 * This function finds or inserts a newly allocated a GPU SVM range based on the
890 * Return: Pointer to the GPU SVM range on success, ERR_PTR() on failure.
999 * __drm_gpusvm_unmap_pages() - Unmap pages associated with GPU SVM pages (internal)
1000 * @gpusvm: Pointer to the GPU SVM structure
1001 * @svm_pages: Pointer to the GPU SVM pages structure
1004 * This function unmap pages associated with a GPU SVM pages struct. Assumes and
1046 * __drm_gpusvm_free_pages() - Free dma array associated with GPU SVM pages
1047 * @gpusvm: Pointer to the GPU SVM structure
1048 * @svm_pages: Pointer to the GPU SVM pages structure
1050 * This function frees the dma address array associated with a GPU SVM range.
1064 * drm_gpusvm_free_pages() - Free dma-mapping associated with GPU SVM pages
1066 * @gpusvm: Pointer to the GPU SVM structure
1067 * @svm_pages: Pointer to the GPU SVM pages structure
1070 * This function unmaps and frees the dma address array associated with a GPU
1085 * drm_gpusvm_range_remove() - Remove GPU SVM range
1086 * @gpusvm: Pointer to the GPU SVM structure
1087 * @range: Pointer to the GPU SVM range to be removed
1089 * This function removes the specified GPU SVM range and also removes the parent
1090 * GPU SVM notifier if no more ranges remain in the notifier. The caller must
1126 * drm_gpusvm_range_get() - Get a reference to GPU SVM range
1127 * @range: Pointer to the GPU SVM range
1129 * This function increments the reference count of the specified GPU SVM range.
1131 * Return: Pointer to the GPU SVM range.
1143 * drm_gpusvm_range_destroy() - Destroy GPU SVM range
1144 * @refcount: Pointer to the reference counter embedded in the GPU SVM range
1146 * This function destroys the specified GPU SVM range when its reference count
1163 * drm_gpusvm_range_put() - Put a reference to GPU SVM range
1164 * @range: Pointer to the GPU SVM range
1166 * This function decrements the reference count of the specified GPU SVM range
1176 * drm_gpusvm_pages_valid() - GPU SVM range pages valid
1177 * @gpusvm: Pointer to the GPU SVM structure
1178 * @svm_pages: Pointer to the GPU SVM pages structure
1180 * This function determines if a GPU SVM range pages are valid. Expected be
1182 * GPU binding. This is akin to a notifier seqno check in the HMM documentation
1187 * Return: True if GPU SVM range has valid pages, False otherwise
1198 * drm_gpusvm_range_pages_valid() - GPU SVM range pages valid
1199 * @gpusvm: Pointer to the GPU SVM structure
1200 * @range: Pointer to the GPU SVM range structure
1202 * This function determines if a GPU SVM range pages are valid. Expected be
1204 * GPU binding. This is akin to a notifier seqno check in the HMM documentation
1209 * Return: True if GPU SVM range has valid pages, False otherwise
1219 * drm_gpusvm_range_pages_valid_unlocked() - GPU SVM range pages valid unlocked
1220 * @gpusvm: Pointer to the GPU SVM structure
1221 * @range: Pointer to the GPU SVM range structure
1223 * This function determines if a GPU SVM range pages are valid. Expected be
1226 * Return: True if GPU SVM range has valid pages, False otherwise
1246 * drm_gpusvm_get_pages() - Get pages and populate GPU SVM pages struct
1247 * @gpusvm: Pointer to the GPU SVM structure
1253 * @ctx: GPU SVM context
1457 * drm_gpusvm_range_get_pages() - Get pages for a GPU SVM range
1458 * @gpusvm: Pointer to the GPU SVM structure
1459 * @range: Pointer to the GPU SVM range structure
1460 * @ctx: GPU SVM context
1462 * This function gets pages for a GPU SVM range and ensures they are mapped for
1479 * drm_gpusvm_unmap_pages() - Unmap GPU svm pages
1480 * @gpusvm: Pointer to the GPU SVM structure
1481 * @svm_pages: Pointer to the GPU SVM pages structure
1483 * @ctx: GPU SVM context
1485 * This function unmaps pages associated with a GPU SVM pages struct. If
1509 * drm_gpusvm_range_unmap_pages() - Unmap pages associated with a GPU SVM range
1510 * @gpusvm: Pointer to the GPU SVM structure
1511 * @range: Pointer to the GPU SVM range structure
1512 * @ctx: GPU SVM context
1514 * This function unmaps pages associated with a GPU SVM range. If @in_notifier
1517 * each GPU SVM range attached to notifier in gpusvm->ops->invalidate for IOMMU
1532 * drm_gpusvm_range_evict() - Evict GPU SVM range
1533 * @gpusvm: Pointer to the GPU SVM structure
1534 * @range: Pointer to the GPU SVM range to be removed
1536 * This function evicts the specified GPU SVM range.
1589 * drm_gpusvm_has_mapping() - Check if GPU SVM has mapping for the given address range
1590 * @gpusvm: Pointer to the GPU SVM structure.
1594 * Return: True if GPU SVM has mapping, False otherwise
1613 * drm_gpusvm_range_set_unmapped() - Mark a GPU SVM range as unmapped
1614 * @range: Pointer to the GPU SVM range structure.
1617 * This function marks a GPU SVM range as unmapped and sets the partial_unmap flag