drm_send_event(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 πŸ”₯


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