dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Menzel <paulepanter@users.sourceforge.net>
To: Rob Clark <rob.clark@linaro.org>
Cc: Rob Clark <rob@ti.com>,
	dri-devel@lists.freedesktop.org, patches@linaro.org
Subject: Re: [PATCH] drm/prime: drop reference on imported dma-buf
Date: Tue, 24 Jul 2012 08:17:30 +0200	[thread overview]
Message-ID: <1343110650.11746.2.camel@mattotaupa> (raw)
In-Reply-To: <1343084868-13427-1-git-send-email-rob.clark@linaro.org>


[-- Attachment #1.1: Type: text/plain, Size: 1498 bytes --]

Dear Rob,


Am Montag, den 23.07.2012, 18:07 -0500 schrieb Rob Clark:
> From: Rob Clark <rob@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@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

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2012-07-24  6:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 23:07 [PATCH] drm/prime: drop reference on imported dma-buf Rob Clark
2012-07-24  6:17 ` Paul Menzel [this message]
2012-07-24  8:05 ` Daniel Vetter
2012-09-04 22:32   ` Rob Clark
2012-09-05  9:02     ` Daniel Vetter
2012-09-05 12:01       ` Rob Clark

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=1343110650.11746.2.camel@mattotaupa \
    --to=paulepanter@users.sourceforge.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=patches@linaro.org \
    --cc=rob.clark@linaro.org \
    --cc=rob@ti.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