vb2_poll(9)
π vb2_poll(9) β like, the poll operation but make it kernel
okay so bestie, welcome to the vb2_poll(9) page from the Kernel API Manual β¨ this is the videobuf2 girly who handles the poll userspace operation, and she is lowkey carrying the whole file-descriptor-readiness moment. let's get into it π
β¨ NAME β¨
vb2_poll β implements poll userspace operation π¦
πΈ SYNOPSIS πΈ
__poll_t vb2_poll (struct vb2_queue *q , struct file *file , poll_table
*wait );
π ARGUMENTS π
qβ pointer tostruct vb2_queuewith the videobuf2 queue. that's your queue bestie π«Άfileβ thefileargument that got passed to thepollfile operation handlerwaitβ thewaitargument that got passed to thepollfile operation handler
π DESCRIPTION π
so this function implements the poll file operation handler for a driver. iconic behaviour, no cap π
For CAPTURE queues: if a buffer is ready to be dequeued, the userspace gets informed that the file descriptor of a video device is available for reading. periodt.
For OUTPUT queues: if a buffer is ready to be dequeued, that file descriptor gets reported as available for writing. slay.
If the driver uses struct v4l2_fh, then vb2_poll will also check for any pending events β not me forgetting to mention that, i would never π
the return values from this function are intended to be directly returned from the poll handler in the driver. like, don't remix them, just hand them straight back fr fr π₯
π SEE ALSO π
Kernel file ./include/media/videobuf2-v4l2.h β go read it, iykyk β
struct vb2_v4l2_buffer(9)vb2_find_buffer(9)vb2_querybuf(9)vb2_reqbufs(9)vb2_create_bufs(9)vb2_prepare_buf(9)vb2_qbuf(9)vb2_expbuf(9)vb2_dqbuf(9)vb2_streamon(9)vb2_streamoff(9)vb2_queue_init(9)vb2_queue_init_name(9)vb2_queue_release(9)vb2_queue_change_type(9)vb2_queue_is_busy(9)vb2_video_unregister_device(9)
and that's the whole vibe check π this page lives at ./include/media, dated October 2026 β mwah, go poll something iconic 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