[Piglit] [RFC 0/2] egl_android_native_fence_sync tests.

Rafael Antognolli rafael.antognolli at intel.com
Thu Oct 27 00:07:08 UTC 2016


On Wed, Oct 26, 2016 at 12:20:52PM -0700, Chad Versace wrote:
> On Tue 25 Oct 2016, Rob Clark wrote:
> > On Tue, Oct 25, 2016 at 5:19 PM, Rafael Antognolli
> > <rafael.antognolli at intel.com> wrote:

> > >  2) The spec mentions that if a fence sync object is created with
> > >  attribute EGL_SYNC_NATIVE_FENCE_FD_ANDROID set to
> > >  EGL_NO_NATIVE_FENCE_FD_ANDROID, "the next Flush() operation performed
> > >  by the current client API causes a new native fence object to be
> > >  created, and the EGL_SYNC_NATIVE_FENCE_ANDROID attribute of the EGL
> > >  native fence object is set to a file descriptor that refers to the new
> > >  native fence object." I'm not sure I fully understand this statement,
> > >  so I have no idea how to test it.
> > 
> > basically, before glFlush() or eglSwapBuffers() (or perhaps some other
> > calls that are expected to trigger a flush?) eglDupNativeFenceFD() can
> > return -1, but after it should return a valid fence.
> 
> The two modes of using EGL_ANDROID_native_fence_sync correspond
> to an "in" fence and an "out" fence.
> 
> If you give a valid sync fd to eglCreateSync, then the next flush will
> submit the fd as an "in" fence along with the submitted batch buffer. The kernel
> will schedule the work to begin after the in-fence signals.
> 
> If you give fd == -1 to eglCreateSync, then the next flush, when it
> submits the batch buffer to i915, will tell the EXECBUFFER2 ioctl
> to return an "out" fence fd. The out-fence will signal when the batch
> buffer completes execution.

OK, I got the idea of in and out fences but now it's clearer to me how
it interacts with flush. Thank you guys for the detailed explanation.

BTW, I've added more tests here:

https://github.com/rantogno/piglit/tree/fences

I'm still working on them so I didn't submit them to avoid keep flooding
the list, since I'm probably going to change them tomorrow. But most of
the things that I wanted to test are already there, in case you guys
want to check.

Cheers,
Rafael


More information about the Piglit mailing list