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.

Dependency Surface

Detected Declarations

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

Implementation Notes