All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Chen-Yu Tsai <wenst@chromium.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/sysfb: Use iosys_map_memset() to clear buffer
Date: Thu, 3 Sep 2026 08:51:54 +0200	[thread overview]
Message-ID: <ff097a74-c963-4407-b8d6-df36ec4f4f43@suse.de> (raw)
In-Reply-To: <20260903060651.3724163-1-wenst@chromium.org>

Hi

Am 03.09.26 um 08:06 schrieb Chen-Yu Tsai:
> The atomic disable in drm/sysfb currently clears the buffer using
> memset_io(). Since the mapping is provided in a |struct iosys_map|,
> it is better to use the related API instead of extracting the vaddr.
> This is mentioned as a TODO item.
>
> Switch to iosys_map_memset(), which takes the mapping as well as an
> offset into the mapping.
>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> ---
>   drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
> index d2de29caf89e..99b13af4e391 100644
> --- a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
> +++ b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
> @@ -375,13 +375,11 @@ void drm_sysfb_plane_helper_atomic_disable(struct drm_plane *plane,

There's a newer version of this function in the drm-misc-next branch. 
Please rebase your patch onto this code.

Best regards
Thomas

>   {
>   	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, i, offset;
>   	int idx;
>   
>   	drm_rect_init(&dst_clip,
> @@ -395,11 +393,10 @@ void drm_sysfb_plane_helper_atomic_disable(struct drm_plane *plane,
>   		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]);
> -		dst_vmap += dst_pitch;
> -	}
> +	offset = drm_fb_clip_offset(dst_pitch, dst_format, &dst_clip);
> +	for (i = 0; i < lines; ++i)
> +		iosys_map_memset(&sysfb->fb_addr, offset + dst_pitch * i, 0,
> +				 linepixels * dst_format->cpp[0]);
>   
>   	drm_dev_exit(idx);
>   }

-- 
--
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)



      parent reply	other threads:[~2026-09-03  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  6:06 [PATCH 1/2] drm/sysfb: Use iosys_map_memset() to clear buffer Chen-Yu Tsai
2026-09-03  6:06 ` [PATCH 2/2] drm/sysfb: Use drm_format_info_min_pitch() to calculate line clear length Chen-Yu Tsai
2026-09-03  6:17   ` sashiko-bot
2026-09-03  6:15 ` [PATCH 1/2] drm/sysfb: Use iosys_map_memset() to clear buffer sashiko-bot
2026-09-03  6:51 ` 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=ff097a74-c963-4407-b8d6-df36ec4f4f43@suse.de \
    --to=tzimmermann@suse.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=wenst@chromium.org \
    /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.