drivers/gpu/drm/nouveau/nvif/fifo.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvif/fifo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvif/fifo.c- Extension
.c- Size
- 2500 bytes
- Lines
- 86
- 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.
- 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
nvif/fifo.h
Detected Declarations
function filesfunction nvif_fifo_runlist
Annotated Snippet
#include <nvif/fifo.h>
static int
nvif_fifo_runlists(struct nvif_device *device)
{
struct nvif_object *object = &device->object;
TRAILING_OVERLAP(struct nv_device_info_v1, m, data,
struct {
struct nv_device_info_v1_data runlists;
struct nv_device_info_v1_data runlist[64];
} v;
) *a;
int ret, i;
if (device->runlist)
return 0;
if (!(a = kmalloc_obj(*a)))
return -ENOMEM;
a->m.version = 1;
a->m.count = sizeof(a->v) / sizeof(a->v.runlists);
a->v.runlists.mthd = NV_DEVICE_HOST_RUNLISTS;
for (i = 0; i < ARRAY_SIZE(a->v.runlist); i++) {
a->v.runlist[i].mthd = NV_DEVICE_HOST_RUNLIST_ENGINES;
a->v.runlist[i].data = i;
}
ret = nvif_object_mthd(object, NV_DEVICE_V0_INFO, a, sizeof(*a));
if (ret)
goto done;
device->runlists = fls64(a->v.runlists.data);
device->runlist = kzalloc_objs(*device->runlist, device->runlists);
if (!device->runlist) {
ret = -ENOMEM;
goto done;
}
for (i = 0; i < device->runlists; i++) {
if (a->v.runlist[i].mthd != NV_DEVICE_INFO_INVALID)
device->runlist[i].engines = a->v.runlist[i].data;
}
done:
kfree(a);
return ret;
}
u64
nvif_fifo_runlist(struct nvif_device *device, u64 engine)
{
u64 runm = 0;
int ret, i;
if ((ret = nvif_fifo_runlists(device)))
return runm;
for (i = 0; i < device->runlists; i++) {
if (device->runlist[i].engines & engine)
runm |= BIT_ULL(i);
}
return runm;
}
Annotation
- Immediate include surface: `nvif/fifo.h`.
- Detected declarations: `function files`, `function nvif_fifo_runlist`.
- 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.