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>
This commit is contained in:
committed by
Pekka Paalanen
parent
e39eb8f896
commit
df0e4b965f
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user