[EARLY RFC][PATCH] dma-buf: Add dma-buf heaps framework

John Stultz john.stultz at linaro.org
Tue Feb 26 23:40:42 UTC 2019


On Tue, Feb 26, 2019 at 11:21 AM John Stultz <john.stultz at linaro.org> wrote:
>
> On Tue, Feb 26, 2019 at 6:47 AM Andrew F. Davis <afd at ti.com> wrote:
> > On 2/26/19 12:20 AM, John Stultz wrote:
> > > It boots w/ AOSP, and allocations seem to work, but there's something
> > > wrong with the dmabuf mmaping which casues the homescreen to crash
> > > over and over.
> > > (userland patches updated here:
> > > https://android-review.googlesource.com/c/device/linaro/hikey/+/909436)
> > >
> >
> > Interesting, I wonder if the caching stuff is not right here, I'll see
> > if I can get this working on my side (AOSP on Beagle x15).
> >
>
> Let me know if you figure anything out, I'll also be looking at this today.
>

Ok. Figured out the issue. There was a missing:
  len = PAGE_ALIGN(len)
assignment that the core used to do before calling the heap alloc op.

Adding that into the heap alloc op got it booting ok w/ AOSP.

I've updated the patches here:
kernel: https://git.linaro.org/people/john.stultz/android-dev.git/log/?h=dev/dma-buf-heap
userland: https://android-review.googlesource.com/c/device/linaro/hikey/+/909436


> I also realized some of Benajmin's error path improvements are going
> to be hard to fix w/ my current code, specifically having the allocate
> op do the allocation of the dma_heap_buffer (since we don't have a
> free op, if something fails creating the dmabuf fd in the core, we
> don't have a hook to release the dma_heap_buffer and heap private
> data).

I also realized doing my development and testing against my
hikey960-mainline-WIP branch, I accidentally folded in an ion hack I
was using to reduce cache operations, so I'll need to undo that in the
heap-helpers.c.  But at least we have a rough validation point for the
design.

thanks
-john


More information about the dri-devel mailing list