drivers/gpu/drm/nouveau/nvkm/core/uevent.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/core/uevent.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/core/uevent.c- Extension
.c- Size
- 4280 bytes
- Lines
- 158
- 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/event.hcore/client.hnvif/if000e.h
Detected Declarations
struct nvkm_ueventfunction nvkm_uevent_mthd_blockfunction nvkm_uevent_mthd_allowfunction nvkm_uevent_mthdfunction nvkm_uevent_finifunction nvkm_uevent_initfunction nvkm_uevent_dtorfunction nvkm_uevent_ntfyfunction nvkm_uevent_addfunction nvkm_uevent_new
Annotated Snippet
struct nvkm_uevent {
struct nvkm_object object;
struct nvkm_object *parent;
nvkm_uevent_func func;
bool wait;
struct nvkm_event_ntfy ntfy;
atomic_t allowed;
};
static int
nvkm_uevent_mthd_block(struct nvkm_uevent *uevent, union nvif_event_block_args *args, u32 argc)
{
if (argc != sizeof(args->vn))
return -ENOSYS;
nvkm_event_ntfy_block(&uevent->ntfy);
atomic_set(&uevent->allowed, 0);
return 0;
}
static int
nvkm_uevent_mthd_allow(struct nvkm_uevent *uevent, union nvif_event_allow_args *args, u32 argc)
{
if (argc != sizeof(args->vn))
return -ENOSYS;
nvkm_event_ntfy_allow(&uevent->ntfy);
atomic_set(&uevent->allowed, 1);
return 0;
}
static int
nvkm_uevent_mthd(struct nvkm_object *object, u32 mthd, void *argv, u32 argc)
{
struct nvkm_uevent *uevent = nvkm_uevent(object);
switch (mthd) {
case NVIF_EVENT_V0_ALLOW: return nvkm_uevent_mthd_allow(uevent, argv, argc);
case NVIF_EVENT_V0_BLOCK: return nvkm_uevent_mthd_block(uevent, argv, argc);
default:
break;
}
return -EINVAL;
}
static int
nvkm_uevent_fini(struct nvkm_object *object, enum nvkm_suspend_state suspend)
{
struct nvkm_uevent *uevent = nvkm_uevent(object);
nvkm_event_ntfy_block(&uevent->ntfy);
return 0;
}
static int
nvkm_uevent_init(struct nvkm_object *object)
{
struct nvkm_uevent *uevent = nvkm_uevent(object);
if (atomic_read(&uevent->allowed))
nvkm_event_ntfy_allow(&uevent->ntfy);
return 0;
}
static void *
nvkm_uevent_dtor(struct nvkm_object *object)
{
struct nvkm_uevent *uevent = nvkm_uevent(object);
nvkm_event_ntfy_del(&uevent->ntfy);
return uevent;
}
static const struct nvkm_object_func
nvkm_uevent = {
.dtor = nvkm_uevent_dtor,
.init = nvkm_uevent_init,
.fini = nvkm_uevent_fini,
.mthd = nvkm_uevent_mthd,
};
static int
nvkm_uevent_ntfy(struct nvkm_event_ntfy *ntfy, u32 bits)
{
struct nvkm_uevent *uevent = container_of(ntfy, typeof(*uevent), ntfy);
struct nvkm_client *client = uevent->object.client;
Annotation
- Immediate include surface: `core/event.h`, `core/client.h`, `nvif/if000e.h`.
- Detected declarations: `struct nvkm_uevent`, `function nvkm_uevent_mthd_block`, `function nvkm_uevent_mthd_allow`, `function nvkm_uevent_mthd`, `function nvkm_uevent_fini`, `function nvkm_uevent_init`, `function nvkm_uevent_dtor`, `function nvkm_uevent_ntfy`, `function nvkm_uevent_add`, `function nvkm_uevent_new`.
- 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.