for_each_old...mgr_in_state(9)
π 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β astruct drm_atomic_commitpointer. the big one. the moment. the atomic commit itself π«mgrβ astruct drm_dp_mst_topology_mgriteration cursor. this is the thing you're actually walking through, one manager at a time.old_stateβ astruct drm_dp_mst_topology_stateiteration cursor, but for the old state. the before pic πnew_stateβ astruct drm_dp_mst_topology_stateiteration cursor, but for the new state. the glow-up pic β¨__iβ anintiteration 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:
- Kernel file
./include/drm/display/drm_dp_mst_helper.h struct drm_dp_mst_port(9)struct drm_dp_mst_branch(9)struct drm_dp_mst_atomic_payload(9)struct drm_dp_mst_topology_state(9)struct drm_dp_mst_topology_mgr(9)enum drm_dp_mst_mode(9)__drm_dp_mst_state_iter_get(9)for_each_old_mst_mgr_in_state(9)for_each_new_mst_mgr_in_state(9)
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
- 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