drm/atomic: colorop: Rename state to state_to_destroy

The atomic state tracking structures used to have a generic state
field to track the state to free when tearing down the
drm_atomic_commit. It has since been renamed to state_to_destroy in
__drm_planes_state, __drm_crtcs_state, __drm_connnectors_state, and
__drm_private_objs_state to better describe its purpose.

The colorop support has been added after that rename, but
__drm_colorops_state still uses the old state name. Rename it to
state_to_destroy for consistency, and add the matching kerneldoc.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260908-drm-reset-state-flag-v3-1-905570f387a4@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Maxime Ripard 2026-09-08 16:35:02 +02:00
parent 18740b7fe4
commit 38d8b5a353
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76
3 changed files with 21 additions and 5 deletions

View File

@ -343,9 +343,9 @@ void drm_atomic_commit_default_clear(struct drm_atomic_commit *state)
continue;
drm_colorop_atomic_destroy_state(colorop,
state->colorops[i].state);
state->colorops[i].state_to_destroy);
state->colorops[i].ptr = NULL;
state->colorops[i].state = NULL;
state->colorops[i].state_to_destroy = NULL;
state->colorops[i].old_state = NULL;
state->colorops[i].new_state = NULL;
}
@ -708,7 +708,7 @@ drm_atomic_get_colorop_state(struct drm_atomic_commit *state,
if (!colorop_state)
return ERR_PTR(-ENOMEM);
state->colorops[index].state = colorop_state;
state->colorops[index].state_to_destroy = colorop_state;
state->colorops[index].ptr = colorop;
state->colorops[index].old_state = colorop->state;
state->colorops[index].new_state = colorop_state;

View File

@ -3351,7 +3351,7 @@ int drm_atomic_helper_swap_state(struct drm_atomic_commit *state,
old_colorop_state->state = state;
new_colorop_state->state = NULL;
state->colorops[i].state = old_colorop_state;
state->colorops[i].state_to_destroy = old_colorop_state;
colorop->state = new_colorop_state;
}

View File

@ -159,7 +159,23 @@ struct drm_crtc_commit {
struct __drm_colorops_state {
struct drm_colorop *ptr;
struct drm_colorop_state *state, *old_state, *new_state;
/**
* @state_to_destroy:
*
* Used to track the @drm_colorop_state we will need to free
* when tearing down the associated &drm_atomic_commit in
* $drm_mode_config_funcs.atomic_state_clear or
* drm_atomic_commit_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_colorop_state *state_to_destroy;
struct drm_colorop_state *old_state, *new_state;
};
struct __drm_planes_state {