[Cogl] ChangeLog of wip/frame-synchronization branch, with comments

Owen Taylor otaylor at redhat.com
Thu Jan 24 22:01:43 PST 2013


[ In reverse order ]

We start off with my patches. I haven't yet written docs for
cogl-output.c (trying to get this out tonight)

========
commit 55ea53b5b4e7c8352bea59d25cc0cdf47a968229
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Mon Nov 12 11:31:16 2012 -0500

    Add CoglOutput and track for the GLX backend
    
    The CoglOutput object represents one output such as a monitor or
    laptop panel, with information about attributes of the output such
as
    the position of the output within the global coordinate space, and
    the refresh rate.
    
    We don't yet publically export the ability to get output information
but
    we track it for the GLX backend, where we'll use it to track the
refresh
    rate.

commit a0de9e74d97ef44c327bd1daef800aa8667e9938
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Mon Jan 7 12:24:13 2013 -0500

    Add missing cogl-output.c
    
    Should have been part of "Add CoglOutput and track for the GLX
backend"

commit 394a162738f30f9cbf975f93bb9e15399715c423
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Mon Nov 12 11:52:31 2012 -0500

    Prefer OML_sync_control over SGI_video_sync when waiting for swap
    
    When we block waiting for the swap, prefer doing that using
    glXWaitForMsc() from OML_sync_control because that returns a system
    time value for the precise time of the swap.

commit 646c2805342db272a1af53537aacbee1fbb477b2
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Mon Nov 12 11:58:10 2012 -0500

    Add CoglFrameTimings
    
    Add a CoglFrameTimings object that tracks timing information
    for frames that are drawn. We track a frame counter and frame
    timing information for each CoglOnscreen. Frames timing information
    is deliminated by a new cogl_onscreen_begin_frame() and retrieved
using
    cogl_onscreen_get_frame_timings().
========

Then a bunch of fixes and minor changes from you that I have no issues
with.

========
commit 98d2be959c02ef911fdfe038590c226dc8681a1b
Author: Robert Bragg <robert at linux.intel.com>
Date:   Mon Dec 3 23:23:37 2012 +0000

    pedantic style fixes
    
    TODO: squash back into owen's patch

commit 4a881b2fed030981558e02ff1b28f07606cc0692
Author: Robert Bragg <robert at linux.intel.com>
Date:   Mon Dec 3 23:15:48 2012 +0000

    use c99 types if applicable and s/gboolean/CoglBool/
    
    TODO: squash back into owen's patch

commit ac24c9db3ed126f8c4c450b258bd26f73489b4be
Author: Robert Bragg <robert at linux.intel.com>
Date:   Mon Dec 3 23:35:14 2012 +0000

    move outputs member up to CoglRenderer
    
    TODO: squash back into owen's patch

commit 2619778124ba347343fb62bd5c9b22e8bbdcabc2
Author: Robert Bragg <robert at linux.intel.com>
Date:   Mon Dec 3 23:00:15 2012 +0000

    rename CoglFrameTimings to CoglSwapInfo
    
    The aim is to pass an opaque structure to the swap buffers
notification
    callbacks and enable access to frame timing information this way.
Since
    there could be numerous non-timing related things to report here too
    this gives the structure a more general name.
    
    TODO: fold this back into owen's patch

commit 1b6ccda7b65a1b13f60cdd10fa166d4ac9a4ed79
Author: Robert Bragg <robert at linux.intel.com>
Date:   Mon Dec 3 23:16:01 2012 +0000

    use c99 types if applicable and s/gboolean/CoglBool/
    
    TODO: squash back into owen's patch

commit 30ad78f96af0cc4bea8a1aca442500d16ba496e6
Author: Robert Bragg <robert at linux.intel.com>
Date:   Wed Jan 9 20:46:43 2013 +0000

    rename SwapInfo to FrameInfo
    
    As discussed on the mailing list we can be slightly more consistent
with gtk
    by using "frame" instead of "swap" here. Also we discussed the
potential
    for being able to query information for a frame that's still in
progress
    and in that case "swap" wouldn't make much sense.
    
    TODO: squash this back into owen's patch

commit 0dd495d28418db0ad6ffd0d8078a27f01c2eba42
Author: Robert Bragg <robert at linux.intel.com>
Date:   Tue Jan 15 15:37:49 2013 +0000

    frame-info: s/_refresh_interval/_refresh_rate/
    
    For consistency this reworks the
cogl_frame_info_get_refresh_interval
    api to instead be cogl_frame_info_get_refresh_rate() and return a
    frequency in Hertz instead of an interval in milliseconds. This is
    consistent with cogl_output_get_refresh_rate().

commit c7bda39491fd63cedec92ef79cf2cb9fe3df0fbd
Author: Robert Bragg <robert at linux.intel.com>
Date:   Mon Jan 21 01:18:25 2013 +0000

    renderer: expose CoglOutputs
    
    This adds a cogl_renderer_foreach_output() function that can be used
to
    iterate the display outputs for a particular renderer.
    
    This also updates cogl-info to use this new api so it can dump out
all
    the output information.
========

I also have no issue with the basic idea of the new frame callback API

========
commit 8a1a1f56135af22c7316529f9e6f400059e305b8
Author: Robert Bragg <robert at linux.intel.com>
Date:   Thu Jan 10 19:23:48 2013 +0000

    onscreen: Provide more general CoglFrameCallback api
    
    This reworks the cogl_onscreen_add_swap_complete_callback api to
instead
    be named cogl_onscreen_add_frame_callback and to take a callback
that
    can accept other events besides just swap completion events. This
means
    we can add more events in the future that signal the progression of
a
    frame without needing lots of new callback api for each event.
    
    TODO: squash this back into owen's patch
========

At this point, we get to a bunch of things extracted from your patch
that I don't quite agree with,
but I'm willing to  go with. cogl_frame_info_get_output() doesn't seem
useful to me:

========
commit 5cc26c82555e01ca7370772b73b93ca00772c37a
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Jan 24 17:38:38 2013 -0500

    Add cogl_frame_info_get_output()
    
    If available from the windowing system, it could potentially be
useful
    to know something other than the refresh rate of the output that the
    monitor is currently presenting on. (Note however, an onscreen may
span
    multiple outputs. The windowing system has to pick *one* for timing,
    but most other attibutes of the window will apply to the parts of
the
    onscreen on that output.)
========

See discussion of frame time elsewhere. I think it simplifies the lives
of people trying to
use CoglFrameInfo, but it's not required, minimal low-level
functionality, certainly.

========
commit 38ac56be4a0af4048091cfa3f7fd206a0d4db424
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Jan 24 22:12:47 2013 -0500

    Remove cogl_frame_info_get_frame_time()
    
    The frame_time isn't closely associated with an onscreen - an update
    could involve multiple stages (in a stage-per-output scenario,
perhaps.)
    If an application or toolkit needs to know the frame time for a
FrameInfo
    it will have to do that association itself.
========

Switching away from g_get_monotonic_time() is needed if Cogl is to be
compiled
without GLib. The patch here keeps the translation of gettimeofday() UST
values into
clock_gettime(CLOCK_MONOTONIC, ...).

========
commit 67bc4064ea0f63fdc3a751c4cf1df3edfeeceb2f
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Jan 24 22:32:39 2013 -0500

    Don't use g_get_monotonic_time()
    
    Avoid a hard dependency on GLib and on however GLib is implementing
    g_get_monotonic_time() by directly referencing
clock_gettime(CLOCK_MONOTONIC).
    
    The translation of timestamp values for unidentified types of UST is
    also removed, since it's going to have a big error, and
    glXGetSyncValues() doesn't return the *current* UST anyways - it
returns
    the UST for the last frame.
========

Hopefully multiplying by 1000 is safe - in which case, I don't care
about usec vs. nanosec.

========
commit 36bbcb083156926f50c0b3c3e0b42e24f42fdbf7
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Jan 24 22:43:10 2013 -0500

    Switch presentation time to nanoseconds
    
    In the future, we may want to track frame timings with very high
precision
    for profiling purposes, so to be consistent with that, use
nanoseconds,
    not microseconds. 63-bits in nanoseconds is 270+ years, so hopefully
    clock_gettime(CLOCK_MONOTONIC,) will fit.
========

The next patch is a big hunk of changes, but is mostly about removing
the history ring in favor
of a queue. I don't know how this will work out when we start
implementing more complex
scenarios than we have currently implemented - like the compositor
scenario with
_NET_WM_FRAME_DRAWN and _NET_WM_FRAME_TIMINGS - but if we expose
nothing,
we can always adjust later. There is a potential problem of having a
queue of unlimited
length - if someone wrote a all-draw-no-events program, the queue would
grow without
bound.

========
commit 41de98629a23f594715c703d26671d039085cf93
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Jan 24 23:16:25 2013 -0500

    Replace frame history with a queue
    
    An arbitrary-length frame history seems hard to size, and can be
implemented
    at the application level, so ditch it for a queue of frame info
objects
    that are not yet complete.
========

cogl_frame_info_get_complete() would be useful - e.g., if an application
is keeping an application-side
history - knowing what frames can be used now and aren't waiting for
COMPLETE events. Though
with COMPLETE events it can be emulated. Can be added later.

========
commit 47bf79c31f0d8de8c1165d3fe9818a5021a17f1c
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Jan 24 23:29:04 2013 -0500

    Remove cogl_frame_info_get_complete()
    
    An application gets a callback when a frame info is complete, so
there
    may not be a need for a flag as well.
========

I think the main question for me is whether you are OK with gettimeofday
=> CLOCK_MONOTONIC
conversion so we have a known scale. Otherwise, the diffs between the
two branches are detail,
and there's nothing that I've pushed to wip/frame-synchronization that I
have a hard objection to.

- Owen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20130125/4a9990ca/attachment-0001.html>


More information about the Cogl mailing list