All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RFC 7/9] drm/panel: add atomic variants of the enable and disable callbacks
Date: Thu, 08 Oct 2026 13:27:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-164210@kernel.org> (raw)
In-Reply-To: <20261008-panel-atomic-state-v1-7-b157fddb8de1@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm: backlight_disable error prevents panel->enabled = false update
--

commit 00631cfc33b867ee09e15a877b7d601e80307028
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drm/panel: add atomic variants of the enable and disable callbacks

This commit introduces atomic variants of panel prepare, enable, disable, and
unprepare callbacks. These new callbacks receive the atomic commit state,
allowing panels tracking configuration via atomic state to program themselves
appropriately.

> diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> index ed0d16e04eaec..a2cd043fe1467 100644
> --- a/drivers/gpu/drm/drm_panel.c
> +++ b/drivers/gpu/drm/drm_panel.c

[ ... ]

> +static void drm_panel_atomic_disable(struct drm_panel *panel,
> +				     struct drm_atomic_commit *commit)
> +{
> +	const struct drm_panel_funcs *funcs = panel->funcs;
> +	int ret = 0;
> +
> +	if (!panel->enabled) {
> +		dev_warn(panel->dev, "Skipping disable of already disabled panel\n");
> +		return;
> +	}
> +
> +	guard(mutex)(&panel->follower_lock);
> +
> +	drm_panel_followers_disabling(panel);
> +
> +	ret = backlight_disable(panel->backlight);
> +	if (ret < 0)
> +		DRM_DEV_INFO(panel->dev, "failed to disable backlight: %d\n",
> +			     ret);
> +
> +	if (funcs->atomic_disable)
> +		ret = funcs->atomic_disable(panel, commit);
> +	else if (funcs->disable)
> +		ret = funcs->disable(panel);
> +	if (ret < 0)
> +		return;

[Severity: High]
Does an error in backlight_disable() prevent the panel from being marked as
disabled when the disable callbacks are missing?

Since both funcs->atomic_disable and funcs->disable are optional callbacks,
many drivers omit them. In that case, the if/else if block is skipped, and
ret retains the negative value returned by backlight_disable(). 

The subsequent if (ret < 0) condition then evaluates to true, triggering an
early return that skips setting panel->enabled = false.

Because the state remains panel->enabled = true, future calls to
drm_panel_atomic_enable() will immediately return without turning the screen
back on, leaving the display permanently off.

> +	panel->enabled = false;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261008-panel-atomic-state-v1-0-b157fddb8de1@oss.qualcomm.com?part=7

  reply	other threads:[~2026-10-08 13:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 13:14 [PATCH RFC 0/9] drm/panel: add atomic state Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 1/9] drm/bridge: terminate the lines of the bridge state dump Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 2/9] drm/bridge: add atomic_print_state callback Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 3/9] drm/bridge: drop the bridge pointer from drm_bridge_state Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 4/9] drm/panel: add atomic state Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 5/9] drm/panel: add atomic_check callback Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 6/9] drm/panel: factor out the panel follower notifications Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 7/9] drm/panel: add atomic variants of the enable and disable callbacks Dmitry Baryshkov
2026-10-08 13:27   ` sashiko-bot [this message]
2026-10-08 13:14 ` [PATCH RFC 8/9] drm/panel: add atomic_print_state callback Dmitry Baryshkov
2026-10-08 13:14 ` [PATCH RFC 9/9] drm/panel: novatek-nt35950: use the atomic state to select the mode Dmitry Baryshkov
2026-10-08 13:35   ` sashiko-bot
2026-10-13 12:51   ` Neil Armstrong
2026-10-11 20:43 ` [PATCH RFC 0/9] drm/panel: add atomic state Val Packett
2026-10-12  6:40 ` Maxime Ripard
2026-10-13  7:51   ` Dmitry Baryshkov
2026-10-13  8:37     ` Maxime Ripard
2026-10-13 11:57       ` Dmitry Baryshkov
2026-10-13 13:47         ` Luca Ceresoli

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=sashiko-outbox-164210@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.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 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.