for_each_new_crtc_in_state(9)
β¨ for_each_new_crtc_in_state(9) β¨
okay bestie, welcome to the Kernel API Manual π this one is a macro moment and it's literally about looping through CRTCs in an atomic update, so grab your iced coffee and let's get into it π§
πΈ NAME πΈ
for_each_new_crtc_in_state β iterate over all CRTCs in an atomic update. That's the whole assignment: every CRTC in the atomic update gets a lil visit from the loop π¦
β¨ SYNOPSIS β¨
for_each_new_crtc_in_state (__state , crtc , new_crtc_state , __i );
copy it exactly, spaces and all β the compiler does not care about your aesthetic π
π ARGUMENTS π
__stateβ astruct drm_atomic_commitpointer. it's the atomic commit you're working with, bestie πcrtcβ astruct drm_crtciteration cursor. this is your current CRTC as the loop does its thing π«Άnew_crtc_stateβ astruct drm_crtc_stateiteration cursor for the new state. not the old state, the new one β she's the main character here π__iβ anintiteration cursor, and it's for macro-internal use π that's the macro's own little bookkeeping, iykyk
π¦ DESCRIPTION π¦
so this iterates over all CRTCs in an atomic update, tracking only the new state. no old-state baggage, just the new state, periodt π
it's giving enable-function energy: this is useful in enable functions, where we need the new state the hardware should be in when the atomic commit operation has completed. like, the hardware's final form after the commit finishes β¨ that's the vibe check this macro passes every time π―
π SEE ALSO π
the kernel file is ./include/drm/drm_atomic.h, and the whole squad is here β no cuts, no skips, all of them:
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_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)
mwah π this one lives in ./include/drm, it's dated October 2026, and it answers to for_each_new_crtc_in_state(9) β slay, bye bestie ππ
π¦ 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