Bug 1131793 - Disable SurfaceTexture detach on Mali. r=jgilbert, a=lmandel
authorJames Willcox <snorp@snorp.net>
Fri, 13 Feb 2015 16:59:03 -0600
changeset 249801 02451c7d1558e2967b7f63fa79074d2a2f8bd38e
parent 249800 69ce849146bfd00550183871a4d82661080615a5
child 249802 f67ec464e569a294723045ed3f224441b5481c3a
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, lmandel
bugs1131793
milestone37.0a2
Bug 1131793 - Disable SurfaceTexture detach on Mali. r=jgilbert, a=lmandel
gfx/gl/AndroidSurfaceTexture.cpp
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
--- a/gfx/gl/AndroidSurfaceTexture.cpp
+++ b/gfx/gl/AndroidSurfaceTexture.cpp
@@ -124,19 +124,21 @@ AndroidSurfaceTexture::Detach()
   lock.NotifyAll();
   return NS_OK;
 }
 
 void
 AndroidSurfaceTexture::UpdateCanDetach()
 {
   // The API for attach/detach only exists on 16+, and PowerVR has some sort of
-  // fencing issue.
+  // fencing issue. Additionally, attach/detach seems to be busted on at least some
+  // Mali adapters (400MP2 for sure, bug 1131793)
   mCanDetach = AndroidBridge::Bridge()->GetAPIVersion() >= 16 &&
-    (!mAttachedContext || mAttachedContext->Vendor() != GLVendor::Imagination);
+    (!mAttachedContext || mAttachedContext->Vendor() != GLVendor::Imagination) &&
+    (!mAttachedContext || mAttachedContext->Vendor() != GLVendor::ARM /* Mali */);
 }
 
 bool
 AndroidSurfaceTexture::Init(GLContext* aContext, GLuint aTexture)
 {
   UpdateCanDetach();
 
   if (!aTexture && !CanDetach()) {
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -577,17 +577,18 @@ GLContext::InitWithPrefix(const char *pr
         const char *vendorMatchStrings[size_t(GLVendor::Other)] = {
                 "Intel",
                 "NVIDIA",
                 "ATI",
                 "Qualcomm",
                 "Imagination",
                 "nouveau",
                 "Vivante",
-                "VMware, Inc."
+                "VMware, Inc.",
+                "ARM"
         };
 
         mVendor = GLVendor::Other;
         for (size_t i = 0; i < size_t(GLVendor::Other); ++i) {
             if (DoesStringMatch(glVendorString, vendorMatchStrings[i])) {
                 mVendor = GLVendor(i);
                 break;
             }
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -148,16 +148,17 @@ MOZ_BEGIN_ENUM_CLASS(GLVendor)
     Intel,
     NVIDIA,
     ATI,
     Qualcomm,
     Imagination,
     Nouveau,
     Vivante,
     VMware,
+    ARM,
     Other
 MOZ_END_ENUM_CLASS(GLVendor)
 
 MOZ_BEGIN_ENUM_CLASS(GLRenderer)
     Adreno200,
     Adreno205,
     AdrenoTM200,
     AdrenoTM205,