drm_for_each_encoder_mask(9)
π 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 yourforloop π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 sureencoder,dev, andencoder_maskare 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:
struct drm_encoder_funcs(9)struct drm_encoder(9)drmm_encoder_alloc(9)drmm_plain_encoder_alloc(9)drm_encoder_index(9)drm_encoder_mask(9)drm_encoder_crtc_ok(9)drm_encoder_find(9)drm_for_each_encoder(9)
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
- 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