From 3feadaf7d6aabe7d2bdd686168807ac928b4409b Mon Sep 17 00:00:00 2001 From: Sotaro Ikeda Date: Tue, 24 Jun 2014 08:59:59 -0700 Subject: [PATCH] Bug 1022205 - disable sync fence on AdrenoTM200 r=jgilbert --- gfx/gl/GLContext.cpp | 1 + gfx/gl/GLContext.h | 1 + gfx/gl/SharedSurfaceGralloc.cpp | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index a5d25bf8660e..ba9d4a376223 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -579,6 +579,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl) const char *rendererMatchStrings[size_t(GLRenderer::Other)] = { "Adreno 200", "Adreno 205", + "Adreno (TM) 200", "Adreno (TM) 205", "Adreno (TM) 320", "PowerVR SGX 530", diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index 563f2148eda6..61922cb7cce8 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -138,6 +138,7 @@ MOZ_END_ENUM_CLASS(GLVendor) MOZ_BEGIN_ENUM_CLASS(GLRenderer) Adreno200, Adreno205, + AdrenoTM200, AdrenoTM205, AdrenoTM320, SGX530, diff --git a/gfx/gl/SharedSurfaceGralloc.cpp b/gfx/gl/SharedSurfaceGralloc.cpp index c1e6f2b03d5d..c7662746299a 100644 --- a/gfx/gl/SharedSurfaceGralloc.cpp +++ b/gfx/gl/SharedSurfaceGralloc.cpp @@ -169,10 +169,19 @@ SharedSurface_Gralloc::Fence() mSync = 0; } + bool disableSyncFence = false; + // Disable sync fence on AdrenoTM200. + // AdrenoTM200's sync fence does not work correctly. See Bug 1022205. + if (mGL->Renderer() == GLRenderer::AdrenoTM200) { + disableSyncFence = true; + } + // When Android native fences are available, try // them first since they're more likely to work. // Android native fences are also likely to perform better. - if (mEGL->IsExtensionSupported(GLLibraryEGL::ANDROID_native_fence_sync)) { + if (!disableSyncFence && + mEGL->IsExtensionSupported(GLLibraryEGL::ANDROID_native_fence_sync)) + { mGL->MakeCurrent(); EGLSync sync = mEGL->fCreateSync(mEGL->Display(), LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID, @@ -196,7 +205,9 @@ SharedSurface_Gralloc::Fence() } } - if (mEGL->IsExtensionSupported(GLLibraryEGL::KHR_fence_sync)) { + if (!disableSyncFence && + mEGL->IsExtensionSupported(GLLibraryEGL::KHR_fence_sync)) + { mGL->MakeCurrent(); mSync = mEGL->fCreateSync(mEGL->Display(), LOCAL_EGL_SYNC_FENCE, -- 2.11.4.GIT