v4l2_m2m_try_schedule(9)
β¨ v4l2_m2m_try_schedule β the Kernel API Manual files β¨
okay bestie, so we're in the Kernel API Manual today and the page we're looking at is v4l2_m2m_try_schedule(9) β yes the whole title, we're doing this properly π
πΈ NAME πΈ
v4l2_m2m_try_schedule β literally just checks whether an instance is ready to be added to the pending job queue, and likeβ¦ adds it if it is. no cap. that's the whole vibe check π
π¦ SYNOPSIS π¦
void v4l2_m2m_try_schedule (struct v4l2_m2m_ctx *m2m_ctx );
it returns void btw, so don't go looking for a return value, it's giving "I do the thing and I leave" π
π ARGUMENTS π
m2m_ctxβ the m2m context assigned to the instance, handed to you as astruct v4l2_m2m_ctx. that's it, that's the one thing you pass in π«Ά
β DESCRIPTION β
so there are like three basic requirements an instance has to meet before it's allowed to run, and honestly they're not asking for much:
- at least one source buffer has to be queued,
- at least one destination buffer has to be queued,
- streaming has to be on.
that's the bare minimum. the entry-level requirements. the "will you please just work" checklist β¨
but here's the twist β if a queue is buffered (think: a decoder hardware ringbuffer that has to be drained before doing streamoff), then it's totally fine to allow scheduling without v4l2 buffers on that queue. special little exception, we love to see it π
and there might be even more requirements, like custom ones, because of course there might be π in that case the driver should supply a custom callback β that's job_ready in v4l2_m2m_ops β and it should return 1 if the instance is ready. and if you're wondering what kind of custom requirement we're talking about, an example would be an instance that needs more than one src/dst buffer per transaction. yeah. greedy little instance. but valid π₯
π SEE ALSO π
the whole friend group, in order, and yes you have to meet all of them:
- Kernel file
./include/media/v4l2-mem2mem.h struct v4l2_m2m_ops(9)struct v4l2_m2m_queue_ctx(9)struct v4l2_m2m_ctx(9)struct v4l2_m2m_buffer(9)v4l2_m2m_get_curr_priv(9)v4l2_m2m_get_vq(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_init(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)
like I said. the whole friend group. iykyk π§
ok that's the page!! go schedule something, you've got this πͺ
and finally, the cute little sign-off at the bottom: this one lives in ./include/media, it's dated October 2026, and the page is v4l2_m2m_try_schedule(9) β mwah, iconic, 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