v4l2_m2m_querybuf(9)
π v4l2_m2m_querybuf β the Kernel API Manual, bestie edition π
okay so you're looking at v4l2_m2m_querybuf(9), and honestly? she's a whole multiplexer. the multi-queue-aware QUERYBUF one. that's the whole vibe. β¨
π NAME π
v4l2_m2m_querybuf β the multi-queue-aware QUERYBUF multiplexer. that's her. that's the whole job. π
πΈ SYNOPSIS πΈ
int v4l2_m2m_querybuf (struct file *file , struct v4l2_m2m_ctx *m2m_ctx
, struct v4l2_buffer *buf );
literally the whole signature, no notes. copy it exactly, bestie. π«Ά
π¦ ARGUMENTS π¦
fileβ pointer tostruct file. yes girl, the regular file pointer, slaying as always. πm2m_ctxβ the m2m context assigned to the instance, given to you bystruct v4l2_m2m_ctx. she's the main character of this whole operation. πbufβ pointer tostruct v4l2_buffer. the buffer in question. iconic. β
β¨ DESCRIPTION β¨
so here's the thing β the manpage is not gonna spell it out for you here. it says: see the v4l2_m2m_mmap documentation for details.
that's it. that's the description. go read the v4l2_m2m_mmap docs, bestie, that's where the lore lives. no cap. π
lowkey a flex that this section is one sentence long. she said "iykyk" and dipped. π
π SEE ALSO π
okay these are all the related things, and I mean all of them β not skipping a single one because that's not the energy we bring:
- kernel file
./include/media/v4l2-mem2mem.hπ
then the structs:
struct v4l2_m2m_ops(9)struct v4l2_m2m_queue_ctx(9)struct v4l2_m2m_ctx(9)struct v4l2_m2m_buffer(9)
then the getters and schedulers:
v4l2_m2m_get_curr_priv(9)v4l2_m2m_get_vq(9)v4l2_m2m_try_schedule(9)v4l2_m2m_job_finish(9)v4l2_m2m_buf_done_and_job_finish(9)
then the state girlies:
v4l2_m2m_clear_state(9)v4l2_m2m_mark_stopped(9)v4l2_m2m_dst_buf_is_last(9)v4l2_m2m_has_stopped(9)v4l2_m2m_is_last_draining_src_buf(9)v4l2_m2m_last_buffer_done(9)v4l2_m2m_suspend(9)v4l2_m2m_resume(9)
then the buffer lifecycle crew:
v4l2_m2m_reqbufs(9)v4l2_m2m_qbuf(9)v4l2_m2m_dqbuf(9)v4l2_m2m_prepare_buf(9)v4l2_m2m_create_bufs(9)v4l2_m2m_expbuf(9)
then streaming:
v4l2_m2m_streamon(9)v4l2_m2m_streamoff(9)v4l2_m2m_update_start_streaming_state(9)v4l2_m2m_update_stop_streaming_state(9)
then the commands:
then the classic file ops:
then setup and teardown:
v4l2_m2m_init(9)v4l2_m2m_release(9)v4l2_m2m_get(9)v4l2_m2m_put(9)v4l2_m2m_ctx_init(9)v4l2_m2m_ctx_release(9)
then the queue keepers:
then the "which buffer is it" squad:
v4l2_m2m_next_buf(9)v4l2_m2m_next_src_buf(9)v4l2_m2m_next_dst_buf(9)v4l2_m2m_last_buf(9)v4l2_m2m_last_src_buf(9)v4l2_m2m_last_dst_buf(9)
then the loopers:
v4l2_m2m_for_each_dst_buf(9)v4l2_m2m_for_each_src_buf(9)v4l2_m2m_for_each_dst_buf_safe(9)v4l2_m2m_for_each_src_buf_safe(9)
then the vq accessors:
and finally, the removers (aka the cleanup girlies):
v4l2_m2m_buf_remove(9)v4l2_m2m_src_buf_remove(9)v4l2_m2m_dst_buf_remove(9)v4l2_m2m_buf_remove_by_buf(9)v4l2_m2m_src_buf_remove_by_buf(9)v4l2_m2m_dst_buf_remove_by_buf(9)
and last but never least:
π reminder bestie: this page is short, but the reference list is not. it's giving "she brought her whole friend group."
okay and finally, the little sign-off era: this page lives under ./include/media, and it's dated October 2026 π§ β so yeah, mark your calendar, this is the v4l2_m2m_querybuf(9) era and we're all just living in it. periodt. πβ¨π
π¦ 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