[PATCH] drm/prime: drop reference on imported dma-buf

Paul Menzel paulepanter at users.sourceforge.net
Mon Jul 23 23:17:30 PDT 2012


Dear Rob,


Am Montag, den 23.07.2012, 18:07 -0500 schrieb Rob Clark:
> From: Rob Clark <rob at ti.com>
> 
> The GEM handle takes the reference.  If a driver is actually importing a
> foreign dmabuf, rather than just re-importing it's own dmabuf, it needs
> to do a get_dma_buf().
> 
> Signed-off-by: Rob Clark <rob at ti.com>
> ---
>  drivers/gpu/drm/drm_prime.c                |    7 +++++++
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |    4 ++++
>  drivers/gpu/drm/i915/i915_gem_dmabuf.c     |    4 ++++
>  drivers/gpu/drm/nouveau/nouveau_prime.c    |    5 +++++
>  drivers/gpu/drm/radeon/radeon_prime.c      |    4 ++++
>  drivers/gpu/drm/udl/udl_gem.c              |    4 ++++
>  6 files changed, 28 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index 4f80374..088e018 100644
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -185,6 +185,13 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,
>  	mutex_unlock(&file_priv->prime.lock);
>  	drm_gem_object_unreference_unlocked(obj);
>  
> +	/*
> +	 * Drop the ref we obtained w/ dma_buf_get() for the benefit of
> +	 * drivers simply re-importing their own dma-buf.. if drivers

Is that supposed to be an ellipse or a full stop?

> +	 * import a foreign dma-buf, they should get_dma_buf().

Would s,should,should use, be better?

> +	 */
> +	dma_buf_put(dma_buf);
> +
>  	return 0;
>  
>  fail:

[…]


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20120724/0046fdb4/attachment.pgp>


More information about the dri-devel mailing list