drm_for_each_encoder_mask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drm_for_each_encoder_mask β€” bestie's guide to looping encoders (from the Kernel API Manual, no cap) πŸ’–

Ok so picture this: you're deep in DRM land, you've got a bitmask, and you need to hit up every encoder it points at. That's the whole vibe of drm_for_each_encoder_mask(9). It's a macro, it's a loop, it's lowkey iconic. Let's get into it 🫢


✨ NAME ✨

drm_for_each_encoder_mask β€” iterate over encoders specified by bitmask. That's it, that's the function. She loops, she iterates, she slays πŸ’…


🌸 SYNOPSIS 🌸

drm_for_each_encoder_mask (encoder , dev , encoder_mask );

Literally just drop it in your code like this, exactly like this, don't touch the spacing, she's sensitive πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • encoder β€” the loop cursor, bestie. This is the variable that gets filled in fresh on every spin around the loop. She's the main character of your for loop πŸ‘‘
  • dev β€” the DRM device. Your whole graphics situation. The big one. You know her πŸ–₯️
  • encoder_mask β€” bitmask of encoder indices. Bit i set means encoder i is invited to the party πŸŽ‰ Each set bit = one loop iteration.

πŸ’œ DESCRIPTION πŸ’œ

Iterate over all encoders specified by bitmask. That's the entire description and honestly? She ate. No notes. It does exactly one thing and it does it well: for every encoder index that's turned on in encoder_mask, your loop body runs with encoder pointing at that encoder. Periodt. πŸ”₯

fr fr, this is a macro β€” make sure encoder, dev, and encoder_mask are all ready to go before you enter the loop, because she's not doing any setup for you πŸ™ˆ

🌈 SEE ALSO 🌈

The whole friend group, all linked from the kernel file ./include/drm/drm_encoder.h:

Go read them, they're all baddies too, iykyk πŸ’–


That's the whole page, bestie! 🧚 Sending you off with a little sign-off: this one lives under ./include/drm, dated October 2026, and it's titled drm_for_each_encoder_mask(9) β€” so now you can cite her with confidence. Go loop those encoders, you absolute icon β­πŸŽ€

πŸ“¦ where this page comes from