Re: [PATCH 1/6] drm: Add helper to cast DMA-buf to GEM object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 12, 2017 at 11:44 PM, Felix Kuehling <felix.kuehling@xxxxxxx> wrote:
>
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -634,16 +634,14 @@ struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
>         struct drm_gem_object *obj;
>         int ret;
>
> -       if (dma_buf->ops == &drm_gem_prime_dmabuf_ops) {
> -               obj = dma_buf->priv;
> -               if (obj->dev == dev) {
> -                       /*
> -                        * Importing dmabuf exported from out own gem increases
> -                        * refcount on gem itself instead of f_count of dmabuf.
> -                        */
> -                       drm_gem_object_reference(obj);
> -                       return obj;
> -               }
> +       obj = drm_gem_prime_dmabuf_to_object(dma_buf, NULL);
> +       if (obj && obj->dev == dev) {
> +               /*
> +                * Importing dmabuf exported from out own gem increases
> +                * refcount on gem itself instead of f_count of dmabuf.
> +                */
> +               drm_gem_object_reference(obj);
> +               return obj;
>         }
>
>         if (!dev->driver->gem_prime_import_sg_table)
>
> Do you want me to do that in the same commit, or a separate one?

I'd squash it into the one commit you have already.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux