On Thu, Jun 7, 2012 at 4:05 AM, Erik Gilling konkers@android.com wrote:
On Wed, Jun 6, 2012 at 12:17 PM, Clark, Rob rob@ti.com wrote:
well, to be fair this doesn't need to be a userspace API.. or rather it doesn't need to be a standard API added to some new chrdev, since your GL lib is already got it's own interface to the kernel which it could query whatever it needs about a fence / syncobj / syncpoint / whatever.
If the sync primitives are backed by file descriptors (or attached to dma_bufs) you don't need an extra char dev either.
Sure.. and just fwiw, I'm partially playing devil's advocate here (because whatever kernel<->user APIs get added, we have to maintain compatibility for a long time.. so best to start w/ fewer interfaces to userspace when possible, since it is always easier to add new interfaces than to take one away).
And btw, why not eventfd? (Ok, I looked at possibly an earlier version of syncpoints and only just briefly at what you sent to the list earlier today, so if that has changed pls disregard)
The bigger issue is the previous point about how to deal with cases where the CPU doesn't really need to get involved as an intermediary.
CPU fallback access to the buffer is the only legit case where we need a standardized API to userspace (since CPU access isn't already associated w/ some other kernel device file where some extra ioctl can be added)
The CPU case will still need to wait on an arbitrarily backed sync primitive. It shouldn't need to know if it's backed by the gpu, camera, or dsp.
Right, this is the one place we definitely need something.. some userspace code would just get passed a dmabuf file descriptor and want to mmap it and do something, without really knowing where it came from. I *guess* we'll have to add some ioctl's to the dmabuf fd. Although I suppose it doesn't have to be part of the first patchset, it would be easy enough to add later if we had to.
BR, -R
Having a standard API is also really useful for debugging and performance tracing. Having timestamps of when each piece signals in the pipeline of getting a frame on the screen helps track down bottlenecks.
-Erik