drivers/gpu/drm/nouveau/include/nvkm/core/mm.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/include/nvkm/core/mm.h- Extension
.h- Size
- 1641 bytes
- Lines
- 79
- 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
core/os.h
Detected Declarations
struct nvkm_mm_nodestruct nvkm_mmfunction nvkm_mm_initialisedfunction nvkm_mm_heap_sizefunction nvkm_mm_contiguousfunction nvkm_mm_addrfunction nvkm_mm_size
Annotated Snippet
struct nvkm_mm_node {
struct list_head nl_entry;
struct list_head fl_entry;
struct nvkm_mm_node *next;
#define NVKM_MM_HEAP_ANY 0x00
u8 heap;
#define NVKM_MM_TYPE_NONE 0x00
#define NVKM_MM_TYPE_HOLE 0xff
u8 type;
u32 offset;
u32 length;
};
struct nvkm_mm {
struct list_head nodes;
struct list_head free;
u32 block_size;
int heap_nodes;
};
static inline bool
nvkm_mm_initialised(struct nvkm_mm *mm)
{
return mm->heap_nodes;
}
int nvkm_mm_init(struct nvkm_mm *, u8 heap, u32 offset, u32 length, u32 block);
int nvkm_mm_fini(struct nvkm_mm *);
int nvkm_mm_head(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
u32 size_min, u32 align, struct nvkm_mm_node **);
int nvkm_mm_tail(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
u32 size_min, u32 align, struct nvkm_mm_node **);
void nvkm_mm_free(struct nvkm_mm *, struct nvkm_mm_node **);
void nvkm_mm_dump(struct nvkm_mm *, const char *);
static inline u32
nvkm_mm_heap_size(struct nvkm_mm *mm, u8 heap)
{
struct nvkm_mm_node *node;
u32 size = 0;
list_for_each_entry(node, &mm->nodes, nl_entry) {
if (node->heap == heap)
size += node->length;
}
return size;
}
static inline bool
nvkm_mm_contiguous(struct nvkm_mm_node *node)
{
return !node->next;
}
static inline u32
nvkm_mm_addr(struct nvkm_mm_node *node)
{
if (WARN_ON(!nvkm_mm_contiguous(node)))
return 0;
return node->offset;
}
static inline u32
nvkm_mm_size(struct nvkm_mm_node *node)
{
u32 size = 0;
do {
size += node->length;
} while ((node = node->next));
return size;
}
#endif
Annotation
- Immediate include surface: `core/os.h`.
- Detected declarations: `struct nvkm_mm_node`, `struct nvkm_mm`, `function nvkm_mm_initialised`, `function nvkm_mm_heap_size`, `function nvkm_mm_contiguous`, `function nvkm_mm_addr`, `function nvkm_mm_size`.
- 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.