drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.h- Extension
.h- Size
- 2596 bytes
- Lines
- 74
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/hmm.hlinux/rwsem.hlinux/workqueue.hlinux/interval_tree.hlinux/mmu_notifier.h
Detected Declarations
struct amdgpu_hmm_rangefunction amdgpu_hmm_registerfunction amdgpu_hmm_unregisterfunction amdgpu_hmm_range_free
Annotated Snippet
struct amdgpu_hmm_range {
struct hmm_range hmm_range;
struct amdgpu_bo *bo;
};
int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
uint64_t start, uint64_t npages, bool readonly,
void *owner,
struct amdgpu_hmm_range *range);
#if defined(CONFIG_HMM_MIRROR)
bool amdgpu_hmm_range_valid(struct amdgpu_hmm_range *range);
struct amdgpu_hmm_range *amdgpu_hmm_range_alloc(struct amdgpu_bo *bo);
void amdgpu_hmm_range_free(struct amdgpu_hmm_range *range);
int amdgpu_hmm_register(struct amdgpu_bo *bo, unsigned long addr);
void amdgpu_hmm_unregister(struct amdgpu_bo *bo);
#else
static inline int amdgpu_hmm_register(struct amdgpu_bo *bo, unsigned long addr)
{
DRM_WARN_ONCE("HMM_MIRROR kernel config option is not enabled, "
"add CONFIG_ZONE_DEVICE=y in config file to fix this\n");
return -ENODEV;
}
static inline void amdgpu_hmm_unregister(struct amdgpu_bo *bo) {}
static inline bool amdgpu_hmm_range_valid(struct amdgpu_hmm_range *range)
{
return false;
}
static inline struct amdgpu_hmm_range *amdgpu_hmm_range_alloc(struct amdgpu_bo *bo)
{
return NULL;
}
static inline void amdgpu_hmm_range_free(struct amdgpu_hmm_range *range) {}
#endif
#endif
Annotation
- Immediate include surface: `linux/types.h`, `linux/hmm.h`, `linux/rwsem.h`, `linux/workqueue.h`, `linux/interval_tree.h`, `linux/mmu_notifier.h`.
- Detected declarations: `struct amdgpu_hmm_range`, `function amdgpu_hmm_register`, `function amdgpu_hmm_unregister`, `function amdgpu_hmm_range_free`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.