Bug 848481 - ♫ Don't say ClientWaitSync unless FOREVER ♫ - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 07 May 2013 16:09:09 -0400
changeset 142117 6bf36fe4389681e4b98f48b92510ff489bb31e51
parent 142116 51b1dc857800d1d42b32392d53d65cd74b0924e6
child 142118 d571f60b80fddbc8026a9368960b8e3ba86cc5fb
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs848481
milestone23.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 848481 - ♫ Don't say ClientWaitSync unless FOREVER ♫ - r=jgilbert This fixes a flickering bug with some NVIDIA drivers. From the comment: Wait FOREVER, primarily because some NVIDIA (at least Tegra) drivers have ClientWaitSync returning immediately if the timeout delay is anything else than FOREVER. FIXME: should we try to use a finite timeout delay where possible?
gfx/gl/SharedSurfaceEGL.cpp
--- a/gfx/gl/SharedSurfaceEGL.cpp
+++ b/gfx/gl/SharedSurfaceEGL.cpp
@@ -182,23 +182,25 @@ SharedSurface_EGLImage::WaitSync()
 {
     MutexAutoLock lock(mMutex);
     if (!mSync) {
         // We must not be needed.
         return true;
     }
     MOZ_ASSERT(mEGL->IsExtensionSupported(GLLibraryEGL::KHR_fence_sync));
 
-    EGLTime waitMS = 500;
-    const EGLTime nsPerMS = 1000 * 1000;
-    EGLTime waitNS = waitMS * nsPerMS;
+    // Wait FOREVER, primarily because some NVIDIA (at least Tegra) drivers
+    // have ClientWaitSync returning immediately if the timeout delay is anything
+    // else than FOREVER.
+    //
+    // FIXME: should we try to use a finite timeout delay where possible?
     EGLint status = mEGL->fClientWaitSync(Display(),
                                           mSync,
                                           0,
-                                          waitNS);
+                                          LOCAL_EGL_FOREVER);
 
     if (status != LOCAL_EGL_CONDITION_SATISFIED) {
         return false;
     }
 
     MOZ_ALWAYS_TRUE( mEGL->fDestroySync(Display(), mSync) );
     mSync = 0;