STRUCT V4L2_SUBDEV_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct v4l2_subdev_state(9) β€” the Kernel API Manual, bestie edition ✨

okay so this is a page from the Kernel API Manual, and it's all about struct v4l2_subdev_state πŸŽ€

✨ NAME ✨

struct v4l2_subdev_state β€” literally the place where subdev state info lives, no cap πŸ’Ύβœ¨

🌸 SYNOPSIS 🌸

struct v4l2_subdev_state {
    struct mutex _lock;
    struct mutex *lock;
    struct v4l2_subdev *sd;
    struct v4l2_subdev_pad_config *pads;
    struct v4l2_subdev_krouting routing;
    struct v4l2_subdev_stream_configs stream_configs;
 };

πŸ¦‹ Members πŸ¦‹

the cast of the struct, one by one πŸ‘‘

  • _lock β€” the default for lock. she's the built-in backup plan, the understudy, the reserve πŸ’…
  • lock β€” the mutex for the state. the user is allowed to replace this one, so it's giving "customizable but make it thread-safe" 🫢
  • sd β€” the sub-device that this state is related to. every state has a subdev, that's the whole point πŸ’–
  • pads β€” a struct v4l2_subdev_pad_config array. yes, an array, not one lil thing 🌈
  • routing β€” the routing table for the subdev. routes as far as the eye can see πŸ›£οΈ
  • stream_configs β€” stream configurations, and super important: only for V4L2_SUBDEV_FL_STREAMS. if you're not flagged, this one's not for you πŸ™ˆ

🌟 Description 🌟

bestie listen, here's the vibe check on when you actually hand this thing over πŸ‘‡

This structure only needs to be passed to the pad op if the 'which' field of the main argument is set to V4L2_SUBDEV_FORMAT_TRY. For V4L2_SUBDEV_FORMAT_ACTIVE it is safe to pass NULL.

that's it, that's the rule β€” TRY mode? you need her. ACTIVE mode? NULL is literally fine, she's off duty πŸ’€βœ¨


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/media/v4l2-subdev.h

and now, the guest list β€” everyone's invited, it's a whole party fr fr πŸŽ‰πŸ‘‘


and that's the whole page, bestie 🫢 this one came out of ./include/media, dated October 2026 β€” a lil vintage moment, iconic honestly πŸ’œβœ¨πŸ‘‘

πŸ“¦ where this page comes from