[Linaro-mm-sig] [RFC] Synchronizing access to buffers shared with dma-buf between drivers/devices
Clark, Rob
rob at ti.com
Sat Jun 9 06:35:56 PDT 2012
On Fri, Jun 8, 2012 at 3:56 PM, Erik Gilling <konkers at android.com> wrote:
>> I guess my other thought is that implicit vs explicit is not
>> mutually exclusive, though I'd guess there'd be interesting
>> deadlocks to have to debug if both were in use _at the same
>> time_. :-)
>
> I think this is an approach worth investigating. I'd like a way to
> either opt out of implicit sync or have a way to check if a dma-buf
> has an attached fence and detach it. Actually, that could work really
> well. Consider:
>
> * Each dma_buf has a single fence "slot"
> * on submission
> * the driver will extract the fence from the dma_buf and queue a wait on it.
> * the driver will replace that fence with it's own complettion
> fence before the job submission ioctl returns.
> * dma_buf will have two userspace ioctls:
> * DETACH: will return the fence as an FD to userspace and clear the
> fence slot in the dma_buf
> * ATTACH: takes a fence FD from userspace and attaches it to the
> dma_buf fence slot. Returns an error if the fence slot is non-empty.
>
> In the android case, we can do a detach after every submission and an
> attach right before.
btw, I like this idea for implicit and explicit sync to coexist
BR,
-R
More information about the dri-devel
mailing list