for_each_old...tate_reverse(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_oldnew_plane_in_state_reverse β€” the manual, but make it make sense

okay bestie so you found for_each_oldnew_plane_in_state_reverse(9) in the Kernel API Manual and you're like "girl what is this whole entire name" β€” don't worry, i got you. this is a macro. it loops. it goes backwards. and it keeps receipts on both the old state AND the new state. let's get into it πŸŽ€


✨ NAME ✨

for_each_oldnew_plane_in_state_reverse β€” literally just iterate over all planes in an atomic update, but in reverse order. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

for_each_oldnew_plane_in_state_reverse (__state , plane ,
       old_plane_state , new_plane_state , __i );

🫢 ARGUMENTS 🫢

she takes five (5) arguments, each one more of a mouthful than the last:

  • __state β€” a struct drm_atomic_commit pointer. the main character of this whole operation tbh πŸ‘‘
  • plane β€” a struct drm_plane iteration cursor. this is the one that actually walks the loop πŸ’…
  • old_plane_state β€” a struct drm_plane_state iteration cursor, but for the old state. it's giving nostalgia πŸ’€
  • new_plane_state β€” a struct drm_plane_state iteration cursor, but for the new state. glow-up arc ✨
  • __i β€” an int iteration cursor, and it's for macro-internal use only. do NOT touch. pretend you didn't even see it πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜• β€” this macro iterates over all planes in an atomic update, and it does it in reverse order. but the slay part? it tracks both the old state and the new state the entire time. both. at once. multitasking queen 🧚

and like, why do you care? because it's 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 between before and after, this loop is literally your bestie. periodt. πŸ”₯


🌈 SEE ALSO 🌈

a whole friend group, honestly. the kernel file lives at ./include/drm/drm_atomic.h, and here's everybody it hangs out with:

struct drm_crtc_commit(9), struct drm_private_state_funcs(9), struct drm_private_obj(9), drm_for_each_privobj(9), struct drm_private_state(9), struct drm_atomic_commit(9), drm_crtc_commit_get(9), drm_crtc_commit_put(9), drm_atomic_commit_get(9), drm_atomic_commit_put(9), drm_atomic_get_old_crtc_state(9), drm_atomic_get_new_crtc_state(9), drm_atomic_get_old_plane_state(9), drm_atomic_get_new_plane_state(9), drm_atomic_get_old_connector_state(9), drm_atomic_get_new_connector_state(9), __drm_atomic_get_current_plane_state(9), for_each_oldnew_connector_in_state(9), for_each_old_connector_in_state(9), for_each_new_connector_in_state(9), for_each_oldnew_crtc_in_state(9), for_each_old_crtc_in_state(9), for_each_new_crtc_in_state(9), for_each_oldnew_colorop_in_state(9), for_each_new_colorop_in_state(9), for_each_oldnew_plane_in_state(9), for_each_new_plane_in_state_reverse(9), for_each_old_plane_in_state(9), for_each_new_plane_in_state(9), for_each_oldnew_private_obj_in_state(9), for_each_old_private_obj_in_state(9), for_each_new_private_obj_in_state(9), drm_atomic_crtc_needs_modeset(9), drm_atomic_crtc_effectively_active(9), struct drm_bus_cfg(9), struct drm_bridge_state(9).

like i said. big friend group. iykyk πŸ’œ


and that's the whole page, bestie β€” mwah πŸ’‹

cute little sign-off: this one's brought to you from the kernel file ./include/drm, dated October 2026, and yes the header still says for_each_old...tate_reverse(9) because that name is honestly iconically long and we respect it. πŸ“β­

πŸ“¦ where this page comes from