Bug 986253 - Limt a number of Fence to 4 per message r=nical
authorSotaro Ikeda <sikeda@mozilla.com>
Fri, 21 Mar 2014 09:57:01 -0700
changeset 174752 05e914ac24e0e864a6e5a1e9945fb113991e3f40
parent 174751 13e18bc71938295b19cc053d127e56f8d07c835d
child 174753 730cd4ede580c03d33c6024b01c8bc90ecf96cec
push id5621
push usersikeda@mozilla.com
push dateFri, 21 Mar 2014 16:57:21 +0000
treeherderb2g-inbound@05e914ac24e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs986253
milestone31.0a1
Bug 986253 - Limt a number of Fence to 4 per message r=nical
gfx/layers/ipc/CompositableTransactionParent.cpp
--- a/gfx/layers/ipc/CompositableTransactionParent.cpp
+++ b/gfx/layers/ipc/CompositableTransactionParent.cpp
@@ -313,16 +313,21 @@ CompositableParentManager::ReturnTexture
   if (!aCompositable || !aCompositable->GetCompositableBackendSpecificData()) {
     return;
   }
 
   const std::vector< RefPtr<TextureHost> > textureList =
         aCompositable->GetCompositableBackendSpecificData()->GetPendingReleaseFenceTextureList();
   // Return pending Texture data
   for (size_t i = 0; i < textureList.size(); i++) {
+    // File descriptor number is limited to 4 per IPC message.
+    // See Bug 986253
+    if (mPrevFenceHandles.size() >= 4) {
+      break;
+    }
     TextureHostOGL* hostOGL = textureList[i]->AsHostOGL();
     PTextureParent* actor = textureList[i]->GetIPDLActor();
     if (!hostOGL || !actor) {
       continue;
     }
     android::sp<android::Fence> fence = hostOGL->GetAndResetReleaseFence();
     if (fence.get() && fence->isValid()) {
       FenceHandle handle = FenceHandle(fence);