drm_event_r..._init_locked(9)
β¨ drm_event_reserve_init_locked π
okay bestie, welcome to the Kernel API Manual, this is the page for drm_event_reserve_init_locked and it's lowkey the moment you've been waiting for π
πΈ NAME πΈ
drm_event_reserve_init_locked β init a DRM event and reserve space for it, no cap β¨
π¦ SYNOPSIS π¦
int drm_event_reserve_init_locked (struct drm_device *dev , struct
drm_file *file_priv , struct drm_pending_event *p , struct drm_event *e
);
like... that's the whole vibe right there, four args, one int coming back, periodt π
π ARGUMENTS π
devβ the DRM device, your main character π«Άfile_privβ the DRM file private data, the backstage pass bestie ποΈpβ tracking structure for the pending event, it's literally keeping tabs πeβ actual event data to deliver to userspace, the payload, the moment π
π₯ DESCRIPTION π₯
okay so here's the tea π΅ β this function prepares the event you passed in for eventual delivery. It's giving "get ready, you're about to be sent" energy β¨
but listen π β if the event doesn't get delivered (because the IOCTL fails later on, before anything gets queued up), then the event must be cancelled and freed using drm_event_cancel_free. no exceptions, bestie, that's not me being dramatic, that's just the rules π
and the successfully initialized ones? those should be sent out using drm_send_event or drm_send_event_locked to signal completion of the asynchronous event to userspace. slay, that's the whole point π
ngl there's one very important detail: if callers embeddedpinto a larger structure, it must be allocated withkmallocandpmust be the first member element. not optional, not a suggestion, it's fr fr mandatory π
and lastly β this is the locked version of drm_event_reserve_init for callers which already hold drm_device.event_lock. so if you've already got the lock, this is your girl π¦
β RETURN β
0 on success, or a negative error code on failure. that's it, that's the answer πβ¨
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_file.cfile operations(9) drm_file_alloc(9)drm_file_free(9)drm_open(9)drm_release(9)drm_release_noglobal(9)drm_read(9)drm_poll(9)drm_event_reserve_init(9)drm_event_cancel_free(9)drm_send_event_timestamp_locked(9)drm_send_event_locked(9)drm_send_event(9)drm_print_memory_stats(9)drm_show_memory_stats(9)drm_show_fdinfo(9)drm_file_err(9)mock_drm_getfile(9)
like go read them all, iykyk ππ
and that's the whole page bestie π§ source lives at ./drivers/gpu/drm, dated October 2026, and yes we're still out here reading kernel docs in the year 2026 β iconic behavior honestly ππ see you in the next manpage!! πΈπ«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms