summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorboliu <boliu@chromium.org>2015-02-04 15:41:28 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-04 23:42:47 +0000
commit0599e81b61d2ab266a68dcce9d2b3c27e275f879 (patch)
tree7172c45eb3cd392e7ec76aeb582bfc692afe483f
parente27b1ef23206ea3352b4623184b3533b2bac4dcb (diff)
downloadchromium_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}
-rw-r--r--gpu/command_buffer/service/feature_info.cc10
-rw-r--r--gpu/config/gpu_driver_bug_list_json.cc18
-rw-r--r--gpu/config/gpu_driver_bug_workaround_type.h2
-rw-r--r--ui/gl/gl_fence_egl.cc20
-rw-r--r--ui/gl/gl_fence_egl.h2
5 files changed, 48 insertions, 4 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 5706086..803b121 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -17,6 +17,10 @@
#include "ui/gl/gl_fence.h"
#include "ui/gl/gl_implementation.h"
+#if !defined(OS_MACOSX)
+#include "ui/gl/gl_fence_egl.h"
+#endif
+
namespace gpu {
namespace gles2 {
@@ -1020,6 +1024,12 @@ void FeatureInfo::InitializeFeatures() {
texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES);
}
}
+
+#if !defined(OS_MACOSX)
+ if (workarounds_.ignore_egl_sync_failures) {
+ gfx::GLFenceEGL::SetIgnoreFailures();
+ }
+#endif
}
void FeatureInfo::AddExtensionString(const char* s) {
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index 26be952..382bcba 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "7.14",
+ "version": "7.15",
"entries": [
{
"id": 1,
@@ -1118,6 +1118,22 @@ LONG_STRING_CONST(
"features": [
"use_non_zero_size_for_client_side_stream_buffers"
]
+ },
+ {
+ "id": 99,
+ "description": "Qualcomm driver before Lollipop deletes egl sync objects after context destruction",
+ "cr_bugs": [453857],
+ "os": {
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "5.0.0"
+ }
+ },
+ "gl_vendor": "Qualcomm.*",
+ "features": [
+ "ignore_egl_sync_failures"
+ ]
}
]
}
diff --git a/gpu/config/gpu_driver_bug_workaround_type.h b/gpu/config/gpu_driver_bug_workaround_type.h
index 77d721b..f03b7a2 100644
--- a/gpu/config/gpu_driver_bug_workaround_type.h
+++ b/gpu/config/gpu_driver_bug_workaround_type.h
@@ -58,6 +58,8 @@
gl_begin_gl_end_on_fbo_change_to_backbuffer) \
GPU_OP(GL_CLEAR_BROKEN, \
gl_clear_broken) \
+ GPU_OP(IGNORE_EGL_SYNC_FAILURES, \
+ ignore_egl_sync_failures) \
GPU_OP(INIT_GL_POSITION_IN_VERTEX_SHADER, \
init_gl_position_in_vertex_shader) \
GPU_OP(INIT_TEXTURE_MAX_ANISOTROPY, \
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;