drm_atomic_a...ted_colorops(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_atomic_add_affected_colorops(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this one's called drm_atomic_add_affected_colorops and it's lowkey a little glamorous helper for planes and their colorops πŸŽ€


🌸 NAME 🌸

drm_atomic_add_affected_colorops β€” add colorops for plane πŸ’–


✨ SYNOPSIS ✨

int drm_atomic_add_affected_colorops (struct drm_atomic_commit *state ,
struct drm_plane *plane );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • state β€” the atomic state, aka the whole vibe of the pending commit ✨
  • plane β€” a DRM plane, the main character of this function ngl πŸ‘‘

πŸŽ€ DESCRIPTION πŸŽ€

okay so what this does: it walks the current configuration and adds all the colorops currently used by plane straight into the atomic configuration state. it's giving "collect them all" energy 🫢

why is that useful? because sometimes an atomic commit also needs to check all the currently enabled colorops on plane β€” like, say, when you're changing the mode. and it's also useful when you're re-enabling a plane, so you don't have to write special code just to force-enable all the colorops 😭

and here's the iconic part: since acquiring a colorop state will always also acquire the w/w mutex of the current plane for that colorop (if there is any), adding all the colorop states for a plane will not reduce parallelism of atomic updates. no cap, it's free real estate πŸ’…


🌈 RETURN 🌈

  • 0 on success πŸŽ‰
  • can fail with -EDEADLK or -ENOMEM 😭
  • when the error is EDEADLK, the w/w mutex code has detected a deadlock and the entire atomic sequence must be restarted πŸ” (dramatic but true)
  • all other errors are fatal πŸ’€
bestie pls don't ignore an EDEADLK β€” restart the whole atomic sequence, that's the assignment 🫑

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpu/drm/drm_atomic.c β€” state lifetime(9), drm_crtc_commit_wait(9), drm_atomic_commit_default_release(9), drm_atomic_commit_init(9), drm_atomic_commit_alloc(9), drm_atomic_commit_default_clear(9), drm_atomic_commit_clear(9), __drm_atomic_commit_free(9), drm_atomic_get_crtc_state(9), drm_atomic_get_plane_state(9), drm_atomic_get_colorop_state(9), drm_atomic_get_old_colorop_state(9), drm_atomic_get_new_colorop_state(9), drm_atomic_plane_check(9), handling driver private state(9), drm_atomic_private_obj_init(9), drm_atomic_private_obj_fini(9), drm_atomic_get_private_obj_state(9), drm_atomic_get_old_private_obj_state(9), drm_atomic_get_new_private_obj_state(9), drm_atomic_get_old_connector_for_encoder(9), drm_atomic_get_new_connector_for_encoder(9), drm_atomic_get_connector_for_encoder(9), drm_atomic_get_old_crtc_for_encoder(9), drm_atomic_get_new_crtc_for_encoder(9), drm_atomic_get_connector_state(9), drm_atomic_get_bridge_state(9), drm_atomic_get_old_bridge_state(9), drm_atomic_get_new_bridge_state(9), drm_atomic_add_encoder_bridges(9), drm_atomic_add_affected_connectors(9), drm_atomic_add_affected_planes(9), drm_atomic_check_only(9), drm_atomic_commit(9), drm_atomic_nonblocking_commit(9), drm_atomic_print_new_state(9), drm_state_dump(9)


that's the whole page bestie, go forth and add those colorops πŸ§šπŸ’œ

source: ./drivers/gpu/drm Β· October 2026 Β· drm_atomic_add_affected_colorops(9) β€” mwah, see u in the kernel docs again soon πŸ“πŸ’–

πŸ“¦ where this page comes from