drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c- Extension
.c- Size
- 2445 bytes
- Lines
- 88
- 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.
- 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
priv.hram.hsubdev/gsp.h
Detected Declarations
function r535_fb_ram_newfunction r535_fb_dtorfunction r535_fb_new
Annotated Snippet
#include "priv.h"
#include "ram.h"
#include <subdev/gsp.h>
static const struct nvkm_ram_func
r535_fb_ram = {
};
static int
r535_fb_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
{
struct nvkm_gsp *gsp = fb->subdev.device->gsp;
struct nvkm_ram *ram;
int ret;
if (!(ram = *pram = kzalloc_obj(*ram)))
return -ENOMEM;
ram->func = &r535_fb_ram;
ram->fb = fb;
ram->type = NVKM_RAM_TYPE_UNKNOWN; /*TODO: pull this from GSP. */
ram->size = gsp->fb.size;
ram->stolen = false;
mutex_init(&ram->mutex);
for (int i = 0; i < gsp->fb.region_nr; i++) {
ret = nvkm_mm_init(&ram->vram, NVKM_RAM_MM_NORMAL,
gsp->fb.region[i].addr >> NVKM_RAM_MM_SHIFT,
gsp->fb.region[i].size >> NVKM_RAM_MM_SHIFT,
1);
if (ret)
return ret;
}
return 0;
}
static void *
r535_fb_dtor(struct nvkm_fb *fb)
{
kfree(fb->func);
return fb;
}
int
r535_fb_new(const struct nvkm_fb_func *hw,
struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{
struct nvkm_fb_func *rm;
int ret;
if (!(rm = kzalloc_obj(*rm)))
return -ENOMEM;
rm->dtor = r535_fb_dtor;
rm->sysmem.flush_page_init = hw->sysmem.flush_page_init;
rm->vidmem.size = hw->vidmem.size;
rm->ram_new = r535_fb_ram_new;
ret = nvkm_fb_new_(rm, device, type, inst, pfb);
if (ret)
kfree(rm);
return ret;
}
Annotation
- Immediate include surface: `priv.h`, `ram.h`, `subdev/gsp.h`.
- Detected declarations: `function r535_fb_ram_new`, `function r535_fb_dtor`, `function r535_fb_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.