simple-dmabuf-egl: Wrong assertion used for eglClientWaitSyncKHR
In function wait_for_buffer_release_fence simple-dmabuf-egl.c
if (d->egl.wait_sync) ret = d->egl.wait_sync(d->egl.display, sync, 0); else ret = d->egl.client_wait_sync(d->egl.display, sync, 0, EGL_FOREVER_KHR); assert(ret == EGL_TRUE);
in case EGL_KHR_wait_sync is not supported else clause is executed and call eglClientWaitSyncKHR and this returns one of three status values from specification EGL_KHR_fence_sync
eglClientWaitSyncKHR returns one of three status values describing the reason for returning. A return value of EGL_TIMEOUT_EXPIRED_KHR indicates that the specified timeout period expired before <sync> was signaled, or if <timeout> is zero, indicates that <sync> is not signaled. A return value of EGL_CONDITION_SATISFIED_KHR indicates that <sync> was signaled before the timeout expired, which includes the case when <sync> was already signaled when eglClientWaitSyncKHR was called. If an error occurs then an error is generated and EGL_FALSE is returned.
EGL_TIMEOUT_EXPIRED_KHR - when timeout is set and time expires
EGL_CONDITION_SATISFIED_KHR - when sync is signaled
EGL_FALSE - during error
It can never return EGL_TRUE but we have assert(ret == EGL_TRUE) after it even if the sync is signaled this may cause application to abort. we should add separate assertion for client_wait_sync with assert(ret == EGL_CONDITION_SATISFIED_KHR) this is because we will never get EGL_TIMEOUT_EXPIRED_KHR since we pass EGL_FOREVER_KHR.