for_each_old_crtc_in_state(9)
π for_each_old_crtc_in_state β Kernel API Manual β¨
okay so bestie, welcome to the for_each_old_crtc_in_state(9) page π this one lives in the Kernel API Manual and honestly? it's giving "small macro, big main character energy" π let's get into it.
πΈ NAME πΈ
for_each_old_crtc_in_state β iterate over all CRTCs in an atomic update π
β¨ SYNOPSIS β¨
for_each_old_crtc_in_state (__state , crtc , old_crtc_state , __i );
like, that's the whole vibe. four things go in, magic comes out π«Ά
π ARGUMENTS π
__stateβ astruct drm_atomic_commitpointer. yes bestie, the whole atomic commit, that's the one πcrtcβ astruct drm_crtciteration cursor. it's your little "where am i right now" buddy as you loop πΈold_crtc_stateβ astruct drm_crtc_stateiteration cursor for the old state. the before pics, if you will πΈ__iβ anintiteration cursor, for macro-internal use. bestie do NOT touch this one, it's not for you, it's the macro's own business π (iykyk)
π DESCRIPTION π
so what does this actually do? it iterates over all CRTCs in an atomic update, tracking only the old state β¨ like, exclusively the old one, no new-state crumbs, periodt.
and why do we care? because this is genuinely useful in disable functions π₯ β those are the spots where we need the old state that the hardware is still in. the hardware hasn't caught up yet, so the old state is the truth we're working with π
fr fr, "old state" here isn't nostalgia, it's literally what the hardware is still doing. respect it π
π¦ SEE ALSO π¦
here's the whole friend group, no cap β everyone in this list is a real one π
- kernel file
./include/drm/drm_atomic.h 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_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_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)
π§ sign-off π§
this page ships from ./include/drm πΈ and the version stamp says October 2026 β so that's the era we're in, bestie. the page title is for_each_old_crtc_in_state(9), and that's a wrap π
β¨ go iterate something iconic ππ
π¦ 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