drm_send_event(9)
β¨ drm_send_event(9) β¨
okay so real talk, this is a page from the Kernel API Manual, and it's about drm_send_event β the little function that literally just delivers a DRM event straight to a file descriptor. it's giving messenger girl π bestie, let's get into it.
πΈ NAME πΈ
drm_send_event β send DRM event to file descriptor π
π SYNOPSIS π
void drm_send_event (struct drm_device *dev , struct drm_pending_event
*e );
π¦ ARGUMENTS π¦
devβ the DRM device. the main character, the one everything hangs off of πeβ the DRM event you're delivering. this is the actual package, the little gift you're handing over π
π DESCRIPTION π
so here's the vibe: this function sends the event e β which you already initialized with drm_event_reserve_init β over to its associated userspace DRM file. it's the handoff, the "here u go bestie" moment β¨
and the way it does that? it acquires drm_device.event_lock. yup, the lock. so if you're out here already holding that lock, do not call this one β check out drm_send_event_locked instead, because it's literally made for callers who already hold this lock. no double-locking, no chaos, iykyk π
okay but here's the genuinely iconic part: the core takes care of unlinking and disarming events when the corresponding DRM file gets closed. so drivers literally do not need to worry about whether the DRM file for this event still exists ππ«Ά you can just call this function upon completion of the asynchronous work unconditionally. no vibe check needed, no "hmm is it still there", just call it. periodt. π
π₯ 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_locked(9)drm_event_reserve_init(9)drm_event_cancel_free(9)drm_send_event_timestamp_locked(9)drm_send_event_locked(9)drm_print_memory_stats(9)drm_show_memory_stats(9)drm_show_fdinfo(9)drm_file_err(9)mock_drm_getfile(9)
that's the whole page bestie, go forth and send those events π
source: ./drivers/gpu/drm Β· dated October 2026 β mwah, love u, stan the kernel ππ
π¦ 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