Backed out changeset d35d695f921d (bug 1292923) for troubles with windows refrests
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 06 Oct 2016 14:33:29 +0200
changeset 316739 da986c9f1f723af1e0c44f4ccd4cddd5fb6084e8
parent 316738 89b7b2412095859fcdb3f1eb0a3e06e796100bd4
child 316749 8282815e55598b0099a613758d19b232b75b3d74
child 316811 14fb96dbce5ef3388e4f9e8fb990975495a19e8f
child 316848 fdda673f01a75e908a3fd50d2975931a2c753381
push id30781
push usercbook@mozilla.com
push dateThu, 06 Oct 2016 12:35:09 +0000
treeherdermozilla-central@da986c9f1f72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1292923
milestone52.0a1
backs outd35d695f921df1073b1a1d93520e872a0e1547f5
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
Backed out changeset d35d695f921d (bug 1292923) for troubles with windows refrests
gfx/layers/IMFYCbCrImage.cpp
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/d3d11/TextureD3D11.cpp
gfx/thebes/DeviceManagerDx.cpp
gfx/thebes/DeviceManagerDx.h
--- a/gfx/layers/IMFYCbCrImage.cpp
+++ b/gfx/layers/IMFYCbCrImage.cpp
@@ -232,20 +232,16 @@ IMFYCbCrImage::GetTextureClient(KnowsCom
   if (!device || backend != LayersBackend::LAYERS_D3D11) {
     if (backend == LayersBackend::LAYERS_D3D9 ||
         backend == LayersBackend::LAYERS_D3D11) {
       return GetD3D9TextureClient(aForwarder);
     }
     return nullptr;
   }
 
-  if (!gfx::DeviceManagerDx::Get()->CanInitializeKeyedMutexTextures()) {
-    return nullptr;
-  }
-
   if (mData.mYStride < 0 || mData.mCbCrStride < 0) {
     // D3D11 only supports unsigned stride values.
     return nullptr;
   }
 
   CD3D11_TEXTURE2D_DESC newDesc(DXGI_FORMAT_R8_UNORM,
                                 mData.mYSize.width, mData.mYSize.height, 1, 1);
 
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -1083,18 +1083,17 @@ TextureClient::CreateForDrawing(TextureF
 
 #ifdef XP_WIN
   if (aLayersBackend == LayersBackend::LAYERS_D3D11 &&
       (moz2DBackend == gfx::BackendType::DIRECT2D ||
        moz2DBackend == gfx::BackendType::DIRECT2D1_1 ||
        (!!(aAllocFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT) &&
         DeviceManagerDx::Get()->GetContentDevice())) &&
       aSize.width <= aMaxTextureSize &&
-      aSize.height <= aMaxTextureSize &&
-      !(aAllocFlags & ALLOC_UPDATE_FROM_SURFACE))
+      aSize.height <= aMaxTextureSize)
   {
     data = DXGITextureData::Create(aSize, aFormat, aAllocFlags);
   }
   if (aLayersBackend == LayersBackend::LAYERS_D3D9 &&
       moz2DBackend == gfx::BackendType::CAIRO &&
       aAllocator->IsSameProcess() &&
       aSize.width <= aMaxTextureSize &&
       aSize.height <= aMaxTextureSize &&
@@ -1199,17 +1198,17 @@ TextureClient::CreateFromSurface(KnowsCo
 
   if (data) {
     return MakeAndAddRef<TextureClient>(data, aTextureFlags, aAllocator->GetTextureForwarder());
   }
 
   // Fall back to using UpdateFromSurface
 
   RefPtr<TextureClient> client = CreateForDrawing(aAllocator, aSurface->GetFormat(), size,
-                                                  aSelector, aTextureFlags, aAllocFlags | ALLOC_UPDATE_FROM_SURFACE);
+                                                  aSelector, aTextureFlags, aAllocFlags);
   if (!client) {
     return nullptr;
   }
 
   TextureClientAutoLock autoLock(client, OpenMode::OPEN_WRITE_ONLY);
   if (!autoLock.Succeeded()) {
     return nullptr;
   }
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -85,20 +85,16 @@ enum TextureAllocationFlags {
   // Allocate the texture for out-of-band content updates. This is mostly for
   // TextureClientD3D11, which may otherwise choose D3D10 or non-KeyedMutex
   // surfaces when used on the main thread.
   ALLOC_FOR_OUT_OF_BAND_CONTENT = 1 << 5,
 
   // Disable any cross-device synchronization. This is also for TextureClientD3D11,
   // and creates a texture without KeyedMutex.
   ALLOC_MANUAL_SYNCHRONIZATION = 1 << 6,
-
-  // The texture is going to be updated using UpdateFromSurface and needs to support
-  // that call.
-  ALLOC_UPDATE_FROM_SURFACE = 1 << 7,
 };
 
 #ifdef XP_WIN
 typedef void* SyncHandle;
 #else
 typedef uintptr_t SyncHandle;
 #endif // XP_WIN
 
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -378,21 +378,16 @@ D3D11TextureData::Create(IntSize aSize, 
   newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
   if (!NS_IsMainThread() || !!(aFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT)) {
     // On the main thread we use the syncobject to handle synchronization.
     if (!(aFlags & ALLOC_MANUAL_SYNCHRONIZATION)) {
       newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
     }
   }
 
-  if (aSurface && newDesc.MiscFlags == D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX &&
-      !DeviceManagerDx::Get()->CanInitializeKeyedMutexTextures()) {
-    return nullptr;
-  }
-
   D3D11_SUBRESOURCE_DATA uploadData;
   D3D11_SUBRESOURCE_DATA* uploadDataPtr = nullptr;
   RefPtr<DataSourceSurface> srcSurf;
   if (aSurface) {
     srcSurf = aSurface->GetDataSurface();
 
     if (!srcSurf) {
       gfxCriticalError() << "Failed to GetDataSurface in D3D11TextureData::Create";
--- a/gfx/thebes/DeviceManagerDx.cpp
+++ b/gfx/thebes/DeviceManagerDx.cpp
@@ -666,28 +666,16 @@ DeviceManagerDx::TextureSharingWorks()
   MutexAutoLock lock(mDeviceLock);
   if (!mDeviceStatus) {
     return false;
   }
   return mDeviceStatus->textureSharingWorks();
 }
 
 bool
-DeviceManagerDx::CanInitializeKeyedMutexTextures()
-{
-  MutexAutoLock lock(mDeviceLock);
-  if (!mDeviceStatus) {
-    return false;
-  }
-  // Disable this on all Intel devices because of crashes.
-  // See bug 1292923.
-  return mDeviceStatus->adapter().VendorId != 0x8086;
-}
-
-bool
 DeviceManagerDx::IsWARP()
 {
   MutexAutoLock lock(mDeviceLock);
   if (!mDeviceStatus) {
     return false;
   }
   return mDeviceStatus->isWARP();
 }
--- a/gfx/thebes/DeviceManagerDx.h
+++ b/gfx/thebes/DeviceManagerDx.h
@@ -55,23 +55,16 @@ public:
   RefPtr<ID3D11Device> GetContentDevice();
   RefPtr<ID3D11Device> CreateDecoderDevice();
   IDirectDraw7* GetDirectDraw();
 
   unsigned GetCompositorFeatureLevel() const;
   bool TextureSharingWorks();
   bool IsWARP();
 
-  // Returns true if we can create a texture with
-  // D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX and also
-  // upload texture data during the CreateTexture2D
-  // call. This crashes on some devices, so we might
-  // need to avoid it.
-  bool CanInitializeKeyedMutexTextures();
-
   bool CreateCompositorDevices();
   void CreateContentDevices();
 
   void ImportDeviceInfo(const D3D11DeviceStatus& aDeviceStatus);
   void ExportDeviceInfo(D3D11DeviceStatus* aOut);
 
   void ResetDevices();
   void InitializeDirectDraw();