Bug 1359416: Allow blocklisting of D3D11 keyed mutex and block it for Intel Gen 6. r=bas,dvander

MozReview-Commit-ID: 2u7N5qhHhD1

--HG--
extra : rebase_source : 3a8ccc658d1b83d470f1bbeef4520779c1766919
This commit is contained in:
Milan Sreckovic 2017-07-25 14:02:36 -04:00
Родитель 3e51e83fa4
Коммит ebe72eb0d5
7 изменённых файлов: 40 добавлений и 12 удалений

Просмотреть файл

@ -39,6 +39,7 @@ class gfxVarReceiver;
_(ScreenDepth, int32_t, 0) \
_(GREDirectory, nsCString, nsCString()) \
_(UseOMTP, bool, false) \
_(AllowD3D11KeyedMutex, bool, false) \
/* Add new entries above this line. */

Просмотреть файл

@ -15,6 +15,7 @@
#include "mozilla/gfx/GPUParent.h"
#include "mozilla/gfx/GraphicsMessages.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/layers/CompositorBridgeChild.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
@ -944,12 +945,8 @@ 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 || gfxPrefs::Direct3D11AllowIntelMutex());
return mDeviceStatus && gfxPrefs::Direct3D11AllowKeyedMutex() &&
gfxVars::AllowD3D11KeyedMutex();
}
bool

Просмотреть файл

@ -2285,16 +2285,27 @@ gfxPlatform::InitAcceleration()
gfxPrefs::GetSingleton();
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString discardFailureId;
int32_t status;
if (XRE_IsParentProcess()) {
gfxVars::SetBrowserTabsRemoteAutostart(BrowserTabsRemoteAutostart());
gfxVars::SetOffscreenFormat(GetOffscreenFormat());
gfxVars::SetRequiresAcceleratedGLContextForCompositorOGL(
RequiresAcceleratedGLContextForCompositorOGL());
#ifdef XP_WIN
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX,
discardFailureId, &status))) {
gfxVars::SetAllowD3D11KeyedMutex(status == nsIGfxInfo::FEATURE_STATUS_OK);
} else {
// If we couldn't properly evaluate the status, err on the side
// of caution and give this functionality to the user.
gfxCriticalNote << "Cannot evaluate keyed mutex feature status";
gfxVars::SetAllowD3D11KeyedMutex(true);
}
#endif
}
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString discardFailureId;
int32_t status;
if (Preferences::GetBool("media.hardware-video-decoding.enabled", false) &&
#ifdef XP_WIN

Просмотреть файл

@ -437,7 +437,7 @@ private:
DECL_GFX_PREF(Once, "gfx.direct2d.disabled", Direct2DDisabled, bool, false);
DECL_GFX_PREF(Once, "gfx.direct2d.force-enabled", Direct2DForceEnabled, bool, false);
DECL_GFX_PREF(Live, "gfx.direct3d11.reuse-decoder-device", Direct3D11ReuseDecoderDevice, int32_t, -1);
DECL_GFX_PREF(Live, "gfx.direct3d11.allow-intel-mutex", Direct3D11AllowIntelMutex, bool, true);
DECL_GFX_PREF(Live, "gfx.direct3d11.allow-keyed-mutex", Direct3D11AllowKeyedMutex, bool, true);
DECL_GFX_PREF(Live, "gfx.direct3d11.use-double-buffering", Direct3D11UseDoubleBuffering, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.enable-debug-layer", Direct3D11EnableDebugLayer, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.break-on-error", Direct3D11BreakOnError, bool, false);

Просмотреть файл

@ -173,6 +173,9 @@ GetPrefNameForFeature(int32_t aFeature)
case nsIGfxInfo::FEATURE_ADVANCED_LAYERS:
name = BLACKLIST_PREF_BRANCH "layers.advanced";
break;
case nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX:
name = BLACKLIST_PREF_BRANCH "d3d11.keyed.mutex";
break;
case nsIGfxInfo::FEATURE_VP8_HW_DECODE:
case nsIGfxInfo::FEATURE_VP9_HW_DECODE:
case nsIGfxInfo::FEATURE_DX_INTEROP2:
@ -355,6 +358,8 @@ BlacklistFeatureToGfxFeature(const nsAString& aFeature)
return nsIGfxInfo::FEATURE_WEBGL2;
else if (aFeature.EqualsLiteral("ADVANCED_LAYERS"))
return nsIGfxInfo::FEATURE_ADVANCED_LAYERS;
else if (aFeature.EqualsLiteral("D3D11_KEYED_MUTEX"))
return nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX;
// If we don't recognize the feature, it may be new, and something
// this version doesn't understand. So, nothing to do. This is
@ -986,6 +991,7 @@ GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo)
nsIGfxInfo::FEATURE_CANVAS2D_ACCELERATION,
nsIGfxInfo::FEATURE_WEBGL2,
nsIGfxInfo::FEATURE_ADVANCED_LAYERS,
nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX,
0
};

Просмотреть файл

@ -126,8 +126,10 @@ interface nsIGfxInfo : nsISupports
const long FEATURE_WEBGL2 = 21;
/* Whether Advanced Layers is supported, starting in 56 */
const long FEATURE_ADVANCED_LAYERS = 22;
/* Whether D3D11 keyed mutex is supported, starting in 56 */
const long FEATURE_D3D11_KEYED_MUTEX = 23;
/* the maximum feature value. */
const long FEATURE_MAX_VALUE = FEATURE_ADVANCED_LAYERS;
const long FEATURE_MAX_VALUE = FEATURE_D3D11_KEYED_MUTEX;
/*
* A set of return values from GetFeatureStatus

Просмотреть файл

@ -1318,6 +1318,17 @@ GfxInfo::GetGfxDriverInfo()
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAMD), GfxDriverInfo::allDevices,
nsIGfxInfo::FEATURE_DX_INTEROP2, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "DX_INTEROP2_AMD_CRASH");
////////////////////////////////////
// FEATURE_D3D11_KEYED_MUTEX
// bug 1359416
APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows,
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel),
(GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(IntelHDGraphicsToSandyBridge),
nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_BUG_1359416");
}
return *mDriverInfo;
}