All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Anush Veeranala" <j@gnu.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/fb-helper: Keep blanked outputs off across restore and hotplug
Date: Sat, 05 Dec 2026 16:53:18 +0000	[thread overview]
Message-ID: <sashiko-outbox-251748@kernel.org> (raw)
In-Reply-To: <87fqwbit6c.fsf@gnu.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/fb-helper: pan_display_atomic() ignores dpms_mode on
  blanked outputs
--

commit 5f90cefa3fd2f544582d71f06fa0e5cdcca4f8b5
Author: Anush Veeranala <j@gnu.org>

drm/fb-helper: Keep blanked outputs off across restore and hotplug

This commit records the last blank request's DPMS mode in struct
drm_fb_helper so that unforced restores and hotplug events on atomic
drivers keep blanked outputs off via drm_client_modeset_dpms().

> diff --git a/drivers/gpu/drm/clients/drm_fbdev_helper.c b/drivers/gpu/drm/clients/drm_fbdev_helper.c
> index 415764ee086a8..9b8fec3323089 100644
> --- a/drivers/gpu/drm/clients/drm_fbdev_helper.c
> +++ b/drivers/gpu/drm/clients/drm_fbdev_helper.c
> @@ -105,6 +105,22 @@ __drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper,
>  		 * racing here, see drm_fb_helper_set_par().
>  		 */
>  		ret = drm_client_modeset_commit_locked(&fb_helper->client);
> +		/*
> +		 * Forced restores light the outputs, blanked or not: fbcon
> +		 * forces one when switching back to text mode and then
> +		 * unblanks, and sysrq forces one to show the console. Later
> +		 * restores, such as the delayed hotplug's below, keep them on.
> +		 */
> +		fb_helper->dpms_mode = DRM_MODE_DPMS_ON;
> +	} else if (fb_helper->dpms_mode != DRM_MODE_DPMS_ON &&
> +		   drm_drv_uses_atomic_modeset(fb_helper->dev)) {
> +		/*
> +		 * Keep blanked outputs off. Legacy DPMS doesn't commit the
> +		 * configuration, so legacy drivers keep committing it with the
> +		 * outputs on.
> +		 */
> +		ret = drm_client_modeset_dpms(&fb_helper->client,
> +					      fb_helper->dpms_mode);
>  	} else {
>  		ret = drm_client_modeset_commit(&fb_helper->client);
>  	}

[Severity: Medium]
Should pan_display_atomic() also respect fb_helper->dpms_mode?

pan_display_atomic() calls drm_client_modeset_commit_locked(), which commits
with active=true on atomic drivers regardless of fb_helper->dpms_mode.  For
example, fb_set_var() calls fb_pan_display() right after
drm_fb_helper_set_par(), undoing the blanking preserved here.

That turns blanked outputs back on without notifying fbcon, leaving the
display lit indefinitely while fb_helper->dpms_mode stays out of sync with
the hardware state so a later unrelated restore or hotplug turns it off
again.

Committing with active set to fb_helper->dpms_mode == DRM_MODE_DPMS_ON in
pan_display_atomic() would keep the outputs and dpms_mode consistent.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/87fqwbit6c.fsf@gnu.org?part=1

      reply	other threads:[~2026-12-05 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 16:33 [PATCH v2] drm/fb-helper: Keep blanked outputs off across restore and hotplug Anush Veeranala
2026-12-05 16:53 ` 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=sashiko-outbox-251748@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j@gnu.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.