drm_atomic_...heck_modeset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to the drm_atomic_...heck_modeset(9) page from the Kernel API Manual β€” we're talking about drm_atomic_helper_check_modeset β€” validate state object for modeset changes. periodt ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the DRM device, obvi πŸ’…
  • state β€” the driver state object, the main character of this whole operation 🌟

✨ DESCRIPTION ✨

So the vibe here is: check the state object to see if the requested state is physically possible. No cap, that's the whole job. This does all the CRTC and connector related computations for an atomic update and adds any additional connectors needed for full modesets. It calls the various per-object callbacks in the follow order:

  1. drm_connector_helper_funcs.atomic_best_encoder for determining the new encoder.
  2. drm_connector_helper_funcs.atomic_check to validate the connector state.
  3. If it's determined a modeset is needed then all connectors on the affected CRTC are added and drm_connector_helper_funcs.atomic_check is run on them.
  4. drm_encoder_helper_funcs.mode_valid, drm_bridge_funcs.mode_valid and drm_crtc_helper_funcs.mode_valid are called on the affected components.
  5. drm_bridge_funcs.mode_fixup is called on all encoder bridges.
  6. drm_encoder_helper_funcs.atomic_check is called to validate any encoder state. This function is only called when the encoder will be part of a configured CRTC, it must not be used for implementing connector property validation. If this function is NULL, drm_atomic_encoder_helper_funcs.mode_fixup is called instead.
  7. drm_crtc_helper_funcs.mode_fixup is called last, to fix up the mode with CRTC constraints.

🌸 the state flags bestie πŸŽ€

  • drm_crtc_state.mode_changed is set when the input mode is changed.
  • drm_crtc_state.connectors_changed is set when a connector is added or removed from the CRTC.
  • drm_crtc_state.active_changed is set when drm_crtc_state.active changes, which is used for DPMS.
  • drm_crtc_state.no_vblank is set from the result of drm_dev_has_vblank.

See also: drm_atomic_crtc_needs_modeset


🚨 IMPORTANT 🚨

Drivers which set drm_crtc_state.mode_changed (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 this function after that change. It is permitted to call this function multiple times for the same update, e.g. when the drm_crtc_helper_funcs.atomic_check functions depend upon the adjusted dotclock for fifo space allocation and watermark computation. no cap, this one matters πŸ’€

πŸ’œ RETURN πŸ’œ

Zero for success or -errno β€” simple as that, bestie 🫢


🌈 SEE ALSO 🌈

Kernel file ./drivers/gpu/drm/drm_atomic_helper.c


this lil page lives in ./drivers/gpu/drm, dated October 2026, and it's your girl drm_atomic_...heck_modeset(9) signing off β€” love u bestie, go validate those modesets πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from