drm_read(9)
π NAME
drm_read β read method for DRM file. This is drm_read(9) from the Kernel API Manual, bestie β¨
πΈ SYNOPSIS
ssize_t drm_read (struct file *filp , char __user *buffer , size_t count
, loff_t *offset );
π«Ά ARGUMENTS
filpβ file pointerbufferβ userspace destination pointer for the readcountβ count in bytes to readoffsetβ offset to read
β¨ DESCRIPTION
okay so real talk: this function must be used by drivers as their file_operations.read method if they use DRM events for asynchronous signalling to userspace. No cap. And since events are used by the KMS API for vblank and page flip completion, that means all modern display drivers must use it. π
offset is ignored β DRM events are read like a pipe. 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. π₯
π RETURN
Number of bytes read (always aligned to full events, and can be 0) or a negative error code on failure. Thatβs the whole vibe. β
π SEE ALSO
Kernel file ./drivers/gpu/drm/drm_file.c file operations(9)drm_file_alloc(9)drm_file_free(9)drm_open(9)drm_release(9)drm_release_noglobal(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_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)
xoxo, your Unix bestie π
β source/version: ./drivers/gpu/drm; date: October 2026.
π¦ 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