v4l2_m2m_init(9)
π v4l2_m2m_init(9) β the Kernel API Manual, but make it cute π
okay so bestie, you found it: v4l2_m2m_init from the Kernel API Manual. this is the one that gets your mem-to-mem driver's whole vibe started. buckle up π
β¨ NAME β¨
v4l2_m2m_init β initialize per-driver m2m data
like, per-driver. not per-context, not per-whatever-else. per driver. noted. π
πΈ SYNOPSIS πΈ
struct v4l2_m2m_dev * v4l2_m2m_init (const struct v4l2_m2m_ops *m2m_ops
);
yes the line break is real, that's just how the page wraps it, we don't judge π«Ά
π¦ ARGUMENTS π¦
m2m_opsβ pointer tostruct v4l2_m2m_ops. that's it. that's the whole argument list. one (1) pointer, and it's to your ops struct π
π₯ DESCRIPTION π₯
so likeβ¦ usually you call this from your driver's probe function. that's the vibe. that's the whole description. it's giving "short and iconic" π
if you're sitting there like "wait, when do i call it then??" β usually probe. the manpage said usually. we're respecting the usually. β¨
β RETURN β
it returns an opaque pointer to the internal data you need to handle an M2M context π
opaque means don't peek inside, bestie. it's not for you. it's for the framework. hands off π
π SEE ALSO π
this section is lowkey a whole group chat, so let's break it down π¬ first up, the header file itself:
- Kernel file
./include/media/v4l2-mem2mem.h
then the structs (the main characters π):
struct v4l2_m2m_ops(9)struct v4l2_m2m_queue_ctx(9)struct v4l2_m2m_ctx(9)struct v4l2_m2m_buffer(9)
then the function fam, and there are so many of them, we love a big family π«Ά:
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)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)v4l2_m2m_reqbufs(9)v4l2_m2m_querybuf(9)v4l2_m2m_qbuf(9)v4l2_m2m_dqbuf(9)v4l2_m2m_prepare_buf(9)v4l2_m2m_create_bufs(9)v4l2_m2m_expbuf(9)v4l2_m2m_streamon(9)v4l2_m2m_streamoff(9)v4l2_m2m_update_start_streaming_state(9)v4l2_m2m_update_stop_streaming_state(9)v4l2_m2m_encoder_cmd(9)v4l2_m2m_decoder_cmd(9)v4l2_m2m_poll(9)v4l2_m2m_mmap(9)v4l2_m2m_release(9)v4l2_m2m_get(9)v4l2_m2m_put(9)v4l2_m2m_ctx_init(9)v4l2_m2m_ctx_release(9)v4l2_m2m_buf_queue(9)v4l2_m2m_num_src_bufs_ready(9)v4l2_m2m_num_dst_bufs_ready(9)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)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)v4l2_m2m_get_src_vq(9)v4l2_m2m_get_dst_vq(9)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)v4l2_m2m_buf_copy_metadata(9)
that's the whole roster, no cuts, no skips, we ate and left no crumbs π
mwah that's the page. it lives in ./include/media and it's dated October 2026 β so yeah, it's giving future icon, we stan πβ¨π
π¦ 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