From: Mikko Perttunen <mperttunen@nvidia.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Maxime Ripard <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org,
Maxime Ripard <mripard@kernel.org>,
jonathanh@nvidia.com, linux-tegra@vger.kernel.org,
thierry.reding@kernel.org
Subject: Re: [PATCH 59/60] drm/tegra: Convert to atomic_create_state
Date: Wed, 15 Jul 2026 16:25:48 +0900 [thread overview]
Message-ID: <Y7bDDzPZSAm-SByysuBRXw@nvidia.com> (raw)
In-Reply-To: <20260709-drm-no-more-plane-reset-v1-59-302d986fe5f0@kernel.org>
On Thursday, July 9, 2026 8:51 PM Maxime Ripard wrote:
> The plane reset implementation creates a custom state subclass, but
> only initializes a pristine state without resetting any hardware. This
> is equivalent to what atomic_create_state expects. Convert to it.
>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
> Cc: jonathanh@nvidia.com
> Cc: linux-tegra@vger.kernel.org
> Cc: mperttunen@nvidia.com
> Cc: thierry.reding@kernel.org
> ---
> drivers/gpu/drm/tegra/plane.c | 28 ++++++++++++----------------
> 1 file changed, 12 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
> index 0cb30910773f..2148b0c59815 100644
> --- a/drivers/gpu/drm/tegra/plane.c
> +++ b/drivers/gpu/drm/tegra/plane.c
> @@ -22,32 +22,28 @@ static void tegra_plane_destroy(struct drm_plane *plane)
>
> drm_plane_cleanup(plane);
> kfree(p);
> }
>
> -static void tegra_plane_reset(struct drm_plane *plane)
> +static struct drm_plane_state *tegra_plane_atomic_create_state(struct drm_plane *plane)
> {
> struct tegra_plane *p = to_tegra_plane(plane);
> struct tegra_plane_state *state;
> unsigned int i;
>
> - if (plane->state)
> - __drm_atomic_helper_plane_destroy_state(plane->state);
> -
> - kfree(plane->state);
> - plane->state = NULL;
> -
> state = kzalloc_obj(*state);
> - if (state) {
> - plane->state = &state->base;
> - plane->state->plane = plane;
> - plane->state->zpos = p->index;
> - plane->state->normalized_zpos = p->index;
> + if (!state)
> + return ERR_PTR(-ENOMEM);
>
> - for (i = 0; i < 3; i++)
> - state->iova[i] = DMA_MAPPING_ERROR;
> - }
> + state->base.plane = plane;
> + state->base.zpos = p->index;
> + state->base.normalized_zpos = p->index;
> +
> + for (i = 0; i < 3; i++)
> + state->iova[i] = DMA_MAPPING_ERROR;
> +
> + return &state->base;
> }
>
> static struct drm_plane_state *
> tegra_plane_atomic_duplicate_state(struct drm_plane *plane)
> {
> @@ -129,11 +125,11 @@ static bool tegra_plane_format_mod_supported(struct drm_plane *plane,
>
> const struct drm_plane_funcs tegra_plane_funcs = {
> .update_plane = drm_atomic_helper_update_plane,
> .disable_plane = drm_atomic_helper_disable_plane,
> .destroy = tegra_plane_destroy,
> - .reset = tegra_plane_reset,
> + .atomic_create_state = tegra_plane_atomic_create_state,
> .atomic_duplicate_state = tegra_plane_atomic_duplicate_state,
> .atomic_destroy_state = tegra_plane_atomic_destroy_state,
> .format_mod_supported = tegra_plane_format_mod_supported,
> };
>
>
> --
> 2.54.0
>
>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
prev parent reply other threads:[~2026-07-15 7:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 11:50 [PATCH 00/60] drm/plane: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-07-09 11:51 ` [PATCH 59/60] drm/tegra: Convert to atomic_create_state Maxime Ripard
2026-07-15 7:25 ` Mikko Perttunen [this message]
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=Y7bDDzPZSAm-SByysuBRXw@nvidia.com \
--to=mperttunen@nvidia.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=linux-tegra@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=thierry.reding@kernel.org \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox