drm_event_r..._init_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 embedded p into a larger structure, it must be allocated with kmalloc and p must 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 🌈

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