for_each_ne...obj_in_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_ne...obj_in_state(9) β€” Kernel API Manual

okay so bestie, welcome to the Kernel API Manual page for for_each_ne...obj_in_state(9) β€” yes the name is truncated with the little dots, that's just how the header do πŸ’€ β€” and it's genuinely one of those macro-girlies that eats. let's get into it πŸ”₯


✨ NAME ✨

for_each_new_private_obj_in_state β€” iterate over all private objects in an atomic update πŸ¦‹

no cap, that's the whole vibe: loop over private objects, new state only.


πŸŽ€ SYNOPSIS πŸŽ€

for_each_new_private_obj_in_state (__state , obj , new_obj_state , __i );

four args, all of them, copy them exactly, iykyk 😌


🌸 ARGUMENTS 🌸

  • __state β€” a struct drm_atomic_commit pointer. the whole commit situation, main character energy πŸ‘‘
  • obj β€” a struct drm_private_obj iteration cursor. it's the thing you're walkin' through, one private object at a time ✨
  • new_obj_state β€” a struct drm_private_state iteration cursor for the new state. literally the fresh state, the one we actually care about πŸ’–
  • __i β€” an int iteration cursor, for macro-internal use. do not touch her, she's busy doing bookkeeping 🫢

πŸ”₯ DESCRIPTION πŸ”₯

so this macro iterates over all private objects in an atomic update, but check it β€” it tracks only the new state 🌈

it's giving extremely useful in enable functions, where we need the new state the hardware should be in when the atomic commit operation has completed. like, the after-picture πŸ’… the state the hardware is gonna be living in post-commit, periodt.

ngl, if you're reaching for this, you're probably writing an enable function and you already know what you want. slay. the macro just hands you the new private state per object and gets out of your way πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file is ./include/drm/drm_atomic.h β€” go read the source, it's iconic 🧚

like, that's the whole friend group fr fr β€” every one of them is in there, no skips 🫢


and that's the page!! mwah πŸ’‹ this lil' beauty lives in ./include/drm, dated October 2026, and it's for_each_ne...obj_in_state(9) til the end. go forth and iterate, bestie β€” you're gonna slay those private objects πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from