All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, freedreno@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 07/12] drm/msm: Handle drm_atomic_helper_swap_state failure
Date: Fri, 14 Jul 2017 17:02:15 +0200	[thread overview]
Message-ID: <20170714150215.sghkd4bagx4nqwzm@phenom.ffwll.local> (raw)
In-Reply-To: <20170711143314.2148-8-maarten.lankhorst@linux.intel.com>

On Tue, Jul 11, 2017 at 04:33:09PM +0200, Maarten Lankhorst wrote:
> drm_atomic_helper_swap_state() will be changed to interruptible waiting
> in the next few commits, so all drivers have to be changed to handling
> failure.
> 
> MSM has its own busy tracking, which means the swap_state call can be
> done with stall = false, in which case it should never return an error.
> Handle failure with BUG_ON for this reason.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> ---
>  drivers/gpu/drm/msm/msm_atomic.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
> index 9633a68b14d7..badfa8717317 100644
> --- a/drivers/gpu/drm/msm/msm_atomic.c
> +++ b/drivers/gpu/drm/msm/msm_atomic.c
> @@ -232,20 +232,18 @@ int msm_atomic_commit(struct drm_device *dev,
>  	 * mark our set of crtc's as busy:
>  	 */
>  	ret = start_atomic(dev->dev_private, c->crtc_mask);
> -	if (ret) {
> -		kfree(c);
> -		goto error;
> -	}
> +	if (ret)
> +		goto err_free;
> +
> +	BUG_ON(drm_atomic_helper_swap_state(state, false) < 0);

Hm, not sure we want to do this, makes switching msm to the nonblocking
helpers a bit more tricky. And the got err_free thing looks like leftovers
from an old version. But it's all correct.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

>  
>  	/*
>  	 * This is the point of no return - everything below never fails except
>  	 * when the hw goes bonghits. Which means we can commit the new state on
>  	 * the software side now.
> +	 *
> +	 * swap driver private state while still holding state_lock
>  	 */
> -
> -	drm_atomic_helper_swap_state(state, true);
> -
> -	/* swap driver private state while still holding state_lock */
>  	if (to_kms_state(state)->state)
>  		priv->kms->funcs->swap_state(priv->kms, state);
>  
> @@ -275,6 +273,8 @@ int msm_atomic_commit(struct drm_device *dev,
>  
>  	return 0;
>  
> +err_free:
> +	kfree(c);
>  error:
>  	drm_atomic_helper_cleanup_planes(dev, state);
>  	return ret;
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2017-07-14 15:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 14:33 [PATCH v2 00/12] drm/atomic: Make drm_atomic_helper_swap_state waiting interruptible Maarten Lankhorst
2017-07-11 14:33 ` [PATCH v2 01/12] drm/nouveau: Fix error handling in nv50_disp_atomic_commit Maarten Lankhorst
2017-07-14 14:28   ` [Intel-gfx] " Daniel Vetter
2017-07-11 14:33 ` [PATCH v2 02/12] drm/atomic: Change drm_atomic_helper_swap_state to return an error Maarten Lankhorst
2017-07-11 14:33   ` Maarten Lankhorst
2017-07-14 14:30   ` [Intel-gfx] " Daniel Vetter
2017-07-14 14:55     ` Sean Paul
2017-07-11 14:33 ` [PATCH v2 04/12] drm/atmel-hlcdc: Handle drm_atomic_helper_swap_state failure Maarten Lankhorst
2017-07-11 14:33 ` [PATCH v2 05/12] drm/i915: " Maarten Lankhorst
2017-07-11 14:33 ` [PATCH v2 06/12] drm/mediatek: " Maarten Lankhorst
2017-07-11 14:33   ` Maarten Lankhorst
2017-07-12 10:00   ` Philipp Zabel
2017-07-12 10:00     ` Philipp Zabel
     [not found] ` <20170711143314.2148-1-maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-11 14:33   ` [PATCH v2 03/12] drm/nouveau: " Maarten Lankhorst
2017-07-11 14:33   ` [PATCH v2 07/12] drm/msm: " Maarten Lankhorst
2017-07-14 15:02     ` Daniel Vetter [this message]
2017-07-11 14:33   ` [PATCH v2 08/12] drm/tegra: " Maarten Lankhorst
     [not found]     ` <20170711143314.2148-9-maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-14 15:03       ` [Intel-gfx] " Daniel Vetter
2017-07-11 14:33 ` [PATCH v2 09/12] drm/tilcdc: " Maarten Lankhorst
2017-07-27  7:49   ` Jyri Sarha
2017-07-27 10:25     ` Maarten Lankhorst
2017-07-11 14:33 ` [PATCH v2 10/12] drm/vc4: " Maarten Lankhorst
2017-07-14 15:04   ` [Intel-gfx] " Daniel Vetter
2017-07-11 14:33 ` [PATCH v2 11/12] drm/atomic: Add __must_check to drm_atomic_helper_swap_state Maarten Lankhorst
2017-07-14 15:05   ` Daniel Vetter
2017-07-11 14:33 ` [PATCH v2 12/12] drm/atomic: Allow drm_atomic_helper_swap_state to fail Maarten Lankhorst
2017-07-14 15:06   ` [Intel-gfx] " Daniel Vetter
2017-07-11 15:11 ` ✗ Fi.CI.BAT: warning for drm/atomic: Make drm_atomic_helper_swap_state waiting interruptible Patchwork
2017-07-14 15:01 ` [PATCH v2 00/12] " Sean Paul
2017-07-19 10:10   ` Maarten Lankhorst

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=20170714150215.sghkd4bagx4nqwzm@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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.