drm_atomic_g...nector_state(9)
β¨ drm_atomic_g...nector_state(9) β¨
Okay bestie, welcome to the Kernel API Manual π β yes the title's got that cursed truncated-energy (drm_atomic_g...nector_state(9), they really said "you get the idea"), but the actual function inside is fully iconic, iykyk.
πΈ NAME πΈ
drm_atomic_get_old_connector_state β get connector state, if it exists
Like, if it exists is doing so much work in that sentence, keep that energy in mind π
π SYNOPSIS π
struct drm_connector_state * drm_atomic_get_old_connector_state (const
struct drm_atomic_commit *state , struct drm_connector *connector );
That's the whole fit. Slay. π
π¦ ARGUMENTS π¦
stateβ the global atomic state object. the main character of this whole situation β¨connectorβ the connector to grab. yeah. grab it. π«Ά
π DESCRIPTION π
So here's the vibe check: this function returns the old connector state for the given connector. That's it, that's the whole job, and it does it gorgeously.
But β and this is the important part, don't skip it β if the connector is not part of the global atomic state, you get NULL back. Not an error, not a dramatic exit, just NULL. So pls check for it before you go dereferencing like a menace ππ
π SEE ALSO π
The kernel file is ./include/drm/drm_atomic.h β go read it, it's giving lore β¨
And here's the whole friend group, no cap, every single one of them:
struct drm_crtc_commit(9)struct drm_private_state_funcs(9)struct drm_private_obj(9)drm_for_each_privobj(9)struct drm_private_state(9)struct drm_atomic_commit(9)drm_crtc_commit_get(9)drm_crtc_commit_put(9)drm_atomic_commit_get(9)drm_atomic_commit_put(9)drm_atomic_get_old_crtc_state(9)drm_atomic_get_new_crtc_state(9)drm_atomic_get_old_plane_state(9)drm_atomic_get_new_plane_state(9)drm_atomic_get_new_connector_state(9)__drm_atomic_get_current_plane_state(9)for_each_oldnew_connector_in_state(9)for_each_old_connector_in_state(9)for_each_new_connector_in_state(9)for_each_oldnew_crtc_in_state(9)for_each_old_crtc_in_state(9)for_each_new_crtc_in_state(9)for_each_oldnew_colorop_in_state(9)for_each_new_colorop_in_state(9)for_each_oldnew_plane_in_state(9)for_each_oldnew_plane_in_state_reverse(9)for_each_new_plane_in_state_reverse(9)for_each_old_plane_in_state(9)for_each_new_plane_in_state(9)for_each_oldnew_private_obj_in_state(9)for_each_old_private_obj_in_state(9)for_each_new_private_obj_in_state(9)drm_atomic_crtc_needs_modeset(9)drm_atomic_crtc_effectively_active(9)struct drm_bus_cfg(9)struct drm_bridge_state(9)
That's 36 besties, and yes I counted, and yes they're all invited to the function's birthday party π
π Friendly reminder from your girl: NULL is a valid answer here, not a bug. Do not come for this function in the group chat when you forget to check it.
k bye ily, this page lives in ./include/drm and it's dated October 2026 β signed, sealed, shipped, periodt πβ¨π
π¦ 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