drivers/gpu/drm/nouveau/nouveau_uvmm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nouveau_uvmm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nouveau_uvmm.c- Extension
.c- Size
- 44563 bytes
- Lines
- 2006
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
nouveau_drv.hnouveau_gem.hnouveau_mem.hnouveau_uvmm.hnvif/vmm.hnvif/mem.hnvif/class.hnvif/if000c.hnvif/if900d.h
Detected Declarations
struct nouveau_uvma_preallocstruct bind_job_opstruct uvmm_map_argsenum vm_bind_opfunction nouveau_uvmm_vmm_sparse_reffunction nouveau_uvmm_vmm_sparse_unreffunction nouveau_uvmm_vmm_getfunction nouveau_uvmm_vmm_putfunction nouveau_uvmm_vmm_unmapfunction nouveau_uvmm_vmm_mapfunction nouveau_uvma_region_sparse_unreffunction nouveau_uvma_vmm_putfunction nouveau_uvma_mapfunction nouveau_uvma_unmapfunction nouveau_uvma_allocfunction nouveau_uvma_freefunction nouveau_uvma_gem_getfunction nouveau_uvma_gem_putfunction nouveau_uvma_region_allocfunction nouveau_uvma_region_freefunction nouveau_uvma_region_getfunction nouveau_uvma_region_putfunction __nouveau_uvma_region_insertfunction nouveau_uvma_region_insertfunction nouveau_uvma_region_removefunction nouveau_uvma_region_createfunction nouveau_uvma_region_find_firstfunction nouveau_uvma_region_findfunction nouveau_uvma_region_emptyfunction __nouveau_uvma_region_destroyfunction nouveau_uvma_region_destroyfunction nouveau_uvma_region_dirtyfunction nouveau_uvma_region_completefunction op_map_prepare_unwindfunction op_unmap_prepare_unwindfunction op_map_aligned_to_page_shiftfunction select_page_shiftfunction nouveau_uvmm_sm_prepare_unwindfunction drm_gpuva_for_each_opfunction nouveau_uvmm_sm_map_prepare_unwindfunction nouveau_uvmm_sm_unmap_prepare_unwindfunction op_map_preparefunction op_unmap_preparefunction nouveau_uvmm_sm_preparefunction drm_gpuva_for_each_opfunction nouveau_uvmm_sm_map_preparefunction nouveau_uvmm_sm_unmap_preparefunction op_gem_obj
Annotated Snippet
struct nouveau_uvma_prealloc {
struct nouveau_uvma *map;
struct nouveau_uvma *prev;
struct nouveau_uvma *next;
};
struct bind_job_op {
struct list_head entry;
enum vm_bind_op op;
u32 flags;
struct drm_gpuvm_bo *vm_bo;
struct {
u64 addr;
u64 range;
} va;
struct {
u32 handle;
u64 offset;
struct drm_gem_object *obj;
} gem;
struct nouveau_uvma_region *reg;
struct nouveau_uvma_prealloc new;
struct drm_gpuva_ops *ops;
};
struct uvmm_map_args {
struct nouveau_uvma_region *region;
u64 addr;
u64 range;
u8 kind;
};
static int
nouveau_uvmm_vmm_sparse_ref(struct nouveau_uvmm *uvmm,
u64 addr, u64 range)
{
struct nvif_vmm *vmm = &uvmm->vmm.vmm;
return nvif_vmm_raw_sparse(vmm, addr, range, true);
}
static int
nouveau_uvmm_vmm_sparse_unref(struct nouveau_uvmm *uvmm,
u64 addr, u64 range)
{
struct nvif_vmm *vmm = &uvmm->vmm.vmm;
return nvif_vmm_raw_sparse(vmm, addr, range, false);
}
static int
nouveau_uvmm_vmm_get(struct nouveau_uvmm *uvmm,
u64 addr, u64 range, u8 page_shift)
{
struct nvif_vmm *vmm = &uvmm->vmm.vmm;
return nvif_vmm_raw_get(vmm, addr, range, page_shift);
}
static int
nouveau_uvmm_vmm_put(struct nouveau_uvmm *uvmm,
u64 addr, u64 range, u8 page_shift)
{
struct nvif_vmm *vmm = &uvmm->vmm.vmm;
return nvif_vmm_raw_put(vmm, addr, range, page_shift);
}
static int
nouveau_uvmm_vmm_unmap(struct nouveau_uvmm *uvmm,
u64 addr, u64 range, u8 page_shift, bool sparse)
{
struct nvif_vmm *vmm = &uvmm->vmm.vmm;
return nvif_vmm_raw_unmap(vmm, addr, range, page_shift, sparse);
}
static int
nouveau_uvmm_vmm_map(struct nouveau_uvmm *uvmm,
u64 addr, u64 range, u8 page_shift,
u64 bo_offset, u8 kind,
struct nouveau_mem *mem)
{
struct nvif_vmm *vmm = &uvmm->vmm.vmm;
union {
Annotation
- Immediate include surface: `nouveau_drv.h`, `nouveau_gem.h`, `nouveau_mem.h`, `nouveau_uvmm.h`, `nvif/vmm.h`, `nvif/mem.h`, `nvif/class.h`, `nvif/if000c.h`.
- Detected declarations: `struct nouveau_uvma_prealloc`, `struct bind_job_op`, `struct uvmm_map_args`, `enum vm_bind_op`, `function nouveau_uvmm_vmm_sparse_ref`, `function nouveau_uvmm_vmm_sparse_unref`, `function nouveau_uvmm_vmm_get`, `function nouveau_uvmm_vmm_put`, `function nouveau_uvmm_vmm_unmap`, `function nouveau_uvmm_vmm_map`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.