STRUCT VB2_PLANE(9)
π struct vb2_plane(9) β plane information β¨
okay bestie, so this is a page from the Kernel API Manual, section 9, and it's all about struct vb2_plane β literally just plane information. that's the whole NAME. short king behavior but make it kernel. π
πΈ NAME πΈ
struct vb2_plane β plane information. periodt.
β¨ SYNOPSIS β¨
the whole struct, character for character, no notes:
struct vb2_plane {
void *mem_priv;
struct dma_buf *dbuf;
unsigned int dbuf_mapped;
bool dbuf_duplicated;
unsigned int bytesused;
unsigned int length;
unsigned int min_length;
union {
unsigned int offset;
unsigned long userptr;
int fd;
} m;
unsigned int data_offset;
};
π«Ά Members π«Ά
mem_privβ the private data that belongs to this plane. just vibes and secrets, kept private. πdbufβ adma_buf, aka the shared buffer object.dbuf_mappedβ a flag that shows whetherdbufis mapped or not. yes/no energy. πdbuf_duplicatedβ a boolean showing whetherdbufis duplicated with a previous plane of the buffer. like, is this the same fit as before? πbytesusedβ the number of bytes occupied by data in the plane. that's the payload, bestie. π₯lengthβ the size of this plane in bytes β and NOT the payload, okay, don't get it twisted. the maximum valid size isMAX_UINT - PAGE_SIZE.min_lengthβ the minimum required size of this plane in bytes (also NOT the payload).lengthis always greater than or equal tomin_length, and likelength, it is limited toMAX_UINT - PAGE_SIZE. the floor, if you will. βmβ the union holding memtype-specific data. choose your fighter. πm.offsetβ when the memory in the associatedstruct vb2_bufferisVB2_MEMORY_MMAP, this equals the offset from the start of the device memory for this plane. (or it's a "cookie" that should be passed tommapcalled on the video node. a lil cookie. π)m.userptrβ when the memory isVB2_MEMORY_USERPTR, this is a userspace pointer pointing to this plane.m.fdβ when the memory isVB2_MEMORY_DMABUF, this is a userspace file descriptor associated with this plane.
data_offsetβ the offset in the plane to the start of data; usually0, unless there's a header in front of the data. highkey the header is gatekeeping the data. π
π¦ Description π¦
this struct should contain enough information to be able to cover all the fields of struct v4l2_plane at videodev2.h. like, all of them. no field left behind. π
π SEE ALSO π
start with the kernel file ./include/media/videobuf2-core.h, then the whole friend group: enum vb2_memory(9), struct vb2_mem_ops(9), enum vb2_io_modes(9), enum vb2_buffer_state(9), struct vb2_buffer(9), struct vb2_ops(9), struct vb2_buf_ops(9), struct vb2_queue(9), vb2_queue_allows_cache_hints(9), vb2_plane_vaddr(9), vb2_plane_cookie(9), vb2_buffer_done(9), vb2_discard_done(9), vb2_wait_for_all_buffers(9), vb2_core_querybuf(9), vb2_core_reqbufs(9), vb2_core_create_bufs(9), vb2_core_prepare_buf(9), vb2_core_remove_bufs(9), vb2_core_qbuf(9), vb2_core_dqbuf(9), vb2_core_streamon(9), vb2_core_streamoff(9), vb2_core_expbuf(9), vb2_core_queue_init(9), vb2_core_queue_release(9), vb2_queue_error(9), vb2_mmap(9), vb2_get_unmapped_area(9), vb2_core_poll(9), vb2_read(9), vb2_write(9), vb2_thread_fnc(9), vb2_thread_start(9), vb2_thread_stop(9), vb2_is_streaming(9), vb2_fileio_is_active(9), vb2_get_num_buffers(9), vb2_is_busy(9), vb2_get_drv_priv(9), vb2_set_plane_payload(9), vb2_get_plane_payload(9), vb2_plane_size(9), vb2_start_streaming_called(9), vb2_clear_last_buffer_dequeued(9), vb2_get_buffer(9), vb2_buffer_in_use(9), vb2_verify_memory_type(9), vb2_request_object_is_buffer(9), vb2_request_buffer_cnt(9).
that's the whole group chat, bestie. iykyk. π§
ngl this page lives in./include/mediaand it's dated October 2026 β so yeah, it's giving from the future, and the whole thing is literally titledstruct vb2_plane(9). slay. π
π¦ 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