Re: [PATCH 4/5] drm/fb-helper: Clip damage area to written memory range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/6/22 20:29, Thomas Zimmermann wrote:
> Write helpers used to mark the complete screen as dirty. This is
> wasteful for writes that only change a small portion of the screen.
> Fix the problem by computing the damaged area from the written
> memory range and perform damage handling accordingly.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
> ---

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

>  drivers/gpu/drm/drm_fb_helper.c | 28 +++++++++++++++++++++-------
>  1 file changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index ae98990c7b66..bed58be1b205 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -754,11 +754,18 @@ EXPORT_SYMBOL(drm_fb_helper_sys_read);
>  ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
>  				size_t count, loff_t *ppos)
>  {
> +	loff_t pos = *ppos;
>  	ssize_t ret;
> +	struct drm_rect damage_area;
>  
>  	ret = fb_sys_write(info, buf, count, ppos);
> -	if (ret > 0)
> -		drm_fb_helper_damage(info, 0, 0, info->var.xres, info->var.yres);
> +	if (ret <= 0)
> +		return ret;
> +

I also like how you cleaned up the error checking here and below
to just return early, instead of checking if ret > 0 to perform
the damage handling.

Best regards,
-- 
Javier Martinez Canillas
Linux Engineering
Red Hat




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux