- int drm_event_reserve_init(struct drm_device * dev, struct drm_file * file_priv, struct drm_pending_event * p, struct drm_event * e);
- DRM device
- DRM file private data
- tracking structure for the pending event
- actual event data to deliver to userspace
This function prepares the passed in event for eventual delivery. If the event doesn't get delivered (because the IOCTL fails later on, before queuing up anything) then the even must be cancelled and freed using drm_event_cancel_free. Successfully initialized events should be sent out using drm_send_event or drm_send_event_locked to signal completion of the asynchronous event to userspace.
If callers embedded p into a larger structure it must be allocated with kmalloc and p must be the first member element.
Callers which already hold dev->event_lock should use drm_event_reserve_init instead.
0 on success or a negative error code on failure.
Jesse Barnes <[email protected]>
- Initial version
Laurent Pinchart <[email protected]>
Ideas on board SPRL,
- Driver internals
Daniel Vetter <[email protected]>
- Contributions all over the place
Lukas Wunner <[email protected]>
- vga_switcheroo documentation