for_each_ol...obj_in_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” a struct drm_atomic_commit pointer, i.e. the atomic commit we're snooping around in πŸ•΅οΈ
  • obj β€” a struct drm_private_obj, your iteration cursor for the objects themselves
  • old_obj_state β€” a struct drm_private_state, your iteration cursor for the old state (yes, the old one, keep up πŸ’…)
  • __i β€” an int iteration 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:

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