for_each_old...mgr_in_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_old...mgr_in_state(9) πŸ’…

okay bestie, so this is a page from the Kernel API Manual, section 9 β€” yes, the big serious kernel one β€” and today's main character is for_each_oldnew_mst_mgr_in_state. it's a macro. it's a whole vibe. let's get into it πŸŽ€


✨ NAME ✨

for_each_oldnew_mst_mgr_in_state β€” literally just loops over every DP MST topology manager in an atomic update. that's it. that's the whole job. iconic behaviour honestly πŸ¦‹


🌸 SYNOPSIS 🌸

for_each_oldnew_mst_mgr_in_state (__state , mgr , old_state , new_state
, __i );

she takes five things, no more no less. count 'em:


🫢 ARGUMENTS 🫢

  • __state β€” a struct drm_atomic_commit pointer. the big one. the moment. the atomic commit itself πŸ’«
  • mgr β€” a struct drm_dp_mst_topology_mgr iteration cursor. this is the thing you're actually walking through, one manager at a time.
  • old_state β€” a struct drm_dp_mst_topology_state iteration cursor, but for the old state. the before pic πŸ™ˆ
  • new_state β€” a struct drm_dp_mst_topology_state iteration cursor, but for the new state. the glow-up pic ✨
  • __i β€” an int iteration cursor, for macro-internal use only. don't touch her, she's busy, she's bookkeeping πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

so what does she actually do? she iterates over all DRM DP MST topology managers in an atomic update β€” and the way she does it is the whole point: she tracks both old and new state at the same time. two states, one loop. main character energy fr fr πŸ‘‘

and why do you care? because this is genuinely useful in places where the state delta needs to be considered β€” for example in atomic check functions. if you need to know what changed, not just what is, this macro is your girl. no cap πŸ’…


🌈 SEE ALSO 🌈

like, go read these too, they're all connected, iykyk:


aaaand that's the page! πŸ“ this little beauty lives over in ./include/drm/display, and the version notes say October 2026 β€” so she's from the future, basically, and she ate. periodt πŸ’€βœ¨ πŸ’–

πŸ“¦ where this page comes from