drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c- Extension
.c- Size
- 17800 bytes
- Lines
- 618
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
engine/fifo/priv.hengine/fifo/cgrp.hengine/fifo/chan.hengine/fifo/chid.hengine/fifo/runl.hcore/gpuobj.hsubdev/gsp.hsubdev/mmu.hsubdev/vfn.hengine/gr.hrm/engine.hnvhw/drf.hnvrm/fifo.hnvrm/engine.h
Detected Declarations
function filesfunction r535_chan_stopfunction r535_chan_allocfunction r535_chan_ramfc_writefunction nvkm_runl_foreach_engnfunction r535_engn_nonstallfunction r535_gr_ctorfunction r535_flcn_bindfunction r535_flcn_ctorfunction r535_runl_allowfunction r535_fifo_rc_chidfunction r535_fifo_rc_triggeredfunction r535_fifo_xlat_rm_engine_typefunction r535_fifo_ectx_sizefunction nvkm_runl_foreachfunction r535_fifo_runl_ctorfunction r535_fifo_dtorfunction r535_fifo_new
Annotated Snippet
if (1) {
NVA06F_CTRL_BIND_PARAMS *ctrl;
ctrl = nvkm_gsp_rm_ctrl_get(&chan->rm.object,
NVA06F_CTRL_CMD_BIND, sizeof(*ctrl));
if (WARN_ON(IS_ERR(ctrl)))
return PTR_ERR(ctrl);
ctrl->engineType = eT;
ret = nvkm_gsp_rm_ctrl_wr(&chan->rm.object, ctrl);
if (ret)
return ret;
}
ctrl = nvkm_gsp_rm_ctrl_get(&chan->rm.object,
NVA06F_CTRL_CMD_GPFIFO_SCHEDULE, sizeof(*ctrl));
if (WARN_ON(IS_ERR(ctrl)))
return PTR_ERR(ctrl);
ctrl->bEnable = 1;
ret = nvkm_gsp_rm_ctrl_wr(&chan->rm.object, ctrl);
}
return ret;
}
static const struct nvkm_chan_func_ramfc
r535_chan_ramfc = {
.write = r535_chan_ramfc_write,
.clear = r535_chan_ramfc_clear,
.devm = 0xfff,
.priv = true,
};
static const struct nvkm_chan_func
r535_chan = {
.inst = &gf100_chan_inst,
.userd = &gv100_chan_userd,
.ramfc = &r535_chan_ramfc,
.start = r535_chan_start,
.stop = r535_chan_stop,
.doorbell_handle = r535_chan_doorbell_handle,
};
static int
r535_engn_nonstall(struct nvkm_engn *engn)
{
struct nvkm_subdev *subdev = &engn->engine->subdev;
int ret;
ret = nvkm_gsp_intr_nonstall(subdev->device->gsp, subdev->type, subdev->inst);
WARN_ON(ret == -ENOENT);
return ret;
}
static const struct nvkm_engn_func
r535_engn_ce = {
.nonstall = r535_engn_nonstall,
};
static int
r535_gr_ctor(struct nvkm_engn *engn, struct nvkm_vctx *vctx, struct nvkm_chan *chan)
{
/* RM requires GR context buffers to remain mapped until after the
* channel has been destroyed (as opposed to after the last gr obj
* has been deleted).
*
* Take an extra ref here, which will be released once the channel
* object has been deleted.
*/
refcount_inc(&vctx->refs);
chan->rm.grctx = vctx;
return 0;
}
static const struct nvkm_engn_func
r535_engn_gr = {
.nonstall = r535_engn_nonstall,
.ctor2 = r535_gr_ctor,
};
static int
r535_flcn_bind(struct nvkm_engn *engn, struct nvkm_vctx *vctx, struct nvkm_chan *chan)
{
struct nvkm_gsp_client *client = &chan->vmm->rm.client;
NV2080_CTRL_GPU_PROMOTE_CTX_PARAMS *ctrl;
ctrl = nvkm_gsp_rm_ctrl_get(&chan->vmm->rm.device.subdevice,
NV2080_CTRL_CMD_GPU_PROMOTE_CTX, sizeof(*ctrl));
Annotation
- Immediate include surface: `engine/fifo/priv.h`, `engine/fifo/cgrp.h`, `engine/fifo/chan.h`, `engine/fifo/chid.h`, `engine/fifo/runl.h`, `core/gpuobj.h`, `subdev/gsp.h`, `subdev/mmu.h`.
- Detected declarations: `function files`, `function r535_chan_stop`, `function r535_chan_alloc`, `function r535_chan_ramfc_write`, `function nvkm_runl_foreach_engn`, `function r535_engn_nonstall`, `function r535_gr_ctor`, `function r535_flcn_bind`, `function r535_flcn_ctor`, `function r535_runl_allow`.
- 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.