[PATCH] RFC: dma-buf: userspace mmap support

Alan Cox alan at lxorguk.ukuu.org.uk
Sat Mar 17 13:17:19 PDT 2012


> > dma-buf file descriptor.  Userspace access to the buffer should be
> > bracketed with DMA_BUF_IOCTL_{PREPARE,FINISH}_ACCESS ioctl calls to
> > give the exporting driver a chance to deal with cache synchronization
> > and such for cached userspace mappings without resorting to page

There should be flags indicating if this is necessary. We don't want extra
syscalls on hardware that doesn't need it. The other question is what
info is needed as you may only want to poke a few pages out of cache and
the prepare/finish on its own gives no info.

> E.g. If another device was writing to the buffer, the prepare ioctl
> could block until that device had finished accessing that buffer.

How do you avoid deadlocks on this ? We need very clear ways to ensure
things always complete in some form given multiple buffer
owner/requestors and the fact this API has no "prepare-multiple-buffers"
support.

Alan


More information about the dri-devel mailing list