Bug 1351349 - Blacklist Intel HD Graphics 510/520/530 for Windows 7 without platform update; r?dvander
MozReview-Commit-ID: F94OfZGBRQj
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -1116,16 +1116,19 @@ CompositorD3D11::EndFrame()
CD3D11_QUERY_DESC desc(D3D11_QUERY_EVENT);
mDevice->CreateQuery(&desc, getter_AddRefs(query));
if (query) {
mContext->End(query);
}
if (oldSize == mSize) {
Present();
+ if (gfxPrefs::CompositorClearState()) {
+ mContext->ClearState();
+ }
} else {
mDiagnostics->Cancel();
}
// Block until the previous frame's work has been completed.
if (mQuery) {
BOOL result;
WaitForGPUQuery(mDevice, mContext, mQuery, &result);
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -405,16 +405,17 @@ private:
DECL_GFX_PREF(Once, "gfx.apitrace.enabled", UseApitrace, bool, false);
#endif
#if defined(RELEASE_OR_BETA)
// "Skip" means this is locked to the default value in beta and release.
DECL_GFX_PREF(Skip, "gfx.blocklist.all", BlocklistAll, int32_t, 0);
#else
DECL_GFX_PREF(Once, "gfx.blocklist.all", BlocklistAll, int32_t, 0);
#endif
+ DECL_GFX_PREF(Live, "gfx.compositor.clearstate", CompositorClearState, bool, false);
DECL_GFX_PREF(Live, "gfx.canvas.auto_accelerate.min_calls", CanvasAutoAccelerateMinCalls, int32_t, 4);
DECL_GFX_PREF(Live, "gfx.canvas.auto_accelerate.min_frames", CanvasAutoAccelerateMinFrames, int32_t, 30);
DECL_GFX_PREF(Live, "gfx.canvas.auto_accelerate.min_seconds", CanvasAutoAccelerateMinSeconds, float, 5.0f);
DECL_GFX_PREF(Live, "gfx.canvas.azure.accelerated", CanvasAzureAccelerated, bool, false);
DECL_GFX_PREF(Once, "gfx.canvas.azure.accelerated.limit", CanvasAzureAcceleratedLimit, int32_t, 0);
// 0x7fff is the maximum supported xlib surface size and is more than enough for canvases.
DECL_GFX_PREF(Live, "gfx.canvas.max-size", MaxCanvasSize, int32_t, 0x7fff);
DECL_GFX_PREF(Once, "gfx.canvas.skiagl.cache-items", CanvasSkiaGLCacheItems, int32_t, 256);
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -13,16 +13,17 @@
#include "gfxWindowsSurface.h"
#include "nsUnicharUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Sprintf.h"
#include "mozilla/WindowsVersion.h"
+#include "nsIGfxInfo.h"
#include "nsServiceManagerUtils.h"
#include "nsTArray.h"
#include "mozilla/Telemetry.h"
#include "GeckoProfiler.h"
#include "nsIWindowsRegKey.h"
#include "nsIFile.h"
#include "plbase64.h"
@@ -1323,16 +1324,35 @@ gfxWindowsPlatform::InitializeD3D11Confi
FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING);
if (!gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) {
d3d11.DisableByDefault(FeatureStatus::Unavailable, "Hardware compositing is disabled",
NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D11_NEED_HWCOMP"));
return;
}
+ if (!IsWin8OrLater() &&
+ !DeviceManagerDx::Get()->CheckRemotePresentSupport()) {
+ nsCOMPtr<nsIGfxInfo> gfxInfo;
+ gfxInfo = services::GetGfxInfo();
+ nsAutoString adaptorId;
+ gfxInfo->GetAdapterDeviceID(adaptorId);
+ // Blacklist Intel HD Graphics 510/520/530 on Windows 7 without platform
+ // update due to the crashes in Bug 1351349.
+ if (adaptorId.EqualsLiteral("0x1912") || adaptorId.EqualsLiteral("0x1916") ||
+ adaptorId.EqualsLiteral("0x1902")) {
+#ifdef RELEASE_OR_BETA
+ d3d11.Disable(FeatureStatus::Blacklisted, "Blacklisted, see bug 1351349",
+ NS_LITERAL_CSTRING("FEATURE_FAILURE_BUG_1351349"));
+#else
+ gfxPrefs::SetCompositorClearState(true);
+#endif
+ }
+ }
+
d3d11.EnableByDefault();
nsCString message;
nsCString failureId;
if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, &message, failureId)) {
d3d11.Disable(FeatureStatus::Blacklisted, message.get(), failureId);
}