STRUCT DRM_PRIVATE_STATE_FUNCS(9)
π struct drm_private_state_funcs(9) π
okay bestie, welcome to the Kernel API Manual β¨ this one's all about struct drm_private_state_funcs β the atomic state functions for private objects. yes it's a whole vibe. let's get into it π
πΈ NAME πΈ
struct drm_private_state_funcs β atomic state functions for private objects π¦
β¨ SYNOPSIS β¨
struct drm_private_state_funcs {
struct drm_private_state *(*atomic_create_state)(struct drm_private_obj *obj);
struct drm_private_state *(*atomic_duplicate_state)(struct drm_private_obj *obj);
void (*atomic_destroy_state)(struct drm_private_obj *obj, struct drm_private_state *state);
void (*atomic_print_state)(struct drm_printer *p, const struct drm_private_state *state);
};
like, that's the whole struct. four function pointers. she's small but she's doing the MOST π
π Members π
π«Ά atomic_create_state
Allocates a pristine, initialized state for the private object and hands it back to you. π
β οΈ okay this part is literally the rule, do not break it: this callback must have no side effects. In particular, the returned state must not be assigned to the object's state pointer, and it must not affect the hardware state. no cap. like, it's window shopping only, no buying π
RETURNS:
A new, pristine, private state instance, or an error pointer on failure. π
π atomic_duplicate_state
Duplicate the current state of the private object and return it. πͺ
π¨ it is an error to call this before obj->state has been initialized. like, you gotta have a state before you can duplicate it, bestie, that's just logic π
RETURNS:
Duplicated atomic state, or NULL when obj->state is not initialized or allocation failed. π
π§ atomic_destroy_state
Frees the private object state created with atomic_duplicate_state. ποΈβ¨ she cleans up after herself, icon behaviour.
π atomic_print_state
If your driver subclasses struct drm_private_state, you should implement this optional hook for printing additional driver-specific state. π¨οΈπ optional but recommended, iykyk.
β οΈ Do not call this directly β use drm_atomic_private_obj_print_state instead. fr fr, go through the proper channel.
π« Description π«
These hooks are used by atomic helpers to create, swap and destroy states of private objects. the way that atomic helpers just do all the heavy lifting for you π₯
The structure itself is used as a vtable to identify the associated private object type. π
Each private object type that needs to be added to the atomic states is expected to have an implementation of these hooks and pass a pointer to its drm_private_state_funcs struct to drm_atomic_get_private_obj_state. π«‘ that's the assignment. periodt.
π SEE ALSO π
Kernel file ./include/drm/drm_atomic.h ποΈ and also, like, a whole friend group:
struct drm_crtc_commit(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_old_connector_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)
like, go read them. they're all gonna be there. slay π¦π
and that's the page, bestie π«Ά this one came from ./include/drm, dated October 2026, and it's filed under the Kernel API Manual. mwah πβ¨
π¦ 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