vb2_poll(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to struct vb2_queue with the videobuf2 queue. that's your queue bestie 🫢
  • file β€” the file argument that got passed to the poll file operation handler
  • wait β€” the wait argument that got passed to the poll file 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 ⭐


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