diff options
author | boliu <boliu@chromium.org> | 2015-02-04 15:41:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-04 23:42:47 +0000 |
commit | 0599e81b61d2ab266a68dcce9d2b3c27e275f879 (patch) | |
tree | 7172c45eb3cd392e7ec76aeb582bfc692afe483f /ui | |
parent | e27b1ef23206ea3352b4623184b3533b2bac4dcb (diff) | |
download | chromium_src-0599e81b61d2ab266a68dcce9d2b3c27e275f879.zip chromium_src-0599e81b61d2ab266a68dcce9d2b3c27e275f879.tar.gz chromium_src-0599e81b61d2ab266a68dcce9d2b3c27e275f879.tar.bz2 |
Add workaround to ignore EGL sync errors on qc
On android versions before 5.0, EGL sync objects are
incorrectly destroyed when the associated EGL context is
destroyed. The EGL sync objects error handling is tight to
prevent driver regressions from known issues. This combined
with this triggers DCHECk failures and crashes.
So add another workaround to ignore errors from EGL sync
object calls.
BUG=453857
Review URL: https://codereview.chromium.org/892323002
Cr-Commit-Position: refs/heads/master@{#314678}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gl/gl_fence_egl.cc | 20 | ||||
-rw-r--r-- | ui/gl/gl_fence_egl.h | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/ui/gl/gl_fence_egl.cc b/ui/gl/gl_fence_egl.cc index 277b631..74f0a01 100644 --- a/ui/gl/gl_fence_egl.cc +++ b/ui/gl/gl_fence_egl.cc @@ -9,6 +9,17 @@ namespace gfx { +namespace { + +bool g_ignore_egl_sync_failures = false; + +} // namespace + +// static +void GLFenceEGL::SetIgnoreFailures() { + g_ignore_egl_sync_failures = true; +} + GLFenceEGL::GLFenceEGL() { display_ = eglGetCurrentDisplay(); sync_ = eglCreateSyncKHR(display_, EGL_SYNC_FENCE_KHR, NULL); @@ -33,10 +44,12 @@ void GLFenceEGL::ClientWait() { EGLint flags = 0; EGLTimeKHR time = EGL_FOREVER_KHR; EGLint result = eglClientWaitSyncKHR(display_, sync_, flags, time); - DCHECK_NE(EGL_TIMEOUT_EXPIRED_KHR, result); + DCHECK_IMPLIES(!g_ignore_egl_sync_failures, + EGL_TIMEOUT_EXPIRED_KHR == result); if (result == EGL_FALSE) { - LOG(FATAL) << "Failed to wait for EGLSync. error:" + LOG(ERROR) << "Failed to wait for EGLSync. error:" << ui::GetLastEGLErrorString(); + CHECK(g_ignore_egl_sync_failures); } } @@ -47,8 +60,9 @@ void GLFenceEGL::ServerWait() { } EGLint flags = 0; if (eglWaitSyncKHR(display_, sync_, flags) == EGL_FALSE) { - LOG(FATAL) << "Failed to wait for EGLSync. error:" + LOG(ERROR) << "Failed to wait for EGLSync. error:" << ui::GetLastEGLErrorString(); + CHECK(g_ignore_egl_sync_failures); } } diff --git a/ui/gl/gl_fence_egl.h b/ui/gl/gl_fence_egl.h index 5c4defb..5b6006c 100644 --- a/ui/gl/gl_fence_egl.h +++ b/ui/gl/gl_fence_egl.h @@ -13,6 +13,8 @@ namespace gfx { class GL_EXPORT GLFenceEGL : public GLFence { public: + static void SetIgnoreFailures(); + GLFenceEGL(); ~GLFenceEGL() override; |