__v4l2_ctrl_modify_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __v4l2_ctrl_modify_range(9) β€” the unlocked glow-up for your control ranges πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ this one's a little kernel-side function that tweaks a control's range while everything is already running, and yes it's the ✨ unlocked ✨ sibling of v4l2_ctrl_modify_range() β€” meaning the locking is your job, not hers. main character energy: she trusts you 🫢


🌸 NAME 🌸

__v4l2_ctrl_modify_range β€” lowkey the unlocked variant of v4l2_ctrl_modify_range(), no cap πŸ’…


✨ SYNOPSIS ✨

int __v4l2_ctrl_modify_range (struct v4l2_ctrl *ctrl , s64 min , s64 max , u64 step , s64 def );

πŸŽ€ ARGUMENTS πŸŽ€

  • ctrl β€” the control you're updating, bestie. the one getting the glow-up πŸ’–
  • min β€” the control's minimum value. the floor, literally.
  • max β€” the control's maximum value. the ceiling, fr.
  • step β€” the control's step value ⭐
  • def β€” the control's default value. the fallback fit πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does she do? She updates the range of a control on the fly β€” like, mid-run, no restart, iconic behavior honestly ✨

This works for these control types, and only these, periodt:

  • INTEGER
  • BOOLEAN
  • MENU
  • INTEGER MENU
  • BITMASK

For menu controls specifically, the step value gets interpreted as a menu_skip_mask πŸ‘€ iykyk.

⚠️ If one of the range arguments is invalid for this control type, an error is returned. no vibes-based ranges allowed, sorry 😭

And the big one, the thing you cannot skip:

πŸ”₯ The caller is responsible for acquiring the control handler mutex on behalf of __v4l2_ctrl_modify_range.

Like, she's the unlocked version β€” she is NOT grabbing that mutex for you. that's your job, bestie. do not forget it πŸ’€


🌈 SEE ALSO 🌈

the whole friend group, and yes we're naming every single one 🫢

Kernel file ./include/media/v4l2-ctrls.h plus:


okay that's the whole page, bestie, you ate that πŸ’…βœ¨ this little beauty lives in ./include/media and the version vibes are dated October 2026 β€” go forth and lock that mutex fr fr πŸ¦‹πŸ’–

πŸ“¦ where this page comes from