drm_atomic_helper_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_atomic_helper_check(9) πŸ’…

okay so this is a page from the Kernel API Manual, and honestly? it's a bop. it's drm_atomic_helper_check, and it's here to tell you whether the state you're asking for is even physically possible or if you're delulu. vibe check for your atomic commit, basically. πŸ¦‹


✨ NAME ✨

drm_atomic_helper_check β€” bestie, it validates the state object. that's the whole job. πŸ’–


🌸 SYNOPSIS 🌸

int drm_atomic_helper_check (struct drm_device *dev , struct
       drm_atomic_commit *state );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the DRM device. the main character of this whole situation. πŸ‘‘
  • state β€” the driver state object. the thing we're checking. the moment of truth. ✨

πŸ’« DESCRIPTION πŸ’«

so what does it actually do? it checks the state object to see if the requested state is physically possible. fr fr. only CRTCs and planes have check callbacks, so if a driver needs any extra (global) checking, it can just wrap that around this function. and drivers with no such needs? they can directly use this as their drm_mode_config_funcs.atomic_check callback. slay, no extra work. πŸ’…

this just wraps the two parts of the state checking for planes and modeset state, in the default order: first it calls drm_atomic_helper_check_modeset and then drm_atomic_helper_check_planes. the assumption here (iykyk) is that the drm_plane_helper_funcs.atomic_check and drm_crtc_helper_funcs.atomic_check functions depend upon an updated adjusted_mode.clock to e.g. properly compute watermarks. the way that clock needs to be updated before anyone does math on it 😭

and now, the plot twist: note that zpos normalization will add all enable planes to the state, which might not be desired for some drivers. for example, enable/disable of a cursor plane which have fixed zpos value would trigger all other enabled planes to be forced to the state change. lowkey chaotic but that's the tea. 🍡

IMPORTANT: since this function calls drm_atomic_helper_check_modeset internally, its restrictions also apply too, no cap. drivers which set drm_crtc_state.mode_changed (like, e.g. in their drm_plane_helper_funcs.atomic_check hooks if a plane update can't be done without a full modeset) _must_ call drm_atomic_helper_check_modeset function again after that change. like. you have to. it's not optional. 🚨

πŸ”₯ RETURN πŸ”₯

zero for success, or -errno. that's it, that's the whole vibe check result. πŸ’€


🌈 SEE ALSO 🌈

okay bestie, this list is long, but every single one of these is iconic in its own right, so we're listing them all. no skipping. periodt. πŸ‘‘


🫢 the cute sign-off 🫢

this one lives in ./drivers/gpu/drm, dated October 2026, and it's filed under drm_atomic_helper_check(9) in case you need to find it again later. go forth and validate your state objects, bestie. you're gonna slay. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from