Bug 1022205 - disable sync fence on AdrenoTM200 r=jgilbert
authorSotaro Ikeda <sikeda@mozilla.com>
Tue, 24 Jun 2014 08:59:59 -0700
changeset 190529 ebac3a17de53
parent 190528 466f0306124e
child 190530 cf816b147823
push id27009
push userkwierso@gmail.com
push date2014-06-25 01:13 +0000
treeherdermozilla-central@a19e0434ea52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1022205
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1022205 - disable sync fence on AdrenoTM200 r=jgilbert
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
gfx/gl/SharedSurfaceGralloc.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -574,16 +574,17 @@ GLContext::InitWithPrefix(const char *pr
         // defined in GLContext.h for renderer IDs
         glRendererString = (const char *)fGetString(LOCAL_GL_RENDERER);
         if (!glRendererString)
             mInitialized = false;
 
         const char *rendererMatchStrings[size_t(GLRenderer::Other)] = {
                 "Adreno 200",
                 "Adreno 205",
+                "Adreno (TM) 200",
                 "Adreno (TM) 205",
                 "Adreno (TM) 320",
                 "PowerVR SGX 530",
                 "PowerVR SGX 540",
                 "NVIDIA Tegra",
                 "Android Emulator",
                 "Gallium 0.4 on llvmpipe",
                 "Intel HD Graphics 3000 OpenGL Engine",
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -133,16 +133,17 @@ MOZ_BEGIN_ENUM_CLASS(GLVendor)
     Vivante,
     VMware,
     Other
 MOZ_END_ENUM_CLASS(GLVendor)
 
 MOZ_BEGIN_ENUM_CLASS(GLRenderer)
     Adreno200,
     Adreno205,
+    AdrenoTM200,
     AdrenoTM205,
     AdrenoTM320,
     SGX530,
     SGX540,
     Tegra,
     AndroidEmulator,
     GalliumLlvmpipe,
     IntelHD3000,
--- a/gfx/gl/SharedSurfaceGralloc.cpp
+++ b/gfx/gl/SharedSurfaceGralloc.cpp
@@ -164,20 +164,29 @@ SharedSurface_Gralloc::~SharedSurface_Gr
 void
 SharedSurface_Gralloc::Fence()
 {
     if (mSync) {
         MOZ_ALWAYS_TRUE( mEGL->fDestroySync(mEGL->Display(), mSync) );
         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,
                                          nullptr);
         if (sync) {
             mGL->fFlush();
 #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
             int fenceFd = mEGL->fDupNativeFenceFDANDROID(mEGL->Display(), sync);
@@ -191,17 +200,19 @@ SharedSurface_Gralloc::Fence()
             }
 #else
             mSync = sync;
 #endif
             return;
         }
     }
 
-    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,
                                   nullptr);
         if (mSync) {
             mGL->fFlush();
             return;
         }