dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Angelo Compagnucci" <angelo.compagnucci@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/fbdev-dma: Copy the shadow buffer on unblank
Date: Mon, 16 Nov 2026 09:11:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-216593@kernel.org> (raw)
In-Reply-To: <20261114201351.2788719-1-angelo.compagnucci@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/fbdev-dma: unaddressed v2 review on
  drm_fbdev_dma_shadowed_fb_blank()
--

commit 7dc07a1feeaa7bfcabe7b06bf9f13b3b3f41fd0e
Author: Angelo Compagnucci <angelo.compagnucci@gmail.com>

drm/fbdev-dma: Copy the shadow buffer on unblank

This commit adds a custom .fb_blank callback for shadowed fbdev-dma
framebuffers that copies the shadow buffer into the GEM DMA buffer on
FB_BLANK_UNBLANK before calling drm_fb_helper_blank().

> diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
> index 452f844003504..3effc5c05d9ce 100644
> --- a/drivers/gpu/drm/drm_fbdev_dma.c
> +++ b/drivers/gpu/drm/drm_fbdev_dma.c

[ ... ]

> @@ -196,6 +187,45 @@ static const struct drm_fb_helper_funcs drm_fbdev_dma_helper_funcs = {
>   * struct drm_fb_helper
>   */
>  
> +static int drm_fbdev_dma_shadowed_fb_blank(int blank, struct fb_info *info)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +	struct drm_clip_rect clip = {
> +		.x2 = fb_helper->fb->width,
> +		.y2 = fb_helper->fb->height,
> +	};
> +
> +	/*
> +	 * Turning the display on shows the framebuffer memory. Copy the
> +	 * shadow buffer into it first, so it holds what was drawn. This
> +	 * does not need the display; the damage worker still flushes the
> +	 * damage once the display is on.
> +	 *
> +	 * The copy takes a mutex, so skip it during an oops, where the
> +	 * console is unblanked in atomic context. drm_fb_helper_blank()
> +	 * does nothing then.
> +	 */
> +	if (blank == FB_BLANK_UNBLANK && !oops_in_progress)
> +		drm_fbdev_dma_damage_blit(fb_helper, &clip);
> +
> +	return drm_fb_helper_blank(blank, info);
> +}

[Severity: Medium]
As reported by Thomas Zimmermann on v2 [1], does this comment and the
commit message accurately describe how unblanking and damage flushing
interact here?

In v2, Thomas Zimmermann noted in response to the v1 -> v2 changelog entry
that some hardware and drivers require the CRTC to be enabled before
display data can be transferred (as in drm_atomic_helper_commit_tail_rpm()),
and asked what problem this change is trying to solve.

In addition, on MIPI DBI drivers such as ili9341,
drm_fb_helper_blank(FB_BLANK_UNBLANK) -> drm_fb_helper_dpms() ->
drm_client_modeset_commit_atomic() enables the CRTC and immediately
commits the active planes with full-frame damage, which transfers the GEM
DMA buffer to the panel during drm_fb_helper_blank() itself rather than
waiting for the damage worker. If FB_BLANK_UNBLANK is called while
deferred I/O work is still pending, drm_fbdev_dma_shadowed_fb_blank()
copies the shadow buffer and the modeset flushes the full frame to the
panel, and then drm_fb_helper_damage_work() runs afterward and copies and
flushes the damaged area a second time.

[1] https://lore.kernel.org/r/556dd1ab-a1af-4c8b-be6e-04382ed0b958@suse.de

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261114201351.2788719-1-angelo.compagnucci@gmail.com?part=1

  reply	other threads:[~2026-11-16  9:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:16 [PATCH] drm/fb-helper: flush damage before unblanking Angelo Compagnucci
2026-11-13  9:03 ` Thomas Zimmermann
2026-11-13 11:07 ` [PATCH v2] drm/fbdev-dma: Copy the shadow buffer on unblank Angelo Compagnucci
2026-11-14 16:38   ` sashiko-bot
2026-11-14 20:13   ` [PATCH v3] " Angelo Compagnucci
2026-11-16  9:11     ` sashiko-bot [this message]
2026-11-16  7:48   ` [PATCH v2] " Thomas Zimmermann

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-216593@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=angelo.compagnucci@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox