[Piglit] [PATCH 2/2] EGL_CHROMIUM_get_sync_values: Add conformance test.

Sarah Sharp sarah.a.sharp at linux.intel.com
Tue Apr 22 12:22:12 PDT 2014


On Fri, Apr 18, 2014 at 06:21:31PM -0700, Jamey Sharp wrote:
> I'm no expert on OML_sync_control, but in a funny coincidence I've
> been reading that spec and Xorg's DRI2 implementation of it pretty
> carefully recently. (I blame keithp.)
> 
> In test_eglGetSyncValuesCHROMIUM_msc_and_sbc_test, I think what the
> spec allows and requires might be a little different than what's
> tested, although I'm not sure.
> 
> - I don't see that MSC has to change at all even after two
> eglSwapBuffers calls, if SwapBuffers doesn't sync to vertical retrace.

I looked at the EGL 1.5 spec with Chad, and if you look at the
definition of eglSwapInterval, you'll see that the "minimum number of
video frame periods per buffer swap" is set to 1 by default.  I think
one frame period is the time between vertical retraces, but the spec
isn't clear on that.

> I think you can test this by setting the DRI config option
> vblank_mode=0 when you run your Piglit test. (I've read that you can
> set that as an environment variable but I can't find code in Mesa that
> would do that, so maybe you have to use drirc.)

I asked Chad about this, and his argument was if you're setting random
environment variables, the test suite is not guaranteed to work.

> - I'm not sure how you can ensure any SwapBuffers calls completed
> without using any of GLX_OML_sync_control, GLX_INTEL_swap_event, or
> implementation-specific knowledge. It isn't obvious to me that
> eglSwapBuffers can be relied on to throttle the client, even on a
> specific implementation like Xorg/DRI2. (Again, perhaps with
> vblank_mode=0; I'd expect turning off vsync to also turn off
> throttling.)

It's apparently up to the driver to enforce the throttling of
eglSwapBuffers.  Chad and I discussed explicitly setting
EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL to 1 in the EGL config.
The driver is supposed to throw an error if it can't accommodate that
swap interval, and that's a bug if it doesn't.  I suggested adding a
piglit log warning if the test fails, something to the effect of:

"MSC and SBC test failed, does the driver throttle eglSwapBuffers?"

That way if the test fails, people will at least know what part of the
driver to look at.

Sarah Sharp


More information about the Piglit mailing list