drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c- Extension
.c- Size
- 33873 bytes
- Lines
- 1003
- 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
ctxgf100.hsubdev/fb.hsubdev/mc.h
Detected Declarations
function gk104_grctx_generate_r418800function gk104_grctx_generate_patch_ltcfunction gk104_grctx_generate_bundlefunction gk104_grctx_generate_pagepoolfunction gk104_grctx_generate_unknfunction gk104_grctx_generate_r419f78function gk104_grctx_generate_gpc_tpc_nrfunction gk104_grctx_generate_alpha_beta_tables
Annotated Snippet
if (alpha) {
abits = atarget ? ppc_tpcs : 0;
bbits = ppc_tpcs - abits;
} else {
bbits = btarget ? ppc_tpcs : 0;
abits = ppc_tpcs - bbits;
}
pmask = gr->ppc_tpc_mask[gpc][ppc];
while (ppc_tpcs-- > abits)
pmask &= pmask - 1;
amask |= (u64)pmask << (gpc * 8);
pmask ^= gr->ppc_tpc_mask[gpc][ppc];
bmask |= (u64)pmask << (gpc * 8);
atarget -= min(abits, atarget);
btarget -= min(bbits, btarget);
if ((abits > 0) || (bbits > 0))
alpha = !alpha;
}
}
for (j = 0; j < gr->gpc_nr; j += 4, amask >>= 32, bmask >>= 32) {
nvkm_wr32(device, 0x406800 + (i * 0x20) + j, amask);
nvkm_wr32(device, 0x406c00 + (i * 0x20) + j, bmask);
}
}
}
const struct gf100_grctx_func
gk104_grctx = {
.main = gf100_grctx_generate_main,
.unkn = gk104_grctx_generate_unkn,
.hub = gk104_grctx_pack_hub,
.gpc_0 = gk104_grctx_pack_gpc_0,
.gpc_1 = gk104_grctx_pack_gpc_1,
.zcull = gf100_grctx_pack_zcull,
.tpc = gk104_grctx_pack_tpc,
.ppc = gk104_grctx_pack_ppc,
.icmd = gk104_grctx_pack_icmd,
.mthd = gk104_grctx_pack_mthd,
.bundle = gk104_grctx_generate_bundle,
.bundle_size = 0x3000,
.bundle_min_gpm_fifo_depth = 0x180,
.bundle_token_limit = 0x600,
.pagepool = gk104_grctx_generate_pagepool,
.pagepool_size = 0x8000,
.attrib_cb_size = gf100_grctx_generate_attrib_cb_size,
.attrib_cb = gf100_grctx_generate_attrib_cb,
.attrib = gf117_grctx_generate_attrib,
.attrib_nr_max = 0x324,
.attrib_nr = 0x218,
.alpha_nr_max = 0x7ff,
.alpha_nr = 0x648,
.patch_ltc = gk104_grctx_generate_patch_ltc,
.sm_id = gf100_grctx_generate_sm_id,
.tpc_nr = gf100_grctx_generate_tpc_nr,
.rop_mapping = gf117_grctx_generate_rop_mapping,
.alpha_beta_tables = gk104_grctx_generate_alpha_beta_tables,
.dist_skip_table = gf117_grctx_generate_dist_skip_table,
.gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr,
.r419f78 = gk104_grctx_generate_r419f78,
.r418800 = gk104_grctx_generate_r418800,
};
Annotation
- Immediate include surface: `ctxgf100.h`, `subdev/fb.h`, `subdev/mc.h`.
- Detected declarations: `function gk104_grctx_generate_r418800`, `function gk104_grctx_generate_patch_ltc`, `function gk104_grctx_generate_bundle`, `function gk104_grctx_generate_pagepool`, `function gk104_grctx_generate_unkn`, `function gk104_grctx_generate_r419f78`, `function gk104_grctx_generate_gpc_tpc_nr`, `function gk104_grctx_generate_alpha_beta_tables`.
- 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.