drm_send_event_locked(9)
π drm_send_event_locked(9) β the "you already got the lock, bestie" edition
okay so this is a page from the Kernel API Manual, and the star of the show is literally drm_send_event_locked(9). yes bestie, the one with _locked in the name β that suffix is the whole vibe check here, iykyk π«Ά
β¨ NAME β¨
drm_send_event_locked β send a DRM event to a file descriptor. that's it, that's the job, and it does it beautifully π
π¦ SYNOPSIS π¦
void drm_send_event_locked (struct drm_device *dev , struct
drm_pending_event *e );
like, look at her. two args, no return value, complete main character energy β¨
π ARGUMENTS π
devβ the DRM device. your actual graphics thing, the whole reason we're here πeβ the DRM event to deliver. this is the lil message you're yeeting out to userspace π§
πΈ DESCRIPTION πΈ
so what this function does is it takes the event e β which you already initialized with drm_event_reserve_init, no cap β and it sends it to its associated userspace DRM file. slay π
β οΈ but here's the one thing you CANNOT skip: callers must already holddrm_device.event_lockbefore calling this. like, already. in advance. this function will not do it for you. if you want the unlocked version, go seedrm_send_eventinstead β that's literally its whole thing.
and the good news? the core will take care of unlinking and disarming events when the corresponding DRM file gets closed. so drivers 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 checks, no anxious little if (file) glances, none of that. the core handles it, periodt π₯π
π§ SEE ALSO π§
the whole friend group, all together, all iconic:
- 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(9)drm_print_memory_stats(9)drm_show_memory_stats(9)drm_show_fdinfo(9)drm_file_err(9)mock_drm_getfile(9)
okay that's the page!! live laugh love, hold your locks, and go read the unlocked version if you're not already holding event_lock ππΈ
this lil gem lives in ./drivers/gpu/drm, dated October 2026, and it goes by drm_send_event_locked(9). mwah, bye bestie πππ¦
π¦ 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