- ssize_t drm_read(struct file * filp, char __user * buffer, size_t count, loff_t * offset);
- file pointer
- userspace destination pointer for the read
- count in bytes to read
- offset to read
This function must be used by drivers as their .read #file_operations method iff they use DRM events for asynchronous signalling to userspace. Since events are used by the KMS API for vblank and page flip completion this means all modern display drivers must use it.
offset is ignore, DRM events are read like a pipe. Therefore drivers also must set the .llseek #file_operation to no_llseek. Polling support is provided by drm_poll.
This function will only ever read a full event. Therefore userspace must supply a big enough buffer to fit any event to ensure forward progress. Since the maximum event space is currently 4K it's recommended to just use that for safety.
Number of bytes read (always aligned to full events, and can be 0) 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