drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c- Extension
.c- Size
- 3834 bytes
- Lines
- 140
- 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
gf100.hram.hcore/memory.hcore/option.hsubdev/therm.h
Detected Declarations
function filesfunction gf100_fb_oneinitfunction gf100_fb_init_pagefunction gf100_fb_sysmem_flush_page_initfunction gf100_fb_initfunction gf100_fb_dtorfunction gf100_fb_new_function gf100_fb_new
Annotated Snippet
#include "gf100.h"
#include "ram.h"
#include <core/memory.h>
#include <core/option.h>
#include <subdev/therm.h>
void
gf100_fb_intr(struct nvkm_fb *base)
{
struct gf100_fb *fb = gf100_fb(base);
struct nvkm_subdev *subdev = &fb->base.subdev;
struct nvkm_device *device = subdev->device;
u32 intr = nvkm_rd32(device, 0x000100);
if (intr & 0x08000000)
nvkm_debug(subdev, "PFFB intr\n");
if (intr & 0x00002000)
nvkm_debug(subdev, "PBFB intr\n");
}
int
gf100_fb_oneinit(struct nvkm_fb *base)
{
struct gf100_fb *fb = gf100_fb(base);
struct nvkm_device *device = fb->base.subdev.device;
int ret, size = 1 << (fb->base.page ? fb->base.page : 17);
size = nvkm_longopt(device->cfgopt, "MmuDebugBufferSize", size);
size = max(size, 0x1000);
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, size, 0x1000,
true, &fb->base.mmu_rd);
if (ret)
return ret;
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, size, 0x1000,
true, &fb->base.mmu_wr);
if (ret)
return ret;
return 0;
}
int
gf100_fb_init_page(struct nvkm_fb *fb)
{
struct nvkm_device *device = fb->subdev.device;
switch (fb->page) {
case 16: nvkm_mask(device, 0x100c80, 0x00000001, 0x00000001); break;
case 17: nvkm_mask(device, 0x100c80, 0x00000001, 0x00000000); break;
default:
return -EINVAL;
}
return 0;
}
void
gf100_fb_sysmem_flush_page_init(struct nvkm_fb *fb)
{
// Ensure that the address can actually fit in the register
WARN_ON(fb->sysmem.flush_page_addr > DMA_BIT_MASK(40));
nvkm_wr32(fb->subdev.device, 0x100c10, fb->sysmem.flush_page_addr >> 8);
}
void
gf100_fb_init(struct nvkm_fb *base)
{
struct gf100_fb *fb = gf100_fb(base);
struct nvkm_device *device = fb->base.subdev.device;
if (base->func->clkgate_pack) {
nvkm_therm_clkgate_init(device->therm,
base->func->clkgate_pack);
}
}
void *
gf100_fb_dtor(struct nvkm_fb *base)
{
struct gf100_fb *fb = gf100_fb(base);
return fb;
}
int
gf100_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{
struct gf100_fb *fb;
Annotation
- Immediate include surface: `gf100.h`, `ram.h`, `core/memory.h`, `core/option.h`, `subdev/therm.h`.
- Detected declarations: `function files`, `function gf100_fb_oneinit`, `function gf100_fb_init_page`, `function gf100_fb_sysmem_flush_page_init`, `function gf100_fb_init`, `function gf100_fb_dtor`, `function gf100_fb_new_`, `function gf100_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.