All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: Re: [PATCH] drm/atomic-helper: Simplify commit tracking locking
Date: Wed, 21 Jun 2017 10:30:51 -0400	[thread overview]
Message-ID: <20170621143051.ft7a6467if6iiy64@art_vandelay> (raw)
In-Reply-To: <20170621091627.30837-1-daniel.vetter@ffwll.ch>

On Wed, Jun 21, 2017 at 11:16:27AM +0200, Daniel Vetter wrote:
> The crtc->commit_lock only protects commit_list and commit_entry. If
> we chase the pointer from the drm_atomic_state update structure, then
> we don't need any locks (since we hold a reference already).
> 
> Simplify the locking accordingly.
> 
> Noticed while reviewing a patch from Boris.
> 
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

After reading this over a few times, I've convinced myself that it does
the right thing.

Reviewed-by: Sean Paul <seanpaul@chromium.org>


> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 86d3093c6c9b..9bf86eb87fe1 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1680,9 +1680,7 @@ void drm_atomic_helper_commit_hw_done(struct drm_atomic_state *old_state)
>  
>  		/* backend must have consumed any event by now */
>  		WARN_ON(new_crtc_state->event);
> -		spin_lock(&crtc->commit_lock);
>  		complete_all(&commit->hw_done);
> -		spin_unlock(&crtc->commit_lock);
>  	}
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_commit_hw_done);
> @@ -1711,7 +1709,6 @@ void drm_atomic_helper_commit_cleanup_done(struct drm_atomic_state *old_state)
>  		if (WARN_ON(!commit))
>  			continue;
>  
> -		spin_lock(&crtc->commit_lock);
>  		complete_all(&commit->cleanup_done);
>  		WARN_ON(!try_wait_for_completion(&commit->hw_done));
>  
> @@ -1721,8 +1718,6 @@ void drm_atomic_helper_commit_cleanup_done(struct drm_atomic_state *old_state)
>  		if (try_wait_for_completion(&commit->flip_done))
>  			goto del_commit;
>  
> -		spin_unlock(&crtc->commit_lock);
> -
>  		/* We must wait for the vblank event to signal our completion
>  		 * before releasing our reference, since the vblank work does
>  		 * not hold a reference of its own. */
> @@ -1732,8 +1727,8 @@ void drm_atomic_helper_commit_cleanup_done(struct drm_atomic_state *old_state)
>  			DRM_ERROR("[CRTC:%d:%s] flip_done timed out\n",
>  				  crtc->base.id, crtc->name);
>  
> -		spin_lock(&crtc->commit_lock);
>  del_commit:
> +		spin_lock(&crtc->commit_lock);
>  		list_del(&commit->commit_entry);
>  		spin_unlock(&crtc->commit_lock);
>  	}
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-06-21 14:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21  9:16 [PATCH] drm/atomic-helper: Simplify commit tracking locking Daniel Vetter
2017-06-21 11:30 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-21 14:30 ` Sean Paul [this message]
2017-06-27 12:03   ` [PATCH] " Daniel Vetter

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=20170621143051.ft7a6467if6iiy64@art_vandelay \
    --to=seanpaul@chromium.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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.