зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
3e51e83fa4
Коммит
ebe72eb0d5
|
@ -39,6 +39,7 @@ class gfxVarReceiver;
|
||||||
_(ScreenDepth, int32_t, 0) \
|
_(ScreenDepth, int32_t, 0) \
|
||||||
_(GREDirectory, nsCString, nsCString()) \
|
_(GREDirectory, nsCString, nsCString()) \
|
||||||
_(UseOMTP, bool, false) \
|
_(UseOMTP, bool, false) \
|
||||||
|
_(AllowD3D11KeyedMutex, bool, false) \
|
||||||
|
|
||||||
/* Add new entries above this line. */
|
/* Add new entries above this line. */
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "mozilla/gfx/GPUParent.h"
|
#include "mozilla/gfx/GPUParent.h"
|
||||||
#include "mozilla/gfx/GraphicsMessages.h"
|
#include "mozilla/gfx/GraphicsMessages.h"
|
||||||
#include "mozilla/gfx/Logging.h"
|
#include "mozilla/gfx/Logging.h"
|
||||||
|
#include "mozilla/gfx/gfxVars.h"
|
||||||
#include "mozilla/layers/CompositorBridgeChild.h"
|
#include "mozilla/layers/CompositorBridgeChild.h"
|
||||||
#include "mozilla/layers/CompositorThread.h"
|
#include "mozilla/layers/CompositorThread.h"
|
||||||
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
|
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
|
||||||
|
@ -944,12 +945,8 @@ bool
|
||||||
DeviceManagerDx::CanInitializeKeyedMutexTextures()
|
DeviceManagerDx::CanInitializeKeyedMutexTextures()
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(mDeviceLock);
|
MutexAutoLock lock(mDeviceLock);
|
||||||
if (!mDeviceStatus) {
|
return mDeviceStatus && gfxPrefs::Direct3D11AllowKeyedMutex() &&
|
||||||
return false;
|
gfxVars::AllowD3D11KeyedMutex();
|
||||||
}
|
|
||||||
// Disable this on all Intel devices because of crashes.
|
|
||||||
// See bug 1292923.
|
|
||||||
return (mDeviceStatus->adapter().VendorId != 0x8086 || gfxPrefs::Direct3D11AllowIntelMutex());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -2285,17 +2285,28 @@ gfxPlatform::InitAcceleration()
|
||||||
|
|
||||||
gfxPrefs::GetSingleton();
|
gfxPrefs::GetSingleton();
|
||||||
|
|
||||||
|
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
|
||||||
|
nsCString discardFailureId;
|
||||||
|
int32_t status;
|
||||||
|
|
||||||
if (XRE_IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
gfxVars::SetBrowserTabsRemoteAutostart(BrowserTabsRemoteAutostart());
|
gfxVars::SetBrowserTabsRemoteAutostart(BrowserTabsRemoteAutostart());
|
||||||
gfxVars::SetOffscreenFormat(GetOffscreenFormat());
|
gfxVars::SetOffscreenFormat(GetOffscreenFormat());
|
||||||
gfxVars::SetRequiresAcceleratedGLContextForCompositorOGL(
|
gfxVars::SetRequiresAcceleratedGLContextForCompositorOGL(
|
||||||
RequiresAcceleratedGLContextForCompositorOGL());
|
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) &&
|
if (Preferences::GetBool("media.hardware-video-decoding.enabled", false) &&
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
Preferences::GetBool("media.windows-media-foundation.use-dxva", true) &&
|
Preferences::GetBool("media.windows-media-foundation.use-dxva", true) &&
|
||||||
|
|
|
@ -437,7 +437,7 @@ private:
|
||||||
DECL_GFX_PREF(Once, "gfx.direct2d.disabled", Direct2DDisabled, bool, false);
|
DECL_GFX_PREF(Once, "gfx.direct2d.disabled", Direct2DDisabled, bool, false);
|
||||||
DECL_GFX_PREF(Once, "gfx.direct2d.force-enabled", Direct2DForceEnabled, 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.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(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.enable-debug-layer", Direct3D11EnableDebugLayer, bool, false);
|
||||||
DECL_GFX_PREF(Once, "gfx.direct3d11.break-on-error", Direct3D11BreakOnError, 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:
|
case nsIGfxInfo::FEATURE_ADVANCED_LAYERS:
|
||||||
name = BLACKLIST_PREF_BRANCH "layers.advanced";
|
name = BLACKLIST_PREF_BRANCH "layers.advanced";
|
||||||
break;
|
break;
|
||||||
|
case nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX:
|
||||||
|
name = BLACKLIST_PREF_BRANCH "d3d11.keyed.mutex";
|
||||||
|
break;
|
||||||
case nsIGfxInfo::FEATURE_VP8_HW_DECODE:
|
case nsIGfxInfo::FEATURE_VP8_HW_DECODE:
|
||||||
case nsIGfxInfo::FEATURE_VP9_HW_DECODE:
|
case nsIGfxInfo::FEATURE_VP9_HW_DECODE:
|
||||||
case nsIGfxInfo::FEATURE_DX_INTEROP2:
|
case nsIGfxInfo::FEATURE_DX_INTEROP2:
|
||||||
|
@ -355,6 +358,8 @@ BlacklistFeatureToGfxFeature(const nsAString& aFeature)
|
||||||
return nsIGfxInfo::FEATURE_WEBGL2;
|
return nsIGfxInfo::FEATURE_WEBGL2;
|
||||||
else if (aFeature.EqualsLiteral("ADVANCED_LAYERS"))
|
else if (aFeature.EqualsLiteral("ADVANCED_LAYERS"))
|
||||||
return nsIGfxInfo::FEATURE_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
|
// If we don't recognize the feature, it may be new, and something
|
||||||
// this version doesn't understand. So, nothing to do. This is
|
// 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_CANVAS2D_ACCELERATION,
|
||||||
nsIGfxInfo::FEATURE_WEBGL2,
|
nsIGfxInfo::FEATURE_WEBGL2,
|
||||||
nsIGfxInfo::FEATURE_ADVANCED_LAYERS,
|
nsIGfxInfo::FEATURE_ADVANCED_LAYERS,
|
||||||
|
nsIGfxInfo::FEATURE_D3D11_KEYED_MUTEX,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -126,8 +126,10 @@ interface nsIGfxInfo : nsISupports
|
||||||
const long FEATURE_WEBGL2 = 21;
|
const long FEATURE_WEBGL2 = 21;
|
||||||
/* Whether Advanced Layers is supported, starting in 56 */
|
/* Whether Advanced Layers is supported, starting in 56 */
|
||||||
const long FEATURE_ADVANCED_LAYERS = 22;
|
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. */
|
/* 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
|
* A set of return values from GetFeatureStatus
|
||||||
|
|
|
@ -1318,6 +1318,17 @@ GfxInfo::GetGfxDriverInfo()
|
||||||
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAMD), GfxDriverInfo::allDevices,
|
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAMD), GfxDriverInfo::allDevices,
|
||||||
nsIGfxInfo::FEATURE_DX_INTEROP2, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
|
nsIGfxInfo::FEATURE_DX_INTEROP2, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
|
||||||
DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "DX_INTEROP2_AMD_CRASH");
|
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;
|
return *mDriverInfo;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче