for_each_ol...obj_in_state(9)
π for_each_old_private_obj_in_state β Kernel API Manual, section 9 π
okay bestie, welcome to a section 9 kernel API page, like the actual for_each_old_private_obj_in_state one, straight out of the DRM atomic headers. yes we're in the kernel, yes it's giving main character energy, no you don't need to panic. let's go β¨
πΈ NAME πΈ
for_each_old_private_obj_in_state β the macro that iterates over all private objects in an atomic update π«
π¦ SYNOPSIS π¦
for_each_old_private_obj_in_state (__state , obj , old_obj_state , __i
);
β ARGUMENTS β
__stateβ astruct drm_atomic_commitpointer, i.e. the atomic commit we're snooping around in π΅οΈobjβ astruct drm_private_obj, your iteration cursor for the objects themselvesold_obj_stateβ astruct drm_private_state, your iteration cursor for the old state (yes, the old one, keep up π )__iβ anintiteration cursor, and ngl this one is purely for macro-internal use, so don't touch it, it's not for you π
π₯ DESCRIPTION π₯
So what does this iconic macro actually do? It iterates over all private objects in an atomic update, and it tracks only the old state. That's the whole vibe. π«Ά
And why would you want that? Because it's literally made for disable functions β the places where you need the old state that the hardware is still in. like, the hardware hasn't moved on yet, so you need the before-picture, not the after-picture. no cap, that's the entire point π
π SEE ALSO π
Kernel file ./include/drm/drm_atomic.h, plus the whole friend group:
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_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_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, that's a lot of siblings and every single one of them is invited π§
π tiny lil reminder that this page is filed under ./include/drm and dated October 2026 β that's the source/version and date, and this is me signing off: stay atomic, stay old-state-aware, and go read a disable function, bestie. periodt. ππ
π¦ 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