From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbdEDUQq (ORCPT ); Thu, 4 May 2017 16:16:46 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:58893 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751814AbdEDUQo (ORCPT ); Thu, 4 May 2017 16:16:44 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Thu, 4 May 2017 21:16:29 +0100 From: Chris Wilson To: Laura Abbott Cc: Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sumit Semwal , intel-gfx@lists.freedesktop.org, Joonas Lahtinen Subject: Re: [PATCHv4 2/3] drm/prime: Introduce drm_gem_prime_import_dev Message-ID: <20170504201629.GN24019@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Laura Abbott , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sumit Semwal , intel-gfx@lists.freedesktop.org, Joonas Lahtinen References: <1493923548-20878-1-git-send-email-labbott@redhat.com> <1493923548-20878-3-git-send-email-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1493923548-20878-3-git-send-email-labbott@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 04, 2017 at 11:45:47AM -0700, Laura Abbott wrote: > > The existing drm_gem_prime_import function uses the underlying > struct device of a drm_device for attaching to a dma_buf. Some drivers > (notably vgem) may not have an underlying device structure. Offer > an alternate function to attach using any available device structure. > > Signed-off-by: Laura Abbott > --- > v4: Alternate implemntation to take an arbitrary struct dev instead of just > a platform device. > > This was different enough that I dropped the previous Reviewed-by > --- > drivers/gpu/drm/drm_prime.c | 30 ++++++++++++++++++++++++------ > include/drm/drm_prime.h | 5 +++++ > 2 files changed, 29 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c > index 9fb65b7..5ad9a26 100644 > --- a/drivers/gpu/drm/drm_prime.c > +++ b/drivers/gpu/drm/drm_prime.c > @@ -595,15 +595,18 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev, > EXPORT_SYMBOL(drm_gem_prime_handle_to_fd); > > /** > - * drm_gem_prime_import - helper library implementation of the import callback > + * drm_gem_prime_import_dev - core implementation of the import callback > * @dev: drm_device to import into > * @dma_buf: dma-buf object to import > + * @attach_dev: struct device to dma_buf attach > * > - * This is the implementation of the gem_prime_import functions for GEM drivers > - * using the PRIME helpers. > + * This is the core of drm_gem_prime_import. It's designed to be called by > + * drivers who want to use a different device structure than dev->dev for > + * attaching via dma_buf. > */ > -struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev, > - struct dma_buf *dma_buf) > +struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev, > + struct dma_buf *dma_buf, > + struct device *attach_dev) My critique would be that this should be called drm_gem_prime_import_for_device() Either way (though naturally I like my suggestion ;), Reviewed-by: Chris Wilson -Chris > -- Chris Wilson, Intel Open Source Technology Centre