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.

Dependency Surface

Detected Declarations

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

Implementation Notes