summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>2017-09-27 15:09:16 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-09-29 10:20:54 +0300
commitdf0e4b965fc9d0e765416fda28cac3af137bd410 (patch)
tree1e2cc6072d803af5c7be3306e1e6224b5f109bbe /shared
parente39eb8f896f9640cf731715ccba64bad26556f4d (diff)
downloadweston-df0e4b965fc9d0e765416fda28cac3af137bd410.tar.gz
weston-df0e4b965fc9d0e765416fda28cac3af137bd410.tar.bz2
weston-df0e4b965fc9d0e765416fda28cac3af137bd410.zip
gl-renderer: Emit GPU rendering begin and end timeline timepoints
Use EGL fence sync objects to emit timepoints for the beginning and the end of rendering on the GPU. The timepoints are emitted asynchronously using the sync file fds associated with the fence sync objects. The sync file fds are acquired using the facilities provided by the EGL_ANDROID_native_fence_sync extension. The asynchronous timepoint submissions are stored in a list in gl_output_state until they are executed, and any pending submissions that remain at output destruction time are cleaned up. If timelining is inactive or the required EGL extensions are not present, then GPU timepoint processing and emission are skipped. Note that the GPU timestamps returned by sync files are in the CLOCK_MONOTONIC clock domain, and are thus compatible with the timeline timestamps (which also are in the CLOCK_MONOTONIC domain). Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'shared')
-rw-r--r--shared/weston-egl-ext.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h
index 8aacbd01..0784ea2d 100644
--- a/shared/weston-egl-ext.h
+++ b/shared/weston-egl-ext.h
@@ -181,6 +181,10 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD
typedef void *EGLSyncKHR;
#endif /* EGL_KHR_cl_event2 */
+#ifndef EGL_NO_SYNC_KHR
+#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
+#endif
+
#ifndef EGL_KHR_fence_sync
#define EGL_KHR_fence_sync 1
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
@@ -192,6 +196,14 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLS
typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync);
#endif /* EGL_ANDROID_native_fence_sync */
+#ifndef EGL_SYNC_NATIVE_FENCE_ANDROID
+#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
+#endif
+
+#ifndef EGL_NO_NATIVE_FENCE_FD_ANDROID
+#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1
+#endif
+
#else /* ENABLE_EGL */
/* EGL platform definition are keept to allow compositor-xx.c to build */