drm_atomic_a...ected_planes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_atomic_a...ected_planes(9) β€” the Kernel API Manual, bestie edition ✨

Okay so this is a page from the Kernel API Manual and honestly? It's giving "short but mighty." It's all about drm_atomic_add_affected_planes and it's here to make your atomic commits not fall apart. Let's get into it 🫢


🌸 NAME 🌸

drm_atomic_add_affected_planes β€” literally just "add planes for CRTC." That's the whole vibe check.


✨ SYNOPSIS ✨

int drm_atomic_add_affected_planes (struct drm_atomic_commit *state ,
                                    struct drm_crtc *crtc );

No cap, that's the signature. Two args, one int back. Iconic.


πŸŽ€ ARGUMENTS πŸŽ€

  • state β€” the atomic state, aka the whole situation you're working with πŸ’–
  • crtc β€” a DRM CRTC. Yes queen, that kind of CRTC.

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's what's happening: this function walks the current configuration and adds all the planes that crtc is currently using into the atomic configuration state. Basically it's out here collecting the plane states so you don't have to πŸ™ˆ

Why would you even want that? Two big mood reasons:

  • When an atomic commit also needs to check all currently enabled planes on crtc β€” like, say, when you're changing the mode. πŸ‘‘
  • When you're re-enabling a CRTC and you don't wanna write special code just to force-enable all the planes. Lowkey saves you a whole thing.

Now, the smart bit (and this is fr fr the best part): since acquiring a plane state will always also acquire the w/w mutex of the current CRTC for that plane (if there is one), adding all the plane states for a CRTC will not reduce parallelism of atomic updates. So you're not sabotaging your own performance by doing this. Slay. πŸ’…


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” we love a win πŸŽ‰
  • Can fail with -EDEADLK or -ENOMEM.
⚠️ Okay this part matters: when the error is EDEADLK, that means the w/w mutex code detected a deadlock, and the entire atomic sequence must be restarted. Not optional, bestie, the whole thing. All other errors are fatal πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/gpu/drm/drm_atomic.c, plus this absolutely stacked friend group of related pages:


🧚 Sign-off 🧚

This little masterpiece lives in ./drivers/gpu/drm and the version/date stamped on it is October 2026. Go forth and atomically commit, bestie β€” you got this πŸ’œβœ¨

πŸ“¦ where this page comes from