Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/atomic: Document __drm_private_objs_state state pointer

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-39-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+17 -1
+17 -1
include/drm/drm_atomic.h
··· 391 391 392 392 struct __drm_private_objs_state { 393 393 struct drm_private_obj *ptr; 394 - struct drm_private_state *state, *old_state, *new_state; 394 + 395 + /** 396 + * @state: 397 + * 398 + * Used to track the @drm_private_state we will need to free 399 + * when tearing down the associated &drm_atomic_state in 400 + * $drm_mode_config_funcs.atomic_state_clear or 401 + * drm_atomic_state_default_clear(). 402 + * 403 + * Before a commit, and the call to 404 + * drm_atomic_helper_swap_state() in particular, it points to 405 + * the same state than @new_state. After a commit, it points to 406 + * the same state than @old_state. 407 + */ 408 + struct drm_private_state *state; 409 + 410 + struct drm_private_state *old_state, *new_state; 395 411 }; 396 412 397 413 /**