From: sashiko-bot@kernel.org
To: "Devarsh Thakkar" <devarsht@ti.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 08/14] drm/solomon: ssd16xx: Expose refresh mode as plane property
Date: Sun, 27 Sep 2026 18:43:53 +0000 [thread overview]
Message-ID: <20260927184354.4A23E1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260927182329.4193961-9-devarsht@ti.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] drm/ssd16xx: hardware desync when refresh_mode is updated on disabled plane
- [High] drm/ssd16xx: double vunmap risk due to kmemdup of shadow plane state
- [Low] drm/ssd16xx: build failure due to undefined __drm_gem_shadow_plane_state_init
--
commit f164596b389c43d5ba1998c30d9e04e66112e4d1
Author: Devarsh Thakkar <devarsht@ti.com>
drm/solomon: ssd16xx: Expose refresh mode as plane property
This commit adds a DRM plane property "refresh_mode" to allow userspace
to select between partial, full, and fast display update modes at runtime.
It uses an enum to match the internal refresh modes and updates the
default setting from the panel configuration.
> diff --git a/drivers/gpu/drm/solomon/ssd16xx.c b/drivers/gpu/drm/solomon/ssd16xx.c
> index 6255f434248ae..dc2b8fe536af3 100644
> --- a/drivers/gpu/drm/solomon/ssd16xx.c
> +++ b/drivers/gpu/drm/solomon/ssd16xx.c
[ ... ]
> @@ -1397,11 +1409,91 @@ static void ssd16xx_plane_destroy(struct drm_plane *plane)
> drm_plane_cleanup(plane);
> }
>
> +static void ssd16xx_plane_atomic_destroy_state(struct drm_plane *plane,
> + struct drm_plane_state *state);
> +
> +static struct drm_plane_state *ssd16xx_plane_atomic_create_state(struct drm_plane *plane)
> +{
> + struct ssd16xx_device *device = plane_to_ssd16xx_device(plane);
> + struct ssd16xx_plane_state *ssd_state;
> +
> + ssd_state = kzalloc(sizeof(*ssd_state), GFP_KERNEL);
> + if (!ssd_state)
> + return ERR_PTR(-ENOMEM);
> +
> + __drm_gem_shadow_plane_state_init(plane, &ssd_state->base);
[Severity: Low]
Does this cause a build failure? It appears __drm_gem_shadow_plane_state_init()
is not defined anywhere in the kernel.
If the module were somehow compiled, would failing to initialize the base
plane state leave plane_state->plane as NULL and cause a NULL pointer
dereference in the core DRM atomic helpers?
> + ssd_state->refresh_mode = device->refresh_mode;
> +
> + return &ssd_state->base.base;
> +}
> +
> +static struct drm_plane_state *
> +ssd16xx_plane_atomic_duplicate_state(struct drm_plane *plane)
> +{
> + struct ssd16xx_plane_state *old_ssd_state, *ssd_state;
> +
> + if (WARN_ON(!plane->state))
> + return NULL;
> +
> + old_ssd_state = to_ssd16xx_plane_state(plane->state);
> + ssd_state = kmemdup(old_ssd_state, sizeof(*ssd_state), GFP_KERNEL);
[Severity: High]
Does this kmemdup() risk a double free or double unmap of the shadow plane
state?
The struct drm_shadow_plane_state contains map and data arrays which track
active kernel memory mappings of the framebuffer. These are explicitly
documented as "Transitional state - do not export or duplicate".
If the new state encounters an error before drm_gem_begin_shadow_fb_access()
overwrites them, won't the error cleanup paths unmap those stale pointers,
resulting in a double vunmap of the old state's memory?
> + if (!ssd_state)
> + return NULL;
> +
> + __drm_gem_duplicate_shadow_plane_state(plane, &ssd_state->base);
> + return &ssd_state->base.base;
> +}
[ ... ]
> @@ -1456,6 +1550,25 @@ static void ssd16xx_plane_atomic_update(struct drm_plane *plane,
>
> drm_dbg(&device->drm, "plane_atomic_update: calling fb_dirty rect=(%d,%d)-(%d,%d)\n",
> rect.x1, rect.y1, rect.x2, rect.y2);
> +
> + /* Diff refresh_mode against the plane's own previous state to see
> + * whether fast LUT preload is needed.
> + */
> + if (old_ssd->refresh_mode != new_ssd->refresh_mode) {
> + /*
> + * Fast refresh omits LOAD_LUT each update; arm the
> + * one-shot flag so LUT is pre-loaded before the first
> + * fast frame.
> + */
> + if (new_ssd->refresh_mode == SSD16XX_REFRESH_FAST &&
> + old_ssd->refresh_mode != SSD16XX_REFRESH_FULL)
> + device->fast_lut_pending = true;
> + else
> + device->fast_lut_pending = false;
> + }
> +
> + device->refresh_mode = new_ssd->refresh_mode;
[Severity: High]
Can this hardware configuration desynchronize from the software state, leading
to a missing LUT preload and corrupted display output?
Earlier in ssd16xx_plane_atomic_update(), there is an early return when the
plane is being disabled:
if (!fb)
return;
If a userspace atomic commit disables the plane while simultaneously changing
the refresh_mode property, won't this early return skip the state
synchronization here?
When the plane is later enabled, wouldn't pm_runtime_resume() call
ssd16xx_hw_init(), read the stale device->refresh_mode, and skip the required
FAST mode LUT preload?
> +
> /*
> * When refresh_mode_init was set, use the specified mode for this first
> * frame only, then restore the user-configured refresh_mode so
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260927182329.4193961-1-devarsht@ti.com?part=8
next prev parent reply other threads:[~2026-09-27 18:43 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 18:23 [PATCH v2 00/14] Add DRM driver for Solomon SSD16xx e-paper display controllers Devarsh Thakkar
2026-09-27 18:23 ` [PATCH v2 01/14] dt-bindings: vendor-prefixes: Add Dalian Good Display Co., Ltd Devarsh Thakkar
2026-09-27 18:23 ` [PATCH v2 02/14] dt-bindings: display: Add Solomon SSD16xx e-paper controller binding Devarsh Thakkar
2026-09-27 18:37 ` sashiko-bot
2026-10-01 6:28 ` Krzysztof Kozlowski
2026-10-05 16:36 ` Devarsh Thakkar
2026-09-27 18:23 ` [PATCH v2 03/14] dt-bindings: display: solomon,ssd16xx: Add Solomon SSD1677 controller Devarsh Thakkar
2026-09-27 18:35 ` sashiko-bot
2026-10-01 6:26 ` Krzysztof Kozlowski
2026-09-27 18:23 ` [PATCH v2 04/14] drm/solomon: Add DRM driver for Solomon SSD16xx e-paper display controllers Devarsh Thakkar
2026-09-27 18:42 ` sashiko-bot
2026-09-28 7:00 ` Thomas Zimmermann
2026-09-29 16:43 ` Devarsh Thakkar
2026-09-27 18:23 ` [PATCH v2 05/14] drm/solomon: ssd16xx: Add clear_on_init/close/disable session management Devarsh Thakkar
2026-09-27 18:38 ` sashiko-bot
2026-09-27 18:23 ` [PATCH v2 06/14] drm/solomon: ssd16xx: Add support for Solomon SSD1677 controller Devarsh Thakkar
2026-09-27 18:40 ` sashiko-bot
2026-09-27 18:23 ` [PATCH v2 07/14] drm/solomon: ssd16xx: Add power management support Devarsh Thakkar
2026-09-27 18:41 ` sashiko-bot
2026-09-27 18:23 ` [PATCH v2 08/14] drm/solomon: ssd16xx: Expose refresh mode as plane property Devarsh Thakkar
2026-09-27 18:43 ` sashiko-bot [this message]
2026-09-27 18:23 ` [PATCH v2 09/14] drm/solomon: ssd16xx: Expose color " Devarsh Thakkar
2026-09-27 18:43 ` sashiko-bot
2026-09-27 18:23 ` [PATCH v2 10/14] drm/solomon: ssd16xx: Expose session management as plane properties Devarsh Thakkar
2026-09-27 18:38 ` sashiko-bot
2026-09-27 18:23 ` [PATCH v2 11/14] drm/solomon: ssd16xx: support panels whose RAM X order is reversed Devarsh Thakkar
2026-09-27 18:23 ` [PATCH v2 12/14] MAINTAINERS: Add entry for Solomon SSD16xx DRM driver Devarsh Thakkar
2026-09-27 18:23 ` [PATCH v2 13/14] arm64: defconfig: Enable DRM_SSD16XX for AM62L3 EVM Devarsh Thakkar
2026-09-27 18:23 ` [DO_NOT_MERGE PATCH v2 14/14] arm64: dts: ti: Add AM62L3 EVM overlay for GDEY042T81 e-paper display Devarsh Thakkar
2026-09-27 18:40 ` sashiko-bot
2026-10-02 8:56 ` [PATCH v2 00/14] Add DRM driver for Solomon SSD16xx e-paper display controllers LiangCheng Wang
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=20260927184354.4A23E1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devarsht@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@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