drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c- Extension
.c- Size
- 16609 bytes
- Lines
- 627
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
priv.hcgrp.hchan.hchid.hrunl.hrunq.hcore/gpuobj.hsubdev/gsp.hsubdev/top.hsubdev/vfn.hnvif/class.h
Detected Declarations
function filesfunction ga100_chan_stopfunction ga100_chan_startfunction ga100_chan_unbindfunction ga100_chan_ramfc_writefunction ga100_cgrp_preemptfunction ga100_engn_cxidfunction ga100_engn_nonstallfunction ga100_runq_idlefunction ga100_runq_intr_1function ga100_runq_intr_0function ga100_runq_intrfunction ga100_runq_initfunction ga100_runl_preempt_pendingfunction ga100_runl_preemptfunction ga100_runl_allowfunction ga100_runl_blockfunction ga100_runl_pendingfunction ga100_runl_commitfunction ga100_runl_intrfunction ga100_runl_finifunction ga100_runl_initfunction ga100_runl_newfunction nvkm_list_foreachfunction ga100_fifo_nonstall_intrfunction ga100_fifo_nonstall_blockfunction ga100_fifo_nonstall_ctorfunction nvkm_runl_foreachfunction ga100_fifo_nonstall_dtorfunction nvkm_runl_foreachfunction ga100_fifo_runl_ctorfunction nvkm_list_foreachfunction ga100_fifo_new
Annotated Snippet
if (chan) {
nvkm_chan_error(chan, true);
nvkm_chan_put(&chan, flags);
}
nvkm_mask(device, 0x0400ac + (runq->id * 0x800), 0x00030000, 0x00030000);
stat &= ~0x80000000;
}
if (stat) {
RUNQ_ERROR(runq, "intr1 %08x", stat);
nvkm_wr32(device, 0x0401a0 + (runq->id * 0x800), stat);
}
nvkm_wr32(device, 0x040148 + (runq->id * 0x800), intr);
return true;
}
static bool
ga100_runq_intr_0(struct nvkm_runq *runq, struct nvkm_runl *runl)
{
struct nvkm_device *device = runq->fifo->engine.subdev.device;
u32 inte = nvkm_rd32(device, 0x040170 + (runq->id * 0x800));
u32 intr = nvkm_rd32(device, 0x040108 + (runq->id * 0x800));
u32 stat = intr & inte;
if (!stat) {
RUNQ_DEBUG(runq, "inte0 %08x %08x", intr, inte);
return false;
}
/*TODO: expand on this when fixing up gf100's version. */
if (stat & 0xc6afe000) {
u32 chid = nvkm_rd32(device, 0x040120 + (runq->id * 0x0800)) & runl->chid->mask;
struct nvkm_chan *chan;
unsigned long flags;
RUNQ_ERROR(runq, "intr0 %08x", stat);
chan = nvkm_runl_chan_get_chid(runl, chid, &flags);
if (chan) {
nvkm_chan_error(chan, true);
nvkm_chan_put(&chan, flags);
}
stat &= ~0xc6afe000;
}
if (stat) {
RUNQ_ERROR(runq, "intr0 %08x", stat);
nvkm_wr32(device, 0x040190 + (runq->id * 0x800), stat);
}
nvkm_wr32(device, 0x040108 + (runq->id * 0x800), intr);
return true;
}
static bool
ga100_runq_intr(struct nvkm_runq *runq, struct nvkm_runl *runl)
{
bool intr0 = ga100_runq_intr_0(runq, runl);
bool intr1 = ga100_runq_intr_1(runq, runl);
return intr0 || intr1;
}
static void
ga100_runq_init(struct nvkm_runq *runq)
{
struct nvkm_device *device = runq->fifo->engine.subdev.device;
nvkm_wr32(device, 0x040108 + (runq->id * 0x800), 0xffffffff); /* INTR_0 */
nvkm_wr32(device, 0x040148 + (runq->id * 0x800), 0xffffffff); /* INTR_1 */
nvkm_wr32(device, 0x040170 + (runq->id * 0x800), 0xffffffff); /* INTR_0_EN_SET_TREE */
nvkm_wr32(device, 0x040180 + (runq->id * 0x800), 0xffffffff); /* INTR_1_EN_SET_TREE */
}
const struct nvkm_runq_func
ga100_runq = {
.init = ga100_runq_init,
.intr = ga100_runq_intr,
.idle = ga100_runq_idle,
};
static bool
ga100_runl_preempt_pending(struct nvkm_runl *runl)
{
return nvkm_rd32(runl->fifo->engine.subdev.device, runl->addr + 0x098) & 0x00100000;
}
static void
Annotation
- Immediate include surface: `priv.h`, `cgrp.h`, `chan.h`, `chid.h`, `runl.h`, `runq.h`, `core/gpuobj.h`, `subdev/gsp.h`.
- Detected declarations: `function files`, `function ga100_chan_stop`, `function ga100_chan_start`, `function ga100_chan_unbind`, `function ga100_chan_ramfc_write`, `function ga100_cgrp_preempt`, `function ga100_engn_cxid`, `function ga100_engn_nonstall`, `function ga100_runq_idle`, `function ga100_runq_intr_1`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.