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 <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> --- To: Maarten Lankhorst <[email protected]> To: Maxime Ripard <[email protected]> To: Thomas Zimmermann <[email protected]> To: David Airlie <[email protected]> To: Simona Vetter <[email protected]> Cc: [email protected] --- include/drm/drm_atomic.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index b2cc9c4a9beb59980a8fb3629a11a45d08f2e86e..a05012adcf94741e2374d2a0c2cd66eb1d7ef98f 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -157,11 +157,27 @@ struct drm_crtc_commit { bool abort_completion; }; struct __drm_planes_state { struct drm_plane *ptr; - struct drm_plane_state *state, *old_state, *new_state; + + /** + * @state: + * + * Used to track the @drm_plane_state we will need to free when + * tearing down the associated &drm_atomic_state in + * $drm_mode_config_funcs.atomic_state_clear or + * drm_atomic_state_default_clear(). + * + * Before a commit, and the call to + * drm_atomic_helper_swap_state() in particular, it points to + * the same state than @new_state. After a commit, it points to + * the same state than @old_state. + */ + struct drm_plane_state *state; + + struct drm_plane_state *old_state, *new_state; }; struct __drm_crtcs_state { struct drm_crtc *ptr; struct drm_crtc_state *state, *old_state, *new_state; -- 2.51.0
