include/drm/drm_gpusvm.h
Source file repositories/reference/linux-study-clean/include/drm/drm_gpusvm.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_gpusvm.h- Extension
.h- Size
- 19298 bytes
- Lines
- 572
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dma-mapping.hlinux/kref.hlinux/interval_tree.hlinux/mmu_notifier.h
Detected Declarations
struct dev_pagemap_opsstruct drm_devicestruct drm_gpusvmstruct drm_gpusvm_notifierstruct drm_gpusvm_opsstruct drm_gpusvm_rangestruct drm_pagemapstruct drm_pagemap_addrstruct drm_gpusvm_opsstruct drm_gpusvm_notifierstruct drm_gpusvm_pages_flagsstruct drm_gpusvm_pagesstruct drm_gpusvm_rangestruct drm_gpusvmstruct drm_gpusvm_ctxenum drm_gpusvm_scan_resultfunction drm_gpusvm_notifier_lockfunction drm_gpusvm_range_endfunction drm_gpusvm_range_sizefunction drm_gpusvm_notifier_startfunction drm_gpusvm_notifier_endfunction drm_gpusvm_notifier_sizefunction __drm_gpusvm_range_nextfunction __drm_gpusvm_notifier_next
Annotated Snippet
struct drm_gpusvm_ops {
/**
* @notifier_alloc: Allocate a GPU SVM notifier (optional)
*
* Allocate a GPU SVM notifier.
*
* Return: Pointer to the allocated GPU SVM notifier on success, NULL on failure.
*/
struct drm_gpusvm_notifier *(*notifier_alloc)(void);
/**
* @notifier_free: Free a GPU SVM notifier (optional)
* @notifier: Pointer to the GPU SVM notifier to be freed
*
* Free a GPU SVM notifier.
*/
void (*notifier_free)(struct drm_gpusvm_notifier *notifier);
/**
* @range_alloc: Allocate a GPU SVM range (optional)
* @gpusvm: Pointer to the GPU SVM
*
* Allocate a GPU SVM range.
*
* Return: Pointer to the allocated GPU SVM range on success, NULL on failure.
*/
struct drm_gpusvm_range *(*range_alloc)(struct drm_gpusvm *gpusvm);
/**
* @range_free: Free a GPU SVM range (optional)
* @range: Pointer to the GPU SVM range to be freed
*
* Free a GPU SVM range.
*/
void (*range_free)(struct drm_gpusvm_range *range);
/**
* @invalidate: Invalidate GPU SVM notifier (required)
* @gpusvm: Pointer to the GPU SVM
* @notifier: Pointer to the GPU SVM notifier
* @mmu_range: Pointer to the mmu_notifier_range structure
*
* Invalidate the GPU page tables. It can safely walk the notifier range
* RB tree/list in this function. Called while holding the notifier lock.
*/
void (*invalidate)(struct drm_gpusvm *gpusvm,
struct drm_gpusvm_notifier *notifier,
const struct mmu_notifier_range *mmu_range);
};
/**
* struct drm_gpusvm_notifier - Structure representing a GPU SVM notifier
*
* @gpusvm: Pointer to the GPU SVM structure
* @notifier: MMU interval notifier
* @itree: Interval tree node for the notifier (inserted in GPU SVM)
* @entry: List entry to fast interval tree traversal
* @root: Cached root node of the RB tree containing ranges
* @range_list: List head containing of ranges in the same order they appear in
* interval tree. This is useful to keep iterating ranges while
* doing modifications to RB tree.
* @flags: Flags for notifier
* @flags.removed: Flag indicating whether the MMU interval notifier has been
* removed
*
* This structure represents a GPU SVM notifier.
*/
struct drm_gpusvm_notifier {
struct drm_gpusvm *gpusvm;
struct mmu_interval_notifier notifier;
struct interval_tree_node itree;
struct list_head entry;
struct rb_root_cached root;
struct list_head range_list;
struct {
u32 removed : 1;
} flags;
};
/**
* struct drm_gpusvm_pages_flags - Structure representing a GPU SVM pages flags
*
* @migrate_devmem: Flag indicating whether the pages can be migrated to device memory
* @unmapped: Flag indicating if the pages has been unmapped
* @partial_unmap: Flag indicating if the pages has been partially unmapped
* @has_devmem_pages: Flag indicating if the pages has devmem pages
* @has_dma_mapping: Flag indicating if the pages has a DMA mapping
* @__flags: Flags for pages in u16 form (used for READ_ONCE)
*/
struct drm_gpusvm_pages_flags {
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `linux/kref.h`, `linux/interval_tree.h`, `linux/mmu_notifier.h`.
- Detected declarations: `struct dev_pagemap_ops`, `struct drm_device`, `struct drm_gpusvm`, `struct drm_gpusvm_notifier`, `struct drm_gpusvm_ops`, `struct drm_gpusvm_range`, `struct drm_pagemap`, `struct drm_pagemap_addr`, `struct drm_gpusvm_ops`, `struct drm_gpusvm_notifier`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.