for_each_new_crtc_in_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” a struct drm_atomic_commit pointer. it's the atomic commit you're working with, bestie πŸ’…
  • crtc β€” a struct drm_crtc iteration cursor. this is your current CRTC as the loop does its thing 🫢
  • new_crtc_state β€” a struct drm_crtc_state iteration cursor for the new state. not the old state, the new one β€” she's the main character here πŸ‘‘
  • __i β€” an int iteration 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:


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