drivers/gpu/drm/nouveau/nvif/chan506f.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvif/chan506f.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvif/chan506f.c- Extension
.c- Size
- 1815 bytes
- Lines
- 73
- 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
nvif/chan.h
Detected Declarations
function Copyrightfunction nvif_chan506f_gpfifo_pushfunction nvif_chan506f_gpfifo_read_getfunction nvif_chan506f_read_getfunction nvif_chan506f_ctor
Annotated Snippet
#include <nvif/chan.h>
void
nvif_chan506f_gpfifo_kick(struct nvif_chan *chan)
{
wmb();
nvif_wr32(&chan->userd, 0x8c, chan->gpfifo.cur);
}
void
nvif_chan506f_gpfifo_push(struct nvif_chan *chan, bool main, u64 addr, u32 size, bool no_prefetch)
{
u32 gpptr = chan->gpfifo.cur << 3;
if (WARN_ON(!chan->gpfifo.free))
return;
nvif_wr32(&chan->gpfifo, gpptr + 0, lower_32_bits(addr));
nvif_wr32(&chan->gpfifo, gpptr + 4, upper_32_bits(addr) |
(main ? 0 : BIT(9)) |
(size >> 2) << 10 |
(no_prefetch ? BIT(31) : 0));
chan->gpfifo.cur = (chan->gpfifo.cur + 1) & chan->gpfifo.max;
chan->gpfifo.free--;
if (!chan->gpfifo.free)
chan->push.end = chan->push.cur;
}
static u32
nvif_chan506f_gpfifo_read_get(struct nvif_chan *chan)
{
return nvif_rd32(&chan->userd, 0x88);
}
static u32
nvif_chan506f_read_get(struct nvif_chan *chan)
{
u32 tlgetlo = nvif_rd32(&chan->userd, 0x58);
u32 tlgethi = nvif_rd32(&chan->userd, 0x5c);
struct nvif_push *push = &chan->push;
/* Update cached GET pointer if TOP_LEVEL_GET is valid. */
if (tlgethi & BIT(31)) {
u64 tlget = ((u64)(tlgethi & 0xff) << 32) | tlgetlo;
push->hw.get = (tlget - push->addr) >> 2;
}
return push->hw.get;
}
static const struct nvif_chan_func
nvif_chan506f = {
.push.read_get = nvif_chan506f_read_get,
.gpfifo.read_get = nvif_chan506f_gpfifo_read_get,
.gpfifo.push = nvif_chan506f_gpfifo_push,
.gpfifo.kick = nvif_chan506f_gpfifo_kick,
};
int
nvif_chan506f_ctor(struct nvif_chan *chan, void *userd, void *gpfifo, u32 gpfifo_size,
void *push, u64 push_addr, u32 push_size)
{
nvif_chan_gpfifo_ctor(&nvif_chan506f, userd, gpfifo, gpfifo_size,
push, push_addr, push_size, chan);
return 0;
}
Annotation
- Immediate include surface: `nvif/chan.h`.
- Detected declarations: `function Copyright`, `function nvif_chan506f_gpfifo_push`, `function nvif_chan506f_gpfifo_read_get`, `function nvif_chan506f_read_get`, `function nvif_chan506f_ctor`.
- 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.