All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Maxime Ripard <mripard@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: "Daniel Stone" <daniels@collabora.com>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Jocelyn Falempe" <jfalempe@redhat.com>,
	"Jonas Ådahl" <jadahl@redhat.com>,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Pekka Paalanen" <pekka.paalanen@collabora.com>,
	"Sebastian Wick" <sebastian.wick@redhat.com>,
	"Simon Ser" <contact@emersion.fr>,
	"Victoria Brekenfeld" <victoria@system76.com>,
	"Xaver Hugl" <xaver.hugl@kde.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 01/11] drm/atomic: colorop: Rename state to state_to_destroy
Date: Wed, 9 Sep 2026 08:28:51 +0200	[thread overview]
Message-ID: <2b3ff8c0-09b4-48fd-9965-9df70d19778c@suse.de> (raw)
In-Reply-To: <20260908-drm-reset-state-flag-v3-1-905570f387a4@kernel.org>



Am 08.09.26 um 16:35 schrieb Maxime Ripard:
> 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.

Makes sense. Please merge this as you see fit.

>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/drm_atomic.c        |  6 +++---
>   drivers/gpu/drm/drm_atomic_helper.c |  2 +-
>   include/drm/drm_atomic.h            | 18 +++++++++++++++++-
>   3 files changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 45df6376f408..5c0f7b7024d1 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -341,13 +341,13 @@ void drm_atomic_commit_default_clear(struct drm_atomic_commit *state)
>   
>   		if (!colorop)
>   			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;
>   	}
>   
>   	for (i = 0; i < state->num_private_objs; i++) {
> @@ -706,11 +706,11 @@ drm_atomic_get_colorop_state(struct drm_atomic_commit *state,
>   
>   	colorop_state = drm_atomic_helper_colorop_duplicate_state(colorop);
>   	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;
>   	colorop_state->state = state;
>   
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 285aac3554df..c4752bd7d999 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -3349,11 +3349,11 @@ int drm_atomic_helper_swap_state(struct drm_atomic_commit *state,
>   		WARN_ON(colorop->state != old_colorop_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;
>   	}
>   
>   	drm_panic_lock(state->dev, flags);
>   	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index 88087910ab1a..00b3e9fc429a 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_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 {
>   	struct drm_plane *ptr;
>   
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)



  reply	other threads:[~2026-09-09  6:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 14:35 [PATCH v3 00/11] drm: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-09-08 14:35 ` [PATCH v3 01/11] drm/atomic: colorop: Rename state to state_to_destroy Maxime Ripard
2026-09-09  6:28   ` Thomas Zimmermann [this message]
2026-09-11 13:27   ` (subset) " Maxime Ripard
2026-09-08 14:35 ` [PATCH v3 02/11] drm/atomic: Create function to insert CRTC state into a commit Maxime Ripard
2026-09-09  6:30   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 03/11] drm/atomic: Create function to insert plane " Maxime Ripard
2026-09-09  6:34   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 04/11] drm/atomic: Create function to insert colorop " Maxime Ripard
2026-09-09  6:35   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 05/11] drm/atomic: Create function to insert private obj " Maxime Ripard
2026-09-09  6:46   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 06/11] drm/atomic: Create function to insert connector " Maxime Ripard
2026-09-09  6:52   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 07/11] drm/atomic: Add drm_atomic_can_create_state() helper Maxime Ripard
2026-09-09  6:58   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 08/11] drm/atomic: Allow filling a commit with pristine object states Maxime Ripard
2026-09-09  7:11   ` Thomas Zimmermann
2026-09-08 14:35 ` [PATCH v3 09/11] drm/atomic-uapi: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-09-09  7:13   ` Thomas Zimmermann
2026-09-09  7:24   ` Thomas Zimmermann
2026-09-09  8:22     ` Maxime Ripard
2026-09-08 14:35 ` [PATCH v3 10/11] drm/vkms: Switch container_of helpers to container_of_const Maxime Ripard
2026-09-08 14:35 ` [PATCH v3 11/11] drm/vkms: Add driver-specific plane property for testing Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b3ff8c0-09b4-48fd-9965-9df70d19778c@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=contact@emersion.fr \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jadahl@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mdaenzer@redhat.com \
    --cc=mripard@kernel.org \
    --cc=pekka.paalanen@collabora.com \
    --cc=sebastian.wick@redhat.com \
    --cc=simona@ffwll.ch \
    --cc=victoria@system76.com \
    --cc=xaver.hugl@kde.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.