From: Thomas Zimmermann <tzimmermann@suse.de>
To: oushixiong1025@163.com
Cc: Javier Martinez Canillas <javierm@redhat.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Shixiong Ou <oushixiong@kylinos.cn>
Subject: Re: [PATCH] drm/sysfb: Clear entire framebuffer in atomic_disable
Date: Wed, 26 Aug 2026 11:02:32 +0200 [thread overview]
Message-ID: <4489d462-28f6-4acf-87a0-0a0bdb6a8ccd@suse.de> (raw)
In-Reply-To: <20260826075613.483617-1-oushixiong1025@163.com>
Hi
Am 26.08.26 um 09:56 schrieb oushixiong1025@163.com:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> drm_sysfb_plane_helper_atomic_disable() previously used
> plane_state->src_* coordinates to construct the clear rectangle,
> which depends on user-controlled input. Instead, clear the entire
> visible framebuffer region using fb_mode dimensions, and use
> drm_format_info_min_pitch() to compute the safe per-line clear size
> without touching non-visible bytes at the end of each line.
>
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
Thank you for implementing the idea. This looks good AFAICT
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
> index 9a4c210d6f96..c109ecab9d7a 100644
> --- a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
> +++ b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
> @@ -376,28 +376,28 @@ void drm_sysfb_plane_helper_atomic_disable(struct drm_plane *plane,
> struct drm_device *dev = plane->dev;
> struct drm_sysfb_device *sysfb = to_drm_sysfb_device(dev);
> struct iosys_map dst = sysfb->fb_addr;
> - struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> void __iomem *dst_vmap = dst.vaddr_iomem; /* TODO: Use mapping abstraction */
> unsigned int dst_pitch = sysfb->fb_pitch;
> const struct drm_format_info *dst_format = sysfb->fb_format;
> struct drm_rect dst_clip;
> - unsigned long lines, linepixels, i;
> + unsigned long lines, linepixels, dst_size, i;
> int idx;
>
> - drm_rect_init(&dst_clip,
> - plane_state->src_x >> 16, plane_state->src_y >> 16,
> - plane_state->src_w >> 16, plane_state->src_h >> 16);
> + drm_rect_init(&dst_clip, 0, 0,
> + sysfb->fb_mode.hdisplay, sysfb->fb_mode.vdisplay);
>
> lines = drm_rect_height(&dst_clip);
> linepixels = drm_rect_width(&dst_clip);
> + dst_size = min_t(unsigned long,
> + drm_format_info_min_pitch(dst_format, 0, linepixels),
> + dst_pitch);
>
> if (!drm_dev_enter(dev, &idx))
> return;
>
> /* Clear buffer to black if disabled */
> - dst_vmap += drm_fb_clip_offset(dst_pitch, dst_format, &dst_clip);
> for (i = 0; i < lines; ++i) {
> - memset_io(dst_vmap, 0, linepixels * dst_format->cpp[0]);
> + memset_io(dst_vmap, 0, dst_size);
> dst_vmap += dst_pitch;
> }
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
prev parent reply other threads:[~2026-08-26 9:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 7:56 oushixiong1025
2026-08-26 9:02 ` Thomas Zimmermann [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=4489d462-28f6-4acf-87a0-0a0bdb6a8ccd@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oushixiong1025@163.com \
--cc=oushixiong@kylinos.cn \
--cc=simona@ffwll.ch \
/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
all inboxes | Powered by JetHome®