15 Dec, 2020

1 commit


22 Aug, 2020

3 commits

  • …ufs from specific heaps

    This allows drivers who don't want to create their own
    DMA-BUF exporter to be able to allocate DMA-BUFs directly
    from existing DMA-BUF Heaps.

    There is some concern that the premise of DMA-BUF heaps is
    that userland knows better about what type of heap memory
    is needed for a pipeline, so it would likely be best for
    drivers to import and fill DMA-BUFs allocated by userland
    instead of allocating one themselves, but this is still
    up for debate.

    Unfortunately we don't have any public users of this, so
    we cannot push it upstream. However, vendors have asked
    for this, so I'm submitting it to Andorid Common in the
    hopes that we can eventually find what vendors are doing.

    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Change-Id: I7b5ef690cefd2bfbbc2e01220ada49e44ef4fa04
    Bug: 154341375

    John Stultz
     
  • While most uses will want to allocate a fd for a dmabuf, there
    are some cases where it might be useful to have just a dma_buf structure.

    So refactor the heap allocaiton functions to return a struct dma_buf
    and add a dma_heap_bufferfd_alloc() function to convert that return a fd.

    Signed-off-by: John Stultz
    Change-Id: Id6fd7e8471b9555a08bcdf8ca210feb589fa51c1
    Bug: 154341375

    John Stultz
     
  • Add proper refcounting on the dma_heap structure.
    While existing heaps are built-in, we may eventually
    have heaps loaded from modules, and we'll need to be
    able to properly handle the references to the heaps

    Also moves minor tracking into the heap structure so
    we can properly free things.

    Cc: Sumit Semwal
    Cc: Andrew F. Davis
    Cc: Benjamin Gaignard
    Cc: Liam Mark
    Cc: Laura Abbott
    Cc: Brian Starkey
    Cc: Hridya Valsaraju
    Cc: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Signed-off-by: John Stultz
    Change-Id: I9f9e27f640c926882a639d6ad5dc3019d7e2c2b0
    Link: https://lore.kernel.org/lkml/20200725032633.125006-1-john.stultz@linaro.org/T/#u
    Bug: 154341375
    ---
    v2: Fix potential race with kref_put being called while another
    cpu was scanning the list to take a ref, pointed out by
    Hridya

    John Stultz
     

11 Dec, 2019

1 commit

  • This framework allows a unified userspace interface for dma-buf
    exporters, allowing userland to allocate specific types of memory
    for use in dma-buf sharing.

    Each heap is given its own device node, which a user can allocate
    a dma-buf fd from using the DMA_HEAP_IOC_ALLOC.

    This code is an evoluiton of the Android ION implementation,
    and a big thanks is due to its authors/maintainers over time
    for their effort:
    Rebecca Schultz Zavin, Colin Cross, Benjamin Gaignard,
    Laura Abbott, and many other contributors!

    Cc: Laura Abbott
    Cc: Benjamin Gaignard
    Cc: Sumit Semwal
    Cc: Liam Mark
    Cc: Pratik Patel
    Cc: Brian Starkey
    Cc: Vincent Donnefort
    Cc: Sudipto Paul
    Cc: Andrew F. Davis
    Cc: Christoph Hellwig
    Cc: Chenbo Feng
    Cc: Alistair Strachan
    Cc: Hridya Valsaraju
    Cc: Sandeep Patil
    Cc: Hillf Danton
    Cc: Dave Airlie
    Cc: dri-devel@lists.freedesktop.org
    Reviewed-by: Brian Starkey
    Acked-by: Sandeep Patil
    Signed-off-by: Andrew F. Davis
    Signed-off-by: John Stultz
    Signed-off-by: Sumit Semwal
    Link: https://patchwork.freedesktop.org/patch/msgid/20191203172641.66642-2-john.stultz@linaro.org

    Andrew F. Davis
     

31 Oct, 2019

1 commit

  • This reverts commit a69b0e855d3fd278ff6f09a23e1edf929538e304.

    This patchset doesn't meet the UAPI requirements set out in [1] for the DRM
    subsystem. Once the userspace component is reviewed and ready for merge
    we can try again.

    [1]- https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

    Fixes: a69b0e855d3f ("dma-buf: Add dma-buf heaps framework")
    Cc: Laura Abbott
    Cc: Benjamin Gaignard
    Cc: Sumit Semwal
    Cc: Liam Mark
    Cc: Pratik Patel
    Cc: Brian Starkey
    Cc: Vincent Donnefort
    Cc: Sudipto Paul
    Cc: Andrew F. Davis
    Cc: Christoph Hellwig
    Cc: Chenbo Feng
    Cc: Alistair Strachan
    Cc: Hridya Valsaraju
    Cc: Hillf Danton
    Cc: dri-devel@lists.freedesktop.org
    Cc: Brian Starkey
    Cc: John Stultz
    Cc: Mauro Carvalho Chehab
    Cc: "David S. Miller"
    Cc: Greg Kroah-Hartman
    Cc: Rob Herring
    Cc: Jonathan Cameron
    Cc: "Paul E. McKenney"
    Cc: Sean Paul
    Cc: "Andrew F. Davis"
    Cc: linux-media@vger.kernel.org
    Cc: linaro-mm-sig@lists.linaro.org
    Acked-by: David Airlie
    Signed-off-by: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/msgid/20191030203003.101156-6-sean@poorly.run

    Sean Paul
     

25 Oct, 2019

1 commit

  • This framework allows a unified userspace interface for dma-buf
    exporters, allowing userland to allocate specific types of memory
    for use in dma-buf sharing.

    Each heap is given its own device node, which a user can allocate
    a dma-buf fd from using the DMA_HEAP_IOC_ALLOC.

    This code is an evoluiton of the Android ION implementation,
    and a big thanks is due to its authors/maintainers over time
    for their effort:
    Rebecca Schultz Zavin, Colin Cross, Benjamin Gaignard,
    Laura Abbott, and many other contributors!

    Cc: Laura Abbott
    Cc: Benjamin Gaignard
    Cc: Sumit Semwal
    Cc: Liam Mark
    Cc: Pratik Patel
    Cc: Brian Starkey
    Cc: Vincent Donnefort
    Cc: Sudipto Paul
    Cc: Andrew F. Davis
    Cc: Christoph Hellwig
    Cc: Chenbo Feng
    Cc: Alistair Strachan
    Cc: Hridya Valsaraju
    Cc: Hillf Danton
    Cc: dri-devel@lists.freedesktop.org
    Reviewed-by: Benjamin Gaignard
    Reviewed-by: Brian Starkey
    Acked-by: Laura Abbott
    Tested-by: Ayan Kumar Halder
    Signed-off-by: Andrew F. Davis
    Signed-off-by: John Stultz
    Signed-off-by: Sumit Semwal
    Link: https://patchwork.freedesktop.org/patch/msgid/20191021190310.85221-2-john.stultz@linaro.org

    Andrew F. Davis