3 CHROMIUM_get_sync_values
7 EGL_CHROMIUM_get_sync_values
11 Stéphane Marchesin, Google (marcheu 'at' google.com)
19 Last Modified Date: N/A Revision: 1.0
21 Based on GLX_OML_sync_control Revision 6.0
29 The extension is written against the EGL 1.2 Specification, although it
30 should work on other versions of these specifications. This extension
31 also requires an operating system which supports CLOCK_MONOTONIC.
35 This extension provides counters which let applications know about the
36 timing of the last vertical retrace. By looking at the system clock, as
37 well as the refresh rate of the monitor, this should enable applications
38 to predict the position of future retraces so as to schedule an optimal
41 This extension incorporates the use of three counters that provide
42 the necessary synchronization. The Unadjusted System Time (or UST)
43 is the 64-bit CLOCK_MONOTONIC clock; in particular this lets the
44 application schedule future vertical retraces by querying this clock.
45 The graphics Media Stream Counter (or graphics MSC) is a counter
46 that is unique to the graphics subsystem and increments for each
47 vertical retrace that occurs. The Swap Buffer Counter (SBC) is an
48 attribute of an EGLSurface and is incremented each time a swap
49 buffer action is performed on the associated surface.
51 The use of these three counters allows the application to
52 synchronize graphics rendering to vertical retraces and/or swap
53 buffer actions. For example, by querying the synchronization values for
54 a given surface, the application can accurately predict the timing for
55 the next vertical retraces and schedule rendering accordingly.
65 New Procedures and Functions
67 Bool eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
78 Additions to the EGL 1.3 Specification
80 eglGetSyncValuesCHROMIUM returns the current UST/MSC/SBC triple. A UST
81 timestamp is obtained each time the graphics MSC is incremented.
82 If this value does not reflect the value of the UST at the time the
83 first scan line of the display begins passing through the video
84 output port, it will be adjusted by the graphics driver to do so
85 prior to being returned by any of the functions defined by this
88 This UST timestamp, together with the current graphics MSC and the
89 current SBC, comprise the current UST/MSC/SBC triple. The UST,
90 graphics MSC, and SBC values are not part of the render context
91 state. These values cannot be pushed or popped. The graphics MSC
92 value is initialized to 0 when the graphics device is initialized.
93 The SBC is per-surface state and is initialized to 0 when the
94 EGLSurface data structure is initialized.
96 The SBC value is incremented by the graphics driver at the completion
97 of each buffer swap (e.g., the pixel copy has been completed or the
98 hardware register that swaps memory banks has been written). For pixel
99 formats that do not contain a back buffer, the SBC will always be
102 The graphics MSC value is incremented once for each screen refresh.
103 For a non-interlaced display, this means that the graphics MSC value
104 is incremented for each frame. For an interlaced display, it means
105 that it will be incremented for each field. For a multi-monitor
106 system, the monitor used to determine MSC is the one where the surface
107 is located. If the surface spans multiple monitors, the monitor used
108 to determine MSC is the one with the biggest coverage in pixels.
110 The function eglGetSyncValuesCHROMIUM will return TRUE if the function
111 completed successfully, FALSE otherwise.
113 Each time eglSwapBuffer succeeds, the SBC will be increased within a
118 eglGetSyncValuesCHROMIUM will return FALSE if there is no current
123 Get Value Get Command Type Initial Value
124 --------- ----------- ---- -------------
125 [UST] eglGetSyncValuesCHROMIUM Z unspecified
126 [MSC] eglGetSyncValuesCHROMIUM Z 0
127 [SBC] eglGetSyncValuesCHROMIUM Z 0
129 New Implementation Dependent State