From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v2 56/61] drm/sun4i: layer: Convert to atomic_create_state
Date: Fri, 14 Aug 2026 15:28:49 +0000 [thread overview]
Message-ID: <20260814152849.D8AC61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814-drm-no-more-plane-reset-v2-56-82d2963dd134@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `.atomic_create_state` hook (`sun4i_backend_layer_create_state`) illegally retains state destruction logic, violating the factory function API contract.
--
--- Patch [56]: [PATCH v2 56/61] drm/sun4i: layer: Convert to atomic_create_state ---
commit ff1555af002cdd0794b6aa7ae72c66565fbe6fdd
Author: Maxime Ripard <mripard@kernel.org>
drm/sun4i: layer: Convert to atomic_create_state
This commit converts the plane reset implementation to use
atomic_create_state. The existing implementation creates a custom state
subclass but only initializes a pristine state without resetting any
hardware, which matches the expected behavior of atomic_create_state.
> diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
> index d65587d96d9ee..b165960ca8e5d 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_layer.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
> @@ -16,7 +16,7 @@
> #include "sun4i_layer.h"
> #include "sunxi_engine.h"
>
> -static void sun4i_backend_layer_reset(struct drm_plane *plane)
> +static struct drm_plane_state *sun4i_backend_layer_create_state(struct drm_plane *plane)
> {
> struct sun4i_layer_state *state;
>
> if (plane->state) {
> state = state_to_sun4i_layer_state(plane->state);
>
> __drm_atomic_helper_plane_destroy_state(&state->state);
>
> kfree(state);
> plane->state = NULL;
> }
[Severity: Medium]
Should this state destruction logic be removed since this function is now
an atomic_create_state hook?
The atomic_create_state factory function API contract expects only
allocation and initialization of a new state object. Although the DRM core
guarantees plane->state is NULL before invoking this hook (making this
block functionally dead code), it appears the Coccinelle semantic patch
may have missed removing this destruction block during the conversion.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260814-drm-no-more-plane-reset-v2-0-82d2963dd134@kernel.org?part=56
prev parent reply other threads:[~2026-08-14 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 14:56 [PATCH v2 00/61] drm/plane: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 32/61] drm/sun4i: sun8i: Convert to atomic_create_state Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 56/61] drm/sun4i: layer: " Maxime Ripard
2026-08-14 15:28 ` sashiko-bot [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=20260814152849.D8AC61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mripard@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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