drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c- Extension
.c- Size
- 26564 bytes
- Lines
- 970
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/bar.hsubdev/fault.hsubdev/mc.hsubdev/mmu.hengine/sw.hnvif/class.h
Detected Declarations
struct gf100_engn_statusfunction filesfunction gf100_chan_stopfunction gf100_chan_startfunction gf100_chan_unbindfunction gf100_chan_bindfunction gf100_chan_ramfc_writefunction gf100_chan_userd_clearfunction gf100_ectx_bindfunction gf100_ectx_ctorfunction gf100_engn_mmu_fault_triggeredfunction gf100_engn_mmu_fault_triggerfunction gf100_engn_statusfunction gf100_engn_cxidfunction gf100_engn_chswfunction gf100_runq_intrfunction gf100_runq_initfunction gf100_runl_preempt_pendingfunction gf100_runl_fault_clearfunction gf100_runl_allowfunction gf100_runl_blockfunction gf100_runl_pendingfunction gf100_runl_commitfunction gf100_runl_insert_chanfunction gf100_fifo_nonstall_allowfunction gf100_fifo_nonstall_blockfunction gf100_fifo_mmu_fault_recoverfunction gf100_fifo_intr_ctxsw_timeoutfunction nvkm_runl_foreachfunction nvkm_runl_foreach_engn_condfunction gf100_fifo_intr_sched_ctxswfunction nvkm_runl_foreach_engn_condfunction gf100_fifo_intr_schedfunction gf100_fifo_intr_mmu_fault_unitfunction gf100_fifo_intr_mmu_faultfunction for_each_set_bitfunction gf100_fifo_intr_pbdmafunction nvkm_runq_foreach_condfunction gf100_fifo_intr_runlistfunction gf100_fifo_intr_engine_unitfunction gf100_fifo_intr_enginefunction gf100_fifo_intrfunction gf100_fifo_init_pbdmasfunction gf100_fifo_initfunction gf100_fifo_runl_ctorfunction gf100_fifo_runq_nrfunction gf100_fifo_chid_ctorfunction gf100_fifo_new
Annotated Snippet
struct gf100_engn_status {
bool busy;
bool save;
bool unk0;
bool unk1;
u8 chid;
};
static void
gf100_engn_status(struct nvkm_engn *engn, struct gf100_engn_status *status)
{
u32 stat = nvkm_rd32(engn->engine->subdev.device, 0x002640 + (engn->id * 4));
status->busy = (stat & 0x10000000);
status->save = (stat & 0x00100000);
status->unk0 = (stat & 0x00004000);
status->unk1 = (stat & 0x00001000);
status->chid = (stat & 0x0000007f);
ENGN_DEBUG(engn, "%08x: busy %d save %d unk0 %d unk1 %d chid %d",
stat, status->busy, status->save, status->unk0, status->unk1, status->chid);
}
static int
gf100_engn_cxid(struct nvkm_engn *engn, bool *cgid)
{
struct gf100_engn_status status;
gf100_engn_status(engn, &status);
if (status.busy) {
*cgid = false;
return status.chid;
}
return -ENODEV;
}
static bool
gf100_engn_chsw(struct nvkm_engn *engn)
{
struct gf100_engn_status status;
gf100_engn_status(engn, &status);
if (status.busy && (status.unk0 || status.unk1))
return true;
return false;
}
static const struct nvkm_engn_func
gf100_engn = {
.chsw = gf100_engn_chsw,
.cxid = gf100_engn_cxid,
.mmu_fault_trigger = gf100_engn_mmu_fault_trigger,
.mmu_fault_triggered = gf100_engn_mmu_fault_triggered,
.ctor = gf100_ectx_ctor,
.bind = gf100_ectx_bind,
};
const struct nvkm_engn_func
gf100_engn_sw = {
};
static const struct nvkm_bitfield
gf100_runq_intr_0_names[] = {
/* { 0x00008000, "" } seen with null ib push */
{ 0x00200000, "ILLEGAL_MTHD" },
{ 0x00800000, "EMPTY_SUBC" },
{}
};
bool
gf100_runq_intr(struct nvkm_runq *runq, struct nvkm_runl *null)
{
struct nvkm_subdev *subdev = &runq->fifo->engine.subdev;
struct nvkm_device *device = subdev->device;
u32 mask = nvkm_rd32(device, 0x04010c + (runq->id * 0x2000));
u32 stat = nvkm_rd32(device, 0x040108 + (runq->id * 0x2000)) & mask;
u32 addr = nvkm_rd32(device, 0x0400c0 + (runq->id * 0x2000));
u32 data = nvkm_rd32(device, 0x0400c4 + (runq->id * 0x2000));
u32 chid = nvkm_rd32(device, 0x040120 + (runq->id * 0x2000)) & runq->fifo->chid->mask;
u32 subc = (addr & 0x00070000) >> 16;
u32 mthd = (addr & 0x00003ffc);
u32 show = stat;
struct nvkm_chan *chan;
unsigned long flags;
char msg[128];
if (stat & 0x00800000) {
if (device->sw) {
Annotation
- Immediate include surface: `priv.h`, `cgrp.h`, `chan.h`, `chid.h`, `runl.h`, `runq.h`, `core/gpuobj.h`, `subdev/bar.h`.
- Detected declarations: `struct gf100_engn_status`, `function files`, `function gf100_chan_stop`, `function gf100_chan_start`, `function gf100_chan_unbind`, `function gf100_chan_bind`, `function gf100_chan_ramfc_write`, `function gf100_chan_userd_clear`, `function gf100_ectx_bind`, `function gf100_ectx_ctor`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.