All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
	sam@ravnborg.org, christian.koenig@amd.com
Subject: Re: [PATCH 08/10] drm/fb-helper: Restore damage area upon errors
Date: Mon, 16 Nov 2020 21:52:16 +0100	[thread overview]
Message-ID: <20201116205216.GH401619@phenom.ffwll.local> (raw)
In-Reply-To: <20201116200437.17977-9-tzimmermann@suse.de>

On Mon, Nov 16, 2020 at 09:04:35PM +0100, Thomas Zimmermann wrote:
> If the damage handling fails, restore the damage area. The next invocation
> of the damage worker will then perform the update.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 2e1a335bafd2..13b65dad2ca8 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -431,11 +431,28 @@ static void drm_fb_helper_damage_work(struct work_struct *work)
>  	if (helper->buffer) {
>  		ret = drm_fb_helper_damage_blit(helper, &clip_copy);
>  		if (ret)
> -			return;
> +			goto err;
>  	}
>  
> -	if (helper->fb->funcs->dirty)
> -		helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, &clip_copy, 1);
> +	if (helper->fb->funcs->dirty) {
> +		ret = helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, &clip_copy, 1);
> +		if (ret)
> +			goto err;

I think this is unexpected enough that we should put some drm error
printing here I think.
-Daniel

> +	}
> +
> +	return;
> +
> +err:
> +	/*
> +	 * Restore damage clip rectangle on errors. Next instance of damage
> +	 * worker will perform the update.
> +	 */
> +	spin_lock_irqsave(&helper->damage_lock, flags);
> +	clip->x1 = min_t(u32, clip->x1, clip_copy.x1);
> +	clip->y1 = min_t(u32, clip->y1, clip_copy.y1);
> +	clip->x2 = max_t(u32, clip->x2, clip_copy.x2);
> +	clip->y2 = max_t(u32, clip->y2, clip_copy.y2);
> +	spin_unlock_irqrestore(&helper->damage_lock, flags);
>  }
>  
>  /**
> -- 
> 2.29.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-11-16 20:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 20:04 [PATCH 00/10] drm/fb-helper: Various fixes and cleanups Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 01/10] drm/fb-helper: Call dirty helper after writing to fbdev Thomas Zimmermann
2020-11-16 20:04   ` Thomas Zimmermann
2020-11-17 16:22   ` Ville Syrjälä
2020-11-17 16:22     ` Ville Syrjälä
2020-11-18  7:56     ` Thomas Zimmermann
2020-11-18  7:56       ` Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 02/10] drm/fb-helper: Unmap client buffer during shutdown Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 03/10] drm/client: Depend on GEM object kmap ref-counting Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 04/10] drm/fb-helper: Rename dirty worker to damage worker Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 05/10] drm/fb-helper: Return early in dirty worker Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 06/10] drm/fb-helper: Separate shadow-buffer flushing and calling dirty callback Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 07/10] drm/fb-helper: Move damage blit code and its setup into separate routine Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 08/10] drm/fb-helper: Restore damage area upon errors Thomas Zimmermann
2020-11-16 20:52   ` Daniel Vetter [this message]
2020-11-17 15:14     ` Sebastian Reichel
2020-11-17 16:54       ` Daniel Vetter
2020-11-16 20:04 ` [PATCH 09/10] drm/fb-helper: Copy dma-buf map before flushing shadow fb Thomas Zimmermann
2020-11-16 20:04 ` [PATCH 10/10] drm/fb-helper: Acquire modeset lock around shadow-buffer flushing Thomas Zimmermann
2020-11-16 20:48   ` Daniel Vetter
2020-11-17  8:05     ` Christian König

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=20201116205216.GH401619@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /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.