vb2_buffer_done(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vb2_buffer_done(9) β€” the Kernel API Manual said bestie, let’s return this buffer 🫢

✨ NAME ✨

vb2_buffer_done β€” inform videobuf2 that an operation on a buffer is finished, and do it with main character energy πŸ‘‘

🌸 SYNOPSIS 🌸

void vb2_buffer_done (struct vb2_buffer *vb , enum vb2_buffer_state
       state );

πŸŽ€ ARGUMENTS πŸŽ€

  • vb β€” pointer to struct vb2_buffer to be used. literally the buffer in question, no cap πŸ’…
  • state β€” state of the buffer, as defined by enum vb2_buffer_state. Either VB2_BUF_STATE_DONE if the operation finished successfully, VB2_BUF_STATE_ERROR if the operation finished with an error, or VB2_BUF_STATE_QUEUED. vibe check for your buffer, basically ✨

πŸ’– DESCRIPTION πŸ’–

okay so this function should be called by the driver after a hardware operation on a buffer is finished and the buffer may be returned to userspace. That’s the moment. 🫢

After that, the driver cannot use this buffer anymore until it is queued back to it by videobuf by the means of the vb2_ops->buf_queue callback. Only buffers previously queued to the driver by vb2_ops->buf_queue can be passed to this function. No random buffers, bestie β€” security guard energy πŸ’…

While streaming, a buffer can only be returned in state DONE or ERROR. The vb2_ops->start_streaming op can also return them in case the DMA engine cannot be started for some reason. In that case, the buffers should be returned with state QUEUED to put them back into the queue. put them back in the group chat, basically 😭

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group is here, no one left behind, periodt πŸ’œ


made with πŸ’– from the ./include/media source/version corner, October 2026 edition β€” mwah πŸ’‹

πŸ“¦ where this page comes from