Bug 1409141 - Disable D3D11 YUV buffer copy on Windows 7. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 16 Oct 2017 22:03:18 +0200
changeset 386464 974ca2f1faf5e11c74b81e1793df37a74e048b48
parent 386463 e34bf13e7042c473bacb2202d0e40393b5f38c9e
child 386465 0c726b9345fb01251f1a1e0f146d62df644096fb
push id32694
push userarchaeopteryx@coole-files.de
push dateTue, 17 Oct 2017 09:43:13 +0000
treeherdermozilla-central@3bd3448d9684 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1409141
milestone58.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 1409141 - Disable D3D11 YUV buffer copy on Windows 7. r=mattwoodrow The crashes on Windows 7 appear to occur due to the D3D11 device being used on two different threads simultaneously. We do query the driver to determine if multithreaded access is supported, but they obviously aren't that cluey about it. MozReview-Commit-ID: GZIk1Zf9xKQ
dom/media/MediaData.cpp
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -12,16 +12,17 @@
 #include "YCbCrUtils.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/KnowsCompositor.h"
 #include "mozilla/layers/SharedRGBImage.h"
 
 #include <stdint.h>
 
 #ifdef XP_WIN
+#include "mozilla/WindowsVersion.h"
 #include "mozilla/layers/D3D11YCbCrImage.h"
 #endif
 
 namespace mozilla {
 
 using namespace mozilla::gfx;
 using layers::ImageContainer;
 using layers::PlanarYCbCrImage;
@@ -314,17 +315,19 @@ VideoData::CreateAndCopyData(const Video
                                     aKeyframe,
                                     aTimecode,
                                     aInfo.mDisplay,
                                     0));
 
   // Currently our decoder only knows how to output to ImageFormat::PLANAR_YCBCR
   // format.
 #if XP_WIN
-  if (!XRE_IsParentProcess() &&
+  // We disable this code path on Windows version earlier of Windows 8 due to
+  // intermittent crashes with old drivers. See bug 1405110.
+  if (IsWin8OrLater() && !XRE_IsParentProcess() &&
       aAllocator && aAllocator->GetCompositorBackendType()
                     == layers::LayersBackend::LAYERS_D3D11) {
     RefPtr<layers::D3D11YCbCrImage> d3d11Image = new layers::D3D11YCbCrImage();
     PlanarYCbCrData data = ConstructPlanarYCbCrData(aInfo, aBuffer, aPicture);
     if (d3d11Image->SetData(layers::ImageBridgeChild::GetSingleton()
                             ? layers::ImageBridgeChild::GetSingleton().get()
                             : aAllocator,
                             aContainer, data)) {