drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h- Extension
.h- Size
- 3891 bytes
- Lines
- 179
- 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
subdev/fb.hsubdev/pmu.h
Detected Declarations
struct ramfucstruct ramfuc_regfunction ramfuc_stridefunction ramfuc_reg2function ramfuc_regfunction ramfuc_initfunction ramfuc_execfunction ramfuc_rd32function ramfuc_wr32function ramfuc_nukefunction ramfuc_maskfunction ramfuc_waitfunction ramfuc_nsecfunction ramfuc_wait_vblankfunction ramfuc_trainfunction ramfuc_train_resultfunction ramfuc_blockfunction ramfuc_unblock
Annotated Snippet
struct ramfuc {
struct nvkm_memx *memx;
struct nvkm_fb *fb;
int sequence;
};
struct ramfuc_reg {
int sequence;
bool force;
u32 addr;
u32 stride; /* in bytes */
u32 mask;
u32 data;
};
static inline struct ramfuc_reg
ramfuc_stride(u32 addr, u32 stride, u32 mask)
{
return (struct ramfuc_reg) {
.sequence = 0,
.addr = addr,
.stride = stride,
.mask = mask,
.data = 0xdeadbeef,
};
}
static inline struct ramfuc_reg
ramfuc_reg2(u32 addr1, u32 addr2)
{
return (struct ramfuc_reg) {
.sequence = 0,
.addr = addr1,
.stride = addr2 - addr1,
.mask = 0x3,
.data = 0xdeadbeef,
};
}
static noinline struct ramfuc_reg
ramfuc_reg(u32 addr)
{
return (struct ramfuc_reg) {
.sequence = 0,
.addr = addr,
.stride = 0,
.mask = 0x1,
.data = 0xdeadbeef,
};
}
static inline int
ramfuc_init(struct ramfuc *ram, struct nvkm_fb *fb)
{
int ret = nvkm_memx_init(fb->subdev.device->pmu, &ram->memx);
if (ret)
return ret;
ram->sequence++;
ram->fb = fb;
return 0;
}
static inline int
ramfuc_exec(struct ramfuc *ram, bool exec)
{
int ret = 0;
if (ram->fb) {
ret = nvkm_memx_fini(&ram->memx, exec);
ram->fb = NULL;
}
return ret;
}
static inline u32
ramfuc_rd32(struct ramfuc *ram, struct ramfuc_reg *reg)
{
struct nvkm_device *device = ram->fb->subdev.device;
if (reg->sequence != ram->sequence)
reg->data = nvkm_rd32(device, reg->addr);
return reg->data;
}
static inline void
ramfuc_wr32(struct ramfuc *ram, struct ramfuc_reg *reg, u32 data)
{
unsigned int mask, off = 0;
reg->sequence = ram->sequence;
reg->data = data;
Annotation
- Immediate include surface: `subdev/fb.h`, `subdev/pmu.h`.
- Detected declarations: `struct ramfuc`, `struct ramfuc_reg`, `function ramfuc_stride`, `function ramfuc_reg2`, `function ramfuc_reg`, `function ramfuc_init`, `function ramfuc_exec`, `function ramfuc_rd32`, `function ramfuc_wr32`, `function ramfuc_nuke`.
- 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.