drivers/gpu/drm/nouveau/nvkm/core/engine.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/core/engine.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/core/engine.c- Extension
.c- Size
- 4748 bytes
- Lines
- 190
- 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
core/engine.hcore/device.hcore/option.hsubdev/fb.h
Detected Declarations
function filesfunction nvkm_engine_resetfunction nvkm_engine_unreffunction nvkm_engine_reffunction nvkm_engine_tilefunction nvkm_engine_intrfunction nvkm_engine_infofunction nvkm_engine_finifunction nvkm_engine_initfunction nvkm_engine_oneinitfunction nvkm_engine_preinitfunction nvkm_engine_dtorfunction nvkm_engine_ctorfunction nvkm_engine_new_
Annotated Snippet
#include <core/engine.h>
#include <core/device.h>
#include <core/option.h>
#include <subdev/fb.h>
bool
nvkm_engine_chsw_load(struct nvkm_engine *engine)
{
if (engine->func->chsw_load)
return engine->func->chsw_load(engine);
return false;
}
int
nvkm_engine_reset(struct nvkm_engine *engine)
{
if (engine->func->reset)
return engine->func->reset(engine);
nvkm_subdev_fini(&engine->subdev, NVKM_POWEROFF);
return nvkm_subdev_init(&engine->subdev);
}
void
nvkm_engine_unref(struct nvkm_engine **pengine)
{
struct nvkm_engine *engine = *pengine;
if (engine) {
nvkm_subdev_unref(&engine->subdev);
*pengine = NULL;
}
}
struct nvkm_engine *
nvkm_engine_ref(struct nvkm_engine *engine)
{
int ret;
if (engine) {
ret = nvkm_subdev_ref(&engine->subdev);
if (ret)
return ERR_PTR(ret);
}
return engine;
}
void
nvkm_engine_tile(struct nvkm_engine *engine, int region)
{
struct nvkm_fb *fb = engine->subdev.device->fb;
if (engine->func->tile)
engine->func->tile(engine, region, &fb->tile.region[region]);
}
static void
nvkm_engine_intr(struct nvkm_subdev *subdev)
{
struct nvkm_engine *engine = nvkm_engine(subdev);
if (engine->func->intr)
engine->func->intr(engine);
}
static int
nvkm_engine_info(struct nvkm_subdev *subdev, u64 mthd, u64 *data)
{
struct nvkm_engine *engine = nvkm_engine(subdev);
if (engine->func->info)
return engine->func->info(engine, mthd, data);
return -ENOSYS;
}
static int
nvkm_engine_fini(struct nvkm_subdev *subdev, enum nvkm_suspend_state suspend)
{
struct nvkm_engine *engine = nvkm_engine(subdev);
if (engine->func->fini)
return engine->func->fini(engine, suspend);
return 0;
}
static int
nvkm_engine_init(struct nvkm_subdev *subdev)
{
struct nvkm_engine *engine = nvkm_engine(subdev);
struct nvkm_fb *fb = subdev->device->fb;
Annotation
- Immediate include surface: `core/engine.h`, `core/device.h`, `core/option.h`, `subdev/fb.h`.
- Detected declarations: `function files`, `function nvkm_engine_reset`, `function nvkm_engine_unref`, `function nvkm_engine_ref`, `function nvkm_engine_tile`, `function nvkm_engine_intr`, `function nvkm_engine_info`, `function nvkm_engine_fini`, `function nvkm_engine_init`, `function nvkm_engine_oneinit`.
- 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.