public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/tegra: Use drm_gem_object_reference_unlocked
Date: Wed, 21 Oct 2015 10:20:11 +0200	[thread overview]
Message-ID: <20151021082011.GP13786@phenom.ffwll.local> (raw)
In-Reply-To: <1445414791-20977-1-git-send-email-daniel.vetter@ffwll.ch>

On Wed, Oct 21, 2015 at 10:06:31AM +0200, Daniel Vetter wrote:
> This only grabs the mutex when really needed, but still has a
> might-acquire lockdep check to make sure that's always possible.
> With this patch tegra is officially struct_mutex free, yay!
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Please disregard this, wrong patch.
-Daniel

> ---
>  drivers/gpu/drm/tegra/drm.c | 4 +---
>  drivers/gpu/drm/tegra/gem.c | 8 ++------
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 159ef515cab1..5de9a4ead463 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -277,9 +277,7 @@ host1x_bo_lookup(struct drm_device *drm, struct drm_file *file, u32 handle)
>  	if (!gem)
>  		return NULL;
>  
> -	mutex_lock(&drm->struct_mutex);
> -	drm_gem_object_unreference(gem);
> -	mutex_unlock(&drm->struct_mutex);
> +	drm_gem_object_unreference_unlocked(gem);
>  
>  	bo = to_tegra_bo(gem);
>  	return &bo->base;
> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> index fb712316c522..1146fbe523d5 100644
> --- a/drivers/gpu/drm/tegra/gem.c
> +++ b/drivers/gpu/drm/tegra/gem.c
> @@ -30,9 +30,7 @@ static void tegra_bo_put(struct host1x_bo *bo)
>  	struct tegra_bo *obj = host1x_to_tegra_bo(bo);
>  	struct drm_device *drm = obj->gem.dev;
>  
> -	mutex_lock(&drm->struct_mutex);
> -	drm_gem_object_unreference(&obj->gem);
> -	mutex_unlock(&drm->struct_mutex);
> +	drm_gem_object_unreference_unlocked(&obj->gem);
>  }
>  
>  static dma_addr_t tegra_bo_pin(struct host1x_bo *bo, struct sg_table **sgt)
> @@ -74,9 +72,7 @@ static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo)
>  	struct tegra_bo *obj = host1x_to_tegra_bo(bo);
>  	struct drm_device *drm = obj->gem.dev;
>  
> -	mutex_lock(&drm->struct_mutex);
> -	drm_gem_object_reference(&obj->gem);
> -	mutex_unlock(&drm->struct_mutex);
> +	drm_gem_object_reference_unlocked(&obj->gem);
>  
>  	return bo;
>  }
> -- 
> 2.5.1
> 

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

  reply	other threads:[~2015-10-21  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-21  8:06 [PATCH] drm/tegra: Use drm_gem_object_reference_unlocked Daniel Vetter
2015-10-21  8:20 ` Daniel Vetter [this message]
2015-10-21 13:03 ` kbuild test robot

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=20151021082011.GP13786@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox