for_each_ne...rop_in_state(9)
π for_each_new_colorop_in_state(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes this is a real macro in the kernel and yes it's giving main character energy. Sit down, grab a boba, we're iterating π
β¨ NAME β¨
for_each_new_colorop_in_state β iterate over all colorops in an atomic update π
π¦ SYNOPSIS π¦
for_each_new_colorop_in_state (__state , colorop , new_colorop_state ,
__i );
like, that's the whole vibe. four args, one macro, periodt π
πΈ ARGUMENTS πΈ
__stateβ astruct drm_atomic_commitpointer. this is your main character of the whole operation, the atomic update itself β¨coloropβ astruct drm_coloropiteration cursor. it's the little guy that walks through every colorop, one at a time πΆββοΈnew_colorop_stateβ astruct drm_colorop_stateiteration cursor, but for the new state. yes the new one, keep up bestie π__iβ anintiteration cursor, and it's for macro-internal use only π don't touch it, don't look at it, it's not for you
π« DESCRIPTION π«
So here's the tea β β this macro iterates over all colorops in an atomic update, and while it's doing that it also tracks the new state for you. Obsessed, honestly.
The way that's useful: it's for places where the state delta actually needs to be considered π β for example, in atomic check functions. Like, if you need to know what changed, not just what is, this is your girl π«Ά
π SEE ALSO π
Kernel file ./include/drm/drm_atomic.h β and then the whole friend group, no cap π«
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_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)
aaaand that's the page bestie, you ate that π
β¨ this lil masterpiece lives in ./include/drm, came to you courtesy of the Kernel API Manual, and it's dated October 2026 ποΈπ go forth and iterate, icon ππ¦
π¦ 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