Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-21 Thread Andrew F. Davis
On 3/5/19 2:54 PM, John Stultz wrote: > Add generic helper dmabuf ops for dma heaps, so we can reduce > the amount of duplicative code for the exported dmabufs. > > This code is an evolution of the Android ION implementation, so > thanks to its original authors and maintainters: > Rebecca Schult

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-21 Thread Andrew F. Davis
On 3/19/19 9:26 AM, Brian Starkey wrote: > Hi John, > > On Tue, Mar 05, 2019 at 12:54:30PM -0800, John Stultz wrote: > > ... > >> + >> +void dma_heap_buffer_destroy(struct dma_heap_buffer *heap_buffer) >> +{ >> +struct heap_helper_buffer *buffer = to_helper_buffer(heap_buffer); >> + >> +

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-21 Thread John Stultz
On Tue, Mar 19, 2019 at 7:26 AM Brian Starkey wrote: > > Hi John, > > On Tue, Mar 05, 2019 at 12:54:30PM -0800, John Stultz wrote: > > ... > > > + > > +void dma_heap_buffer_destroy(struct dma_heap_buffer *heap_buffer) > > +{ > > + struct heap_helper_buffer *buffer = to_helper_buffer(heap_buffe

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-21 Thread John Stultz
On Fri, Mar 15, 2019 at 2:06 AM Christoph Hellwig wrote: > > + if (buffer->kmap_cnt) { > > + buffer->kmap_cnt++; > > + return buffer->vaddr; > > + } > > + vaddr = dma_heap_map_kernel(buffer); > > + if (WARN_ONCE(!vaddr, > > + "heap->ops->ma

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-19 Thread Andrew F. Davis
On 3/15/19 4:06 AM, Christoph Hellwig wrote: >> +ret = remap_pfn_range(vma, addr, page_to_pfn(page), len, >> + vma->vm_page_prot); > > So the same chunk could be mapped to userspace and vmap, and later on > also DMA mapped. Who is going to take care of

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-19 Thread Brian Starkey
Hi John, On Tue, Mar 05, 2019 at 12:54:30PM -0800, John Stultz wrote: ... > + > +void dma_heap_buffer_destroy(struct dma_heap_buffer *heap_buffer) > +{ > + struct heap_helper_buffer *buffer = to_helper_buffer(heap_buffer); > + > + if (buffer->kmap_cnt > 0) { > + pr_warn_once(

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-14 Thread Liam Mark
On Wed, 13 Mar 2019, Andrew F. Davis wrote: > On 3/13/19 3:18 PM, Liam Mark wrote: > > On Tue, 5 Mar 2019, John Stultz wrote: > > > >> Add generic helper dmabuf ops for dma heaps, so we can reduce > >> the amount of duplicative code for the exported dmabufs. > >> > >> This code is an evolution of

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-14 Thread Liam Mark
On Tue, 5 Mar 2019, John Stultz wrote: > Add generic helper dmabuf ops for dma heaps, so we can reduce > the amount of duplicative code for the exported dmabufs. > > This code is an evolution of the Android ION implementation, so > thanks to its original authors and maintainters: > Rebecca Schu

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-13 Thread Andrew F. Davis
On 3/13/19 5:57 PM, Liam Mark wrote: > On Wed, 13 Mar 2019, Andrew F. Davis wrote: > >> On 3/13/19 3:18 PM, Liam Mark wrote: >>> On Tue, 5 Mar 2019, John Stultz wrote: >>> Add generic helper dmabuf ops for dma heaps, so we can reduce the amount of duplicative code for the exported dmabuf

Re: [RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-13 Thread Andrew F. Davis
On 3/13/19 3:18 PM, Liam Mark wrote: > On Tue, 5 Mar 2019, John Stultz wrote: > >> Add generic helper dmabuf ops for dma heaps, so we can reduce >> the amount of duplicative code for the exported dmabufs. >> >> This code is an evolution of the Android ION implementation, so >> thanks to its origin

[RFC][PATCH 2/5 v2] dma-buf: heaps: Add heap helpers

2019-03-05 Thread John Stultz
Add generic helper dmabuf ops for dma heaps, so we can reduce the amount of duplicative code for the exported dmabufs. This code is an evolution of the Android ION implementation, so thanks to its original authors and maintainters: Rebecca Schultz Zavin, Colin Cross, Laura Abbott, and others! C