drm_atomic_get_crtc_state(9)
Okay bestie, let's talk about drm_atomic_get_crtc_state(9) from the Kernel API Manual β this one's a banger. π
β¨ NAME β¨
drm_atomic_get_crtc_state β get CRTC state. Periodt, that's the whole name.
π¦ SYNOPSIS π¦
struct drm_crtc_state * drm_atomic_get_crtc_state (struct drm_atomic_commit *state , struct drm_crtc *crtc );
π ARGUMENTS π
stateβ the global atomic state object. Think of it as the group chat where all the atomic stuff gets coordinated. πcrtcβ the CRTC you want the state object for. It's the screen controller, and it's the main character of this call. π
π DESCRIPTION π
So here's the tea: this function literally returns the CRTC state for the CRTC you gave it, and if that state doesn't exist yet, it allocates it on the spot β no cap. It also grabs the relevant CRTC lock to make sure the state stays consistent, because we don't do messy half-updated vibes around here. πβ¨
β οΈ WARNING β οΈ β Drivers can only add new CRTC states to a state if drm_atomic_commit.allow_modeset is set, OR if it's a driver-internal commit that userspace didn't create through an IOCTL call. That's the rule, bestie, and you better respect it. π
π₯ RETURN π₯
You get back either the allocated state or an error code encoded into the pointer. When the error is EDEADLK, that means the w/w mutex code has detected a deadlock and the entire atomic sequence must be restarted β it's giving "try again from the top, bestie." π Every other error is fatal, and I mean fatal fatal. No survivors. π
π SEE ALSO π
This function is besties with a whole squad. Check out:
./drivers/gpu/drm/drm_atomic.cβ the kernel file where the magic happens.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_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_add_affected_colorops(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)
This slay page was brought to you by the kernel file ./drivers/gpu/drm, dated October 2026, for drm_atomic_get_crtc_state(9). Bye bestie! π
β¨π¦
π¦ 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