drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c- Extension
.c- Size
- 6473 bytes
- Lines
- 263
- 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.
- 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
priv.hconn.hhead.hior.houtp.hcore/client.hcore/ramht.hnvif/class.hnvif/cl0046.hnvif/event.hnvif/unpack.h
Detected Declarations
function filesfunction nvkm_disp_vblank_initfunction nvkm_disp_vblankfunction nvkm_disp_class_newfunction nvkm_disp_class_getfunction nvkm_disp_intrfunction nvkm_disp_finifunction list_for_each_entryfunction nvkm_disp_initfunction list_for_each_entryfunction nvkm_disp_oneinitfunction nvkm_disp_dtorfunction nvkm_disp_new_
Annotated Snippet
#include "priv.h"
#include "conn.h"
#include "head.h"
#include "ior.h"
#include "outp.h"
#include <core/client.h>
#include <core/ramht.h>
#include <nvif/class.h>
#include <nvif/cl0046.h>
#include <nvif/event.h>
#include <nvif/unpack.h>
static void
nvkm_disp_vblank_fini(struct nvkm_event *event, int type, int id)
{
struct nvkm_disp *disp = container_of(event, typeof(*disp), vblank);
struct nvkm_head *head = nvkm_head_find(disp, id);
if (head)
head->func->vblank_put(head);
}
static void
nvkm_disp_vblank_init(struct nvkm_event *event, int type, int id)
{
struct nvkm_disp *disp = container_of(event, typeof(*disp), vblank);
struct nvkm_head *head = nvkm_head_find(disp, id);
if (head)
head->func->vblank_get(head);
}
static const struct nvkm_event_func
nvkm_disp_vblank_func = {
.init = nvkm_disp_vblank_init,
.fini = nvkm_disp_vblank_fini,
};
void
nvkm_disp_vblank(struct nvkm_disp *disp, int head)
{
nvkm_event_ntfy(&disp->vblank, head, NVKM_DISP_HEAD_EVENT_VBLANK);
}
static int
nvkm_disp_class_new(struct nvkm_device *device,
const struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
return nvkm_udisp_new(oclass, data, size, pobject);
}
static const struct nvkm_device_oclass
nvkm_disp_sclass = {
.ctor = nvkm_disp_class_new,
};
static int
nvkm_disp_class_get(struct nvkm_oclass *oclass, int index,
const struct nvkm_device_oclass **class)
{
struct nvkm_disp *disp = nvkm_disp(oclass->engine);
if (index == 0) {
oclass->base = disp->func->root;
*class = &nvkm_disp_sclass;
return 0;
}
return 1;
}
static void
nvkm_disp_intr(struct nvkm_engine *engine)
{
struct nvkm_disp *disp = nvkm_disp(engine);
disp->func->intr(disp);
}
static int
nvkm_disp_fini(struct nvkm_engine *engine, enum nvkm_suspend_state suspend)
{
struct nvkm_disp *disp = nvkm_disp(engine);
struct nvkm_outp *outp;
if (disp->func->fini)
disp->func->fini(disp, suspend != NVKM_POWEROFF);
list_for_each_entry(outp, &disp->outps, head) {
if (outp->func->fini)
outp->func->fini(outp);
}
Annotation
- Immediate include surface: `priv.h`, `conn.h`, `head.h`, `ior.h`, `outp.h`, `core/client.h`, `core/ramht.h`, `nvif/class.h`.
- Detected declarations: `function files`, `function nvkm_disp_vblank_init`, `function nvkm_disp_vblank`, `function nvkm_disp_class_new`, `function nvkm_disp_class_get`, `function nvkm_disp_intr`, `function nvkm_disp_fini`, `function list_for_each_entry`, `function nvkm_disp_init`, `function list_for_each_entry`.
- 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.
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.