lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170504201629.GN24019@nuc-i3427.alporthouse.com>
Date:   Thu, 4 May 2017 21:16:29 +0100
From:   Chris Wilson <chris@...is-wilson.co.uk>
To:     Laura Abbott <labbott@...hat.com>
Cc:     Daniel Vetter <daniel.vetter@...ll.ch>,
        Sean Paul <seanpaul@...omium.org>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Sumit Semwal <sumit.semwal@...aro.org>,
        intel-gfx@...ts.freedesktop.org,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
Subject: Re: [PATCHv4 2/3] drm/prime: Introduce drm_gem_prime_import_dev

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 <labbott@...hat.com>
> ---
> 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@...is-wilson.co.uk>
-Chris
>   

-- 
Chris Wilson, Intel Open Source Technology Centre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ