for_each_old...ane_in_state(9)
π NAME π
Okay bestie, welcome to the for_each_old...ane_in_state(9) page from the Kernel API Manual β the actual star of the show is for_each_oldnew_plane_in_state, and its whole job is to iterate over all planes in an atomic update. Iconic behavior, honestly.
β¨ SYNOPSIS β¨
for_each_oldnew_plane_in_state (__state , plane , old_plane_state ,
new_plane_state , __i );
π ARGUMENTS π
__stateβ astruct drm_atomic_commitpointer. That's your atomic commit vibe.planeβ astruct drm_planeiteration cursor.old_plane_stateβ astruct drm_plane_stateiteration cursor for the old state.new_plane_stateβ astruct drm_plane_stateiteration cursor for the new state.__iβ anintiteration cursor, strictly for macro-internal use.
π¦ DESCRIPTION π¦
So what does it do? It iterates over all planes in an atomic update, tracking both the old state and the new state at the same time. That's lowkey the whole point.
This is useful in places where you need to consider the state delta β for example, in atomic check functions. No cap, that's exactly the situation it's built for.
π₯ SEE ALSO π₯
Kernel file: ./include/drm/drm_atomic.h
The whole friend group is here, bestie:
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_reverse(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)
That's the whole vibe π This page lives in ./include/drm, dated October 2026, and the footer is still serving for_each_old...ane_in_state(9). Bye bestie, go iterate slayfully β¨π
π¦ 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