drm_atomic_h...setup_commit(9)
β¨ drm_atomic_helper_setup_commit(9) β¨
okay bestie, welcome to the Kernel API Manual π this one's all about drm_atomic_helper_setup_commit β setup for a possibly nonblocking commit. slay.
πΈ NAME πΈ
drm_atomic_helper_setup_commit β setup possibly nonblocking commit. yes literally that's the whole vibe.
π¦ SYNOPSIS π¦
int drm_atomic_helper_setup_commit (struct drm_atomic_commit *state ,
bool nonblock );
π ARGUMENTS π
stateβ the new modeset state that's finna be committed.nonblockβ whether nonblocking behavior is requested. like, do you want it async or not, queen?
π DESCRIPTION π
okay so this function prepares state to be used by the atomic helper's support for nonblocking commits. drivers that are using the nonblocking commit infrastructure should always call this function from their drm_mode_config_funcs.atomic_commit hook. always always, no cap π
drivers that need to extend the commit setup to private objects can use the drm_mode_config_helper_funcs.atomic_commit_setup hook. icon behavior.
to be able to use this support, drivers need to use a few more helper functions. drm_atomic_helper_wait_for_dependencies must be called before actually committing the hardware state, and for nonblocking commits this call must be placed in the async worker. also see drm_atomic_helper_swap_state and its stall parameter β that's for when a driver's commit hooks look at the drm_crtc.state, drm_plane.state or drm_connector.state pointer directly. iykyk.
completion of the hardware commit step must be signalled using drm_atomic_helper_commit_hw_done. after this step the driver is not allowed to read or change any permanent software or hardware modeset state. the only exception is state protected by other means than drm_modeset_lock locks. only the free standing state with pointers to the old state structures can be inspected, e.g. to clean up old buffers using drm_atomic_helper_cleanup_planes.
at the very end, before cleaning up state, drivers must call drm_atomic_helper_commit_cleanup_done. don't skip it bestie π
this is all implemented by in drm_atomic_helper_commit, giving drivers a complete and easy-to-use default implementation of the atomic_commit hook. it's giving "built-in bestie."
the tracking of asynchronously executed and still pending commits is done using the core structure drm_crtc_commit. love that for us.
by default there's no need to clean up resources allocated by this function explicitly: drm_atomic_commit_default_clear will take care of that automatically. she handles it π
π₯ RETURN π₯
0on success, periodt.-EBUSYwhen userspace schedules nonblocking commits too fast (slow down babes)-ENOMEMon allocation failures-EINTRwhen a signal is pending
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_atomic_helper.coverview(9) drm_atomic_helper_check_modeset(9)drm_atomic_helper_check_wb_connector_state(9)drm_atomic_helper_check_plane_state(9)drm_atomic_helper_check_crtc_primary_plane(9)drm_atomic_helper_check_planes(9)drm_atomic_helper_check(9)drm_atomic_helper_commit_encoder_bridge_disable(9)drm_atomic_helper_commit_crtc_disable(9)drm_atomic_helper_commit_encoder_bridge_post_disable(9)drm_atomic_helper_update_legacy_modeset_state(9)drm_atomic_helper_calc_timestamping_constants(9)drm_atomic_helper_commit_crtc_set_mode(9)drm_atomic_helper_commit_modeset_disables(9)drm_atomic_helper_commit_writebacks(9)drm_atomic_helper_commit_encoder_bridge_pre_enable(9)drm_atomic_helper_commit_crtc_enable(9)drm_atomic_helper_commit_encoder_bridge_enable(9)drm_atomic_helper_commit_modeset_enables(9)drm_atomic_helper_wait_for_fences(9)drm_atomic_helper_wait_for_vblanks(9)drm_atomic_helper_wait_for_flip_done(9)drm_atomic_helper_commit_tail(9)drm_atomic_helper_commit_tail_rpm(9)drm_atomic_helper_async_check(9)drm_atomic_helper_async_commit(9)drm_atomic_helper_commit(9)- implementing nonblocking commit(9)
drm_atomic_helper_wait_for_dependencies(9)drm_atomic_helper_fake_vblank(9)drm_atomic_helper_commit_hw_done(9)drm_atomic_helper_commit_cleanup_done(9)drm_atomic_helper_prepare_planes(9)drm_atomic_helper_unprepare_planes(9)drm_atomic_helper_commit_planes(9)drm_atomic_helper_commit_planes_on_crtc(9)drm_atomic_helper_disable_planes_on_crtc(9)drm_atomic_helper_cleanup_planes(9)drm_atomic_helper_swap_state(9)drm_atomic_helper_update_plane(9)drm_atomic_helper_disable_plane(9)drm_atomic_helper_set_config(9)drm_atomic_helper_disable_all(9)drm_atomic_helper_reset_crtc(9)drm_atomic_helper_shutdown(9)drm_atomic_helper_duplicate_state(9)drm_atomic_helper_suspend(9)drm_atomic_helper_commit_duplicated_state(9)drm_atomic_helper_resume(9)drm_atomic_helper_page_flip(9)drm_atomic_helper_page_flip_target(9)drm_atomic_helper_bridge_propagate_bus_fmt(9)drm_atomic_helper_bridge_get_hdmi_output_bus_fmts(9)
and that's the tea, bestie π«Ά this lil page lives at ./drivers/gpu/drm, dated October 2026, and the header at the top is literally just drm_atomic_h...setup_commit(9) again. mwah π go commit something iconic.
π¦ 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