drivers/gpu/drm/nouveau/nvkm/subdev/mmu/memnv04.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/memnv04.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/memnv04.c- Extension
.c- Size
- 2244 bytes
- Lines
- 70
- 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
mem.hcore/memory.hsubdev/fb.hnvif/if000b.hnvif/unpack.h
Detected Declarations
function filesfunction nv04_mem_new
Annotated Snippet
#include "mem.h"
#include <core/memory.h>
#include <subdev/fb.h>
#include <nvif/if000b.h>
#include <nvif/unpack.h>
int
nv04_mem_map(struct nvkm_mmu *mmu, struct nvkm_memory *memory, void *argv,
u32 argc, u64 *paddr, u64 *psize, struct nvkm_vma **pvma)
{
union {
struct nv04_mem_map_vn vn;
} *args = argv;
struct nvkm_device *device = mmu->subdev.device;
const u64 addr = nvkm_memory_addr(memory);
int ret = -ENOSYS;
if ((ret = nvif_unvers(ret, &argv, &argc, args->vn)))
return ret;
*paddr = device->func->resource_addr(device, NVKM_BAR1_FB) + addr;
*psize = nvkm_memory_size(memory);
*pvma = ERR_PTR(-ENODEV);
return 0;
}
int
nv04_mem_new(struct nvkm_mmu *mmu, int type, u8 page, u64 size,
void *argv, u32 argc, struct nvkm_memory **pmemory)
{
union {
struct nv04_mem_vn vn;
} *args = argv;
int ret = -ENOSYS;
if ((ret = nvif_unvers(ret, &argv, &argc, args->vn)))
return ret;
if (mmu->type[type].type & NVKM_MEM_MAPPABLE)
type = NVKM_RAM_MM_NORMAL;
else
type = NVKM_RAM_MM_NOMAP;
return nvkm_ram_get(mmu->subdev.device, type, 0x01, page,
size, true, false, pmemory);
}
Annotation
- Immediate include surface: `mem.h`, `core/memory.h`, `subdev/fb.h`, `nvif/if000b.h`, `nvif/unpack.h`.
- Detected declarations: `function files`, `function nv04_mem_new`.
- 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.