From: Paul Menzel Subject: Re: [PATCH] drm/prime: drop reference on imported dma-buf Date: Tue, 24 Jul 2012 08:17:30 +0200 Message-ID: <1343110650.11746.2.camel@mattotaupa> References: <1343084868-13427-1-git-send-email-rob.clark@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0105122727==" Return-path: Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id 40C459EF18 for ; Mon, 23 Jul 2012 23:17:46 -0700 (PDT) In-Reply-To: <1343084868-13427-1-git-send-email-rob.clark@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Rob Clark Cc: Rob Clark , dri-devel@lists.freedesktop.org, patches@linaro.org List-Id: dri-devel@lists.freedesktop.org --===============0105122727== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-8ysRLgGxh0WFU7C9iiCJ" --=-8ysRLgGxh0WFU7C9iiCJ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Rob, Am Montag, den 23.07.2012, 18:07 -0500 schrieb Rob Clark: > From: Rob Clark >=20 > 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(). >=20 > Signed-off-by: Rob Clark > --- > 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(+) >=20 > 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 *de= v, > mutex_unlock(&file_priv->prime.lock); > drm_gem_object_unreference_unlocked(obj); > =20 > + /* > + * 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; > =20 > fail: [=E2=80=A6] Thanks, Paul --=-8ysRLgGxh0WFU7C9iiCJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlAOPfoACgkQPX1aK2wOHVghnQCeJ6llZyiJyFDSwiswZz87+oeC jUoAn3IKC0Zhe7x4JyVhYCcH7kP+uPGd =k3j/ -----END PGP SIGNATURE----- --=-8ysRLgGxh0WFU7C9iiCJ-- --===============0105122727== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0105122727==--