drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/gr/ga102.c- Extension
.c- Size
- 10679 bytes
- Lines
- 359
- 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
gf100.hctxgf100.hcore/firmware.hsubdev/gsp.hsubdev/acr.hsubdev/timer.hsubdev/vfn.hnvfw/flcn.hnvif/class.h
Detected Declarations
struct netlist_regionstruct netlist_image_headerstruct netlist_imagestruct netlist_av64function filesfunction ga102_gr_gpccs_resetfunction ga102_gr_fecs_resetfunction ga102_gr_init_rop_exceptionsfunction ga102_gr_init_40a790function ga102_gr_init_gpc_mmufunction ga102_gr_oneinit_intrfunction ga102_gr_nonstallfunction ga102_gr_av64_to_initfunction ga102_gr_loadfunction ga102_gr_new
Annotated Snippet
struct netlist_region {
u32 region_id;
u32 data_size;
u32 data_offset;
};
struct netlist_image_header {
u32 version;
u32 regions;
};
struct netlist_image {
struct netlist_image_header header;
struct netlist_region regions[];
};
struct netlist_av64 {
u32 addr;
u32 data_hi;
u32 data_lo;
};
static int
ga102_gr_av64_to_init(struct nvkm_blob *blob, struct gf100_gr_pack **ppack)
{
struct gf100_gr_init *init;
struct gf100_gr_pack *pack;
int nent;
int i;
nent = (blob->size / sizeof(struct netlist_av64));
pack = vzalloc((sizeof(*pack) * 2) + (sizeof(*init) * (nent + 1)));
if (!pack)
return -ENOMEM;
init = (void *)(pack + 2);
pack[0].init = init;
pack[0].type = 64;
for (i = 0; i < nent; i++) {
struct gf100_gr_init *ent = &init[i];
struct netlist_av64 *av = &((struct netlist_av64 *)blob->data)[i];
ent->addr = av->addr;
ent->data = ((u64)av->data_hi << 32) | av->data_lo;
ent->count = 1;
ent->pitch = 1;
}
*ppack = pack;
return 0;
}
static int
ga102_gr_load(struct gf100_gr *gr, int ver, const struct gf100_gr_fwif *fwif)
{
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
const struct firmware *fw;
const struct netlist_image *net;
const struct netlist_region *fecs_inst = NULL;
const struct netlist_region *fecs_data = NULL;
const struct netlist_region *gpccs_inst = NULL;
const struct netlist_region *gpccs_data = NULL;
int ret, i;
ret = nvkm_firmware_get(subdev, "gr/NET_img", 0, &fw);
if (ret)
return ret;
net = (const void *)fw->data;
nvkm_debug(subdev, "netlist version %d, %d regions\n",
net->header.version, net->header.regions);
for (i = 0; i < net->header.regions; i++) {
const struct netlist_region *reg = &net->regions[i];
struct nvkm_blob blob = {
.data = (void *)fw->data + reg->data_offset,
.size = reg->data_size,
};
nvkm_debug(subdev, "\t%2d: %08x %08x\n",
reg->region_id, reg->data_offset, reg->data_size);
switch (reg->region_id) {
case 0: fecs_data = reg; break;
case 1: fecs_inst = reg; break;
case 2: gpccs_data = reg; break;
case 3: gpccs_inst = reg; break;
case 4: gk20a_gr_av_to_init(&blob, &gr->bundle); break;
case 5: gk20a_gr_aiv_to_init(&blob, &gr->sw_ctx); break;
Annotation
- Immediate include surface: `gf100.h`, `ctxgf100.h`, `core/firmware.h`, `subdev/gsp.h`, `subdev/acr.h`, `subdev/timer.h`, `subdev/vfn.h`, `nvfw/flcn.h`.
- Detected declarations: `struct netlist_region`, `struct netlist_image_header`, `struct netlist_image`, `struct netlist_av64`, `function files`, `function ga102_gr_gpccs_reset`, `function ga102_gr_fecs_reset`, `function ga102_gr_init_rop_exceptions`, `function ga102_gr_init_40a790`, `function ga102_gr_init_gpc_mmu`.
- 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.