[Cogl] Cogl patches supporting frame timing

otaylor at redhat.com otaylor at redhat.com
Wed Nov 28 08:47:48 PST 2012


This is a patch set for Cogl that adds support for reporting frame timing
information back as necessary to get precise information about when frames were
scanned out to the display device.

What I've done with it so far is used this in the Mutter compositor
to pass that information on to the application running and then used
that in GTK+ for frame timing. With this approach, I can get
audio/video synchronization in a test application to stably lock at
a known millisecond rather than having an unknown latency somewhere
in the 0-35 ms range.

(This is in the wip/frame-synchronization branch of Cogl - there are
corresponding wip/frame-synchronization branches of Clutter (small),
Mutter, and GTK+)

It's also useful to have information about what the refresh rate is of the
display, so I've added a framework for CoglOutput to handle information
about the properties of one display device. CoglOutput isn't fully hooked
up yet - right now I'm just using it in the GLX winsys and not exposing
it to applications.

Other things that aren't completely finished here are:

 - I haven't really looked at other winsys - with some backends it may simply
   not be possible to get some or all of the information, and what I've
   done here is that any timing value can have a value of '0' as a flag
   to indicate that it isn't supplied.

 - I haven't tried to make Cogl a *consumer* of frame timing information
   from a X window system compositor - the same sort of work I've done
   for GTK+ should apply to the Cogl stack as well and may require a bit
   of adjustment when the timing information isn't coming directly
   from GL but instead from the compositor.


More information about the Cogl mailing list