Bug 1678684 - Initialize DXVA on the media thread, remove the mostly-unused dll blocklist, and the crashguard. r=jya

The main-thread requirements for DXVA appear to have been needed when we initialized a crash guard. We now only run DXVA in the GPU and RDD processes, which don't support crash guards. This removes the main thread dispatch and the crashguard code, and enforces that we're in the GPU/RDD process to init DXVA.

This also removes the DLL blocklist code. This was disabled via pref when in the GPU process, which should be the majority of the time. In rare cases we would have been running DXVA in the RDD process (on older win7 when the GPU process isn't available). In these cases we can just do the same as the GPU process, allowing crashes and recovering from them (and disabling DXVA).

Differential Revision: https://phabricator.services.mozilla.com/D98036
This commit is contained in:
Matt Woodrow 2020-12-14 06:04:13 +00:00
Родитель 23c25cd32a
Коммит 4e7f9b4789
12 изменённых файлов: 35 добавлений и 471 удалений

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

@ -552,13 +552,7 @@ const startupPhases = {
],
};
for (let name of [
"d3d11layers",
"d3d9video",
"glcontext",
"d3d11video",
"wmfvpxvideo",
]) {
for (let name of ["d3d11layers", "glcontext", "wmfvpxvideo"]) {
startupPhases["before first paint"].push({
path: `ProfD:${name}.guard`,
ignoreIfUnused: true,

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

@ -5494,15 +5494,9 @@ mozilla::ipc::IPCResult ContentParent::RecvBeginDriverCrashGuard(
case gfx::CrashGuardType::D3D11Layers:
guard = MakeUnique<gfx::D3D11LayersCrashGuard>(this);
break;
case gfx::CrashGuardType::D3D9Video:
guard = MakeUnique<gfx::D3D9VideoCrashGuard>(this);
break;
case gfx::CrashGuardType::GLContext:
guard = MakeUnique<gfx::GLContextCrashGuard>(this);
break;
case gfx::CrashGuardType::D3D11Video:
guard = MakeUnique<gfx::D3D11VideoCrashGuard>(this);
break;
case gfx::CrashGuardType::WMFVPXVideo:
guard = MakeUnique<gfx::WMFVPXVideoCrashGuard>(this);
break;

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

@ -243,22 +243,15 @@ static const GUID DXVA2_Intel_ModeH264_E = {
// (CLSID_CMSH264DecoderMFT) uses, so we can use it to determine if the MFT will
// use software fallback or not.
bool D3D9DXVA2Manager::SupportsConfig(IMFMediaType* aType, float aFramerate) {
MOZ_ASSERT(NS_IsMainThread());
DXVA2_VideoDesc desc;
HRESULT hr = ConvertMFTypeToDXVAType(aType, &desc);
NS_ENSURE_TRUE(SUCCEEDED(hr), false);
return CanCreateDecoder(desc, aFramerate);
}
D3D9DXVA2Manager::D3D9DXVA2Manager() {
MOZ_COUNT_CTOR(D3D9DXVA2Manager);
MOZ_ASSERT(NS_IsMainThread());
}
D3D9DXVA2Manager::D3D9DXVA2Manager() { MOZ_COUNT_CTOR(D3D9DXVA2Manager); }
D3D9DXVA2Manager::~D3D9DXVA2Manager() {
MOZ_COUNT_DTOR(D3D9DXVA2Manager);
MOZ_ASSERT(NS_IsMainThread());
}
D3D9DXVA2Manager::~D3D9DXVA2Manager() { MOZ_COUNT_DTOR(D3D9DXVA2Manager); }
IUnknown* D3D9DXVA2Manager::GetDXVADeviceManager() {
MutexAutoLock lock(mLock);
@ -268,17 +261,8 @@ IUnknown* D3D9DXVA2Manager::GetDXVADeviceManager() {
HRESULT
D3D9DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
nsACString& aFailureReason) {
MOZ_ASSERT(NS_IsMainThread());
ScopedGfxFeatureReporter reporter("DXVA2D3D9");
gfx::D3D9VideoCrashGuard crashGuard;
if (crashGuard.Crashed()) {
NS_WARNING("DXVA2D3D9 crash detected");
aFailureReason.AssignLiteral("DXVA2D3D9 crashes detected in the past");
return E_FAIL;
}
// Create D3D9Ex.
HMODULE d3d9lib = LoadLibraryW(L"d3d9.dll");
NS_ENSURE_TRUE(d3d9lib, E_FAIL);
@ -497,12 +481,11 @@ D3D9DXVA2Manager::CopyToImage(IMFSample* aSample, const gfx::IntRect& aRegion,
// Count of the number of DXVAManager's we've created. This is also the
// number of videos we're decoding with DXVA. Use on main thread only.
static uint32_t sDXVAVideosCount = 0;
static Atomic<uint32_t> sDXVAVideosCount(0);
/* static */
DXVA2Manager* DXVA2Manager::CreateD3D9DXVA(
layers::KnowsCompositor* aKnowsCompositor, nsACString& aFailureReason) {
MOZ_ASSERT(NS_IsMainThread());
HRESULT hr;
// DXVA processing takes up a lot of GPU resources, so limit the number of
@ -526,7 +509,6 @@ DXVA2Manager* DXVA2Manager::CreateD3D9DXVA(
bool D3D9DXVA2Manager::CanCreateDecoder(const DXVA2_VideoDesc& aDesc,
const float aFramerate) const {
MOZ_ASSERT(NS_IsMainThread());
if (IsUnsupportedResolution(aDesc.SampleWidth, aDesc.SampleHeight,
aFramerate)) {
return false;
@ -537,13 +519,6 @@ bool D3D9DXVA2Manager::CanCreateDecoder(const DXVA2_VideoDesc& aDesc,
already_AddRefed<IDirectXVideoDecoder> D3D9DXVA2Manager::CreateDecoder(
const DXVA2_VideoDesc& aDesc) const {
MOZ_ASSERT(NS_IsMainThread());
gfx::D3D9VideoCrashGuard crashGuard;
if (crashGuard.Crashed()) {
NS_WARNING("DXVA2D3D9 crash detected");
return nullptr;
}
UINT configCount;
DXVA2_ConfigPictureDecode* configs = nullptr;
HRESULT hr = mDecoderService->GetDecoderConfigurations(
@ -632,7 +607,6 @@ class D3D11DXVA2Manager : public DXVA2Manager {
};
bool D3D11DXVA2Manager::SupportsConfig(IMFMediaType* aType, float aFramerate) {
MOZ_ASSERT(NS_IsMainThread());
D3D11_VIDEO_DECODER_DESC desc;
desc.Guid = mDecoderGUID;
desc.OutputFormat = DXGI_FORMAT_NV12;
@ -654,24 +628,13 @@ IUnknown* D3D11DXVA2Manager::GetDXVADeviceManager() {
HRESULT
D3D11DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
nsACString& aFailureReason, ID3D11Device* aDevice) {
if (!NS_IsMainThread()) {
// DXVA Managers used for full video have to be initialized on the main
// thread. Managers initialized off the main thread have to pass a device
// and can only be used for color conversion.
MOZ_ASSERT(aDevice);
if (aDevice) {
return InitInternal(aKnowsCompositor, aFailureReason, aDevice);
}
HRESULT hr;
ScopedGfxFeatureReporter reporter("DXVA2D3D11");
gfx::D3D11VideoCrashGuard crashGuard;
if (crashGuard.Crashed()) {
NS_WARNING("DXVA2D3D11 crash detected");
aFailureReason.AssignLiteral("DXVA2D3D11 crashes detected in the past");
return E_FAIL;
}
hr = InitInternal(aKnowsCompositor, aFailureReason, aDevice);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
@ -1184,7 +1147,6 @@ D3D11DXVA2Manager::ConfigureForSize(IMFMediaType* aInputType,
bool D3D11DXVA2Manager::CanCreateDecoder(const D3D11_VIDEO_DECODER_DESC& aDesc,
const float aFramerate) const {
MOZ_ASSERT(NS_IsMainThread());
if (IsUnsupportedResolution(aDesc.SampleWidth, aDesc.SampleHeight,
aFramerate)) {
return false;
@ -1195,13 +1157,6 @@ bool D3D11DXVA2Manager::CanCreateDecoder(const D3D11_VIDEO_DECODER_DESC& aDesc,
already_AddRefed<ID3D11VideoDecoder> D3D11DXVA2Manager::CreateDecoder(
const D3D11_VIDEO_DECODER_DESC& aDesc) const {
MOZ_ASSERT(NS_IsMainThread());
gfx::D3D11VideoCrashGuard crashGuard;
if (crashGuard.Crashed()) {
NS_WARNING("DXVA2D3D9 crash detected");
return nullptr;
}
RefPtr<ID3D11VideoDevice> videoDevice;
HRESULT hr = mDevice->QueryInterface(
static_cast<ID3D11VideoDevice**>(getter_AddRefs(videoDevice)));
@ -1244,17 +1199,9 @@ DXVA2Manager* DXVA2Manager::CreateD3D11DXVA(
return manager.release();
}
DXVA2Manager::DXVA2Manager() : mLock("DXVA2Manager") {
if (NS_IsMainThread()) {
++sDXVAVideosCount;
}
}
DXVA2Manager::DXVA2Manager() : mLock("DXVA2Manager") { ++sDXVAVideosCount; }
DXVA2Manager::~DXVA2Manager() {
if (NS_IsMainThread()) {
--sDXVAVideosCount;
}
}
DXVA2Manager::~DXVA2Manager() { --sDXVAVideosCount; }
bool DXVA2Manager::IsUnsupportedResolution(const uint32_t& aWidth,
const uint32_t& aHeight,

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

@ -100,27 +100,6 @@ static bool IsWin7H264Decoder4KCapable() {
return false;
}
template <class T>
class DeleteObjectTask : public Runnable {
public:
explicit DeleteObjectTask(UniquePtr<T>&& aObject)
: Runnable("VideoUtils::DeleteObjectTask"), mObject(std::move(aObject)) {}
NS_IMETHOD Run() override {
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
mObject = nullptr;
return NS_OK;
}
private:
UniquePtr<T> mObject;
};
template <class T>
void DeleteOnMainThread(UniquePtr<T>&& aObject) {
nsCOMPtr<nsIRunnable> r = new DeleteObjectTask<T>(std::move(aObject));
SchedulerGroup::Dispatch(TaskCategory::Other, r.forget());
}
LayersBackend GetCompositorBackendType(
layers::KnowsCompositor* aKnowsCompositor) {
if (aKnowsCompositor) {
@ -174,10 +153,6 @@ WMFVideoMFTManager::WMFVideoMFTManager(
WMFVideoMFTManager::~WMFVideoMFTManager() {
MOZ_COUNT_DTOR(WMFVideoMFTManager);
// Ensure DXVA/D3D9 related objects are released on the main thread.
if (mDXVA2Manager) {
DeleteOnMainThread(std::move(mDXVA2Manager));
}
}
const GUID& WMFVideoMFTManager::GetMFTGUID() {
@ -208,261 +183,6 @@ const GUID& WMFVideoMFTManager::GetMediaSubtypeGUID() {
};
}
struct D3DDLLBlacklistingCache {
// Blacklist pref value last seen.
nsCString mBlacklistPref;
// Non-empty if a blacklisted DLL was found.
nsCString mBlacklistedDLL;
};
StaticAutoPtr<D3DDLLBlacklistingCache> sD3D11BlacklistingCache;
StaticAutoPtr<D3DDLLBlacklistingCache> sD3D9BlacklistingCache;
// If a blacklisted DLL is found, return its information, otherwise "".
static const nsCString& FindDXVABlacklistedDLL(
StaticAutoPtr<D3DDLLBlacklistingCache>& aDLLBlacklistingCache,
const nsCString& aBlacklist, const char* aDLLBlacklistPrefName) {
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
if (!aDLLBlacklistingCache) {
// First time here, create persistent data that will be reused in all
// D3D11-blacklisting checks.
aDLLBlacklistingCache = new D3DDLLBlacklistingCache();
ClearOnShutdown(&aDLLBlacklistingCache);
}
if (aBlacklist.IsEmpty()) {
// Empty blacklist -> No blacklisting.
aDLLBlacklistingCache->mBlacklistPref.SetLength(0);
aDLLBlacklistingCache->mBlacklistedDLL.SetLength(0);
return aDLLBlacklistingCache->mBlacklistedDLL;
}
// Detect changes in pref.
if (aDLLBlacklistingCache->mBlacklistPref.Equals(aBlacklist)) {
// Same blacklist -> Return same result (i.e., don't check DLLs again).
return aDLLBlacklistingCache->mBlacklistedDLL;
}
// Adopt new pref now, so we don't work on it again.
aDLLBlacklistingCache->mBlacklistPref = aBlacklist;
HANDLE hProcess = GetCurrentProcess();
mozilla::UniquePtr<HMODULE[]> hMods;
unsigned int modulesNum = 0;
if (hProcess != NULL) {
DWORD modulesSize;
if (EnumProcessModules(hProcess, nullptr, 0, &modulesSize)) {
modulesNum = modulesSize / sizeof(HMODULE);
hMods = mozilla::MakeUnique<HMODULE[]>(modulesNum);
if (EnumProcessModules(hProcess, hMods.get(),
modulesNum * sizeof(HMODULE), &modulesSize)) {
// The list may have shrunk
if (modulesSize / sizeof(HMODULE) < modulesNum) {
modulesNum = modulesSize / sizeof(HMODULE);
}
} else {
modulesNum = 0;
}
}
}
// media.wmf.disable-d3d*-for-dlls format: (whitespace is trimmed)
// "dll1.dll: 1.2.3.4[, more versions...][; more dlls...]"
nsTArray<nsCString> dlls;
SplitAt(";", aBlacklist, dlls);
for (const auto& dll : dlls) {
nsTArray<nsCString> nameAndVersions;
SplitAt(":", dll, nameAndVersions);
if (nameAndVersions.Length() != 2) {
NS_WARNING(nsPrintfCString("Skipping incorrect '%s' dll:versions format",
aDLLBlacklistPrefName)
.get());
continue;
}
nameAndVersions[0].CompressWhitespace();
NS_ConvertUTF8toUTF16 name(nameAndVersions[0]);
for (unsigned int i = 0; i <= modulesNum; i++) {
WCHAR dllPath[MAX_PATH + 1];
if (i < modulesNum) {
if (!GetModuleFileNameEx(hProcess, hMods[i], dllPath,
sizeof(dllPath) / sizeof(WCHAR))) {
continue;
}
nsCOMPtr<nsIFile> file;
if (NS_WARN_IF(NS_FAILED(NS_NewLocalFile(
nsDependentString(dllPath), false, getter_AddRefs(file))))) {
continue;
}
nsAutoString leafName;
if (NS_WARN_IF(NS_FAILED(file->GetLeafName(leafName)))) {
continue;
}
if (_wcsicmp(leafName.get(), name.get())) {
continue;
}
} else {
if (!ConstructSystem32Path(name.get(), dllPath, MAX_PATH + 1)) {
// Cannot build path -> Assume it's not the blacklisted DLL.
continue;
}
}
DWORD zero;
DWORD infoSize = GetFileVersionInfoSizeW(dllPath, &zero);
if (infoSize == 0) {
// Can't get file info -> Assume we don't have the blacklisted DLL.
continue;
}
// vInfo is a pointer into infoData, that's why we keep it outside of the
// loop.
auto infoData = MakeUnique<unsigned char[]>(infoSize);
VS_FIXEDFILEINFO* vInfo;
UINT vInfoLen;
if (!GetFileVersionInfoW(dllPath, 0, infoSize, infoData.get()) ||
!VerQueryValueW(infoData.get(), L"\\", (LPVOID*)&vInfo, &vInfoLen) ||
!vInfo) {
// Can't find version -> Assume it's not blacklisted.
continue;
}
nsTArray<nsCString> versions;
SplitAt(",", nameAndVersions[1], versions);
for (const auto& version : versions) {
nsTArray<nsCString> numberStrings;
SplitAt(".", version, numberStrings);
if (numberStrings.Length() != 4) {
NS_WARNING(
nsPrintfCString("Skipping incorrect '%s' a.b.c.d version format",
aDLLBlacklistPrefName)
.get());
continue;
}
DWORD numbers[4];
nsresult errorCode = NS_OK;
for (int i = 0; i < 4; ++i) {
numberStrings[i].CompressWhitespace();
numbers[i] = DWORD(numberStrings[i].ToInteger(&errorCode));
if (NS_FAILED(errorCode)) {
break;
}
if (numbers[i] > UINT16_MAX) {
errorCode = NS_ERROR_FAILURE;
break;
}
}
if (NS_FAILED(errorCode)) {
NS_WARNING(
nsPrintfCString("Skipping incorrect '%s' a.b.c.d version format",
aDLLBlacklistPrefName)
.get());
continue;
}
if (vInfo->dwFileVersionMS == ((numbers[0] << 16) | numbers[1]) &&
vInfo->dwFileVersionLS == ((numbers[2] << 16) | numbers[3])) {
// Blacklisted! Record bad DLL.
aDLLBlacklistingCache->mBlacklistedDLL.SetLength(0);
aDLLBlacklistingCache->mBlacklistedDLL.AppendPrintf(
"%s (%lu.%lu.%lu.%lu)", nameAndVersions[0].get(), numbers[0],
numbers[1], numbers[2], numbers[3]);
return aDLLBlacklistingCache->mBlacklistedDLL;
}
}
}
}
// No blacklisted DLL.
aDLLBlacklistingCache->mBlacklistedDLL.SetLength(0);
return aDLLBlacklistingCache->mBlacklistedDLL;
}
static const nsCString& FindD3D11BlacklistedDLL() {
return FindDXVABlacklistedDLL(sD3D11BlacklistingCache,
gfx::gfxVars::PDMWMFDisableD3D11Dlls(),
"media.wmf.disable-d3d11-for-dlls");
}
static const nsCString& FindD3D9BlacklistedDLL() {
return FindDXVABlacklistedDLL(sD3D9BlacklistingCache,
gfx::gfxVars::PDMWMFDisableD3D9Dlls(),
"media.wmf.disable-d3d9-for-dlls");
}
const nsCString GetFoundD3D11BlacklistedDLL() {
if (sD3D11BlacklistingCache) {
return sD3D11BlacklistingCache->mBlacklistedDLL;
}
return nsCString();
}
const nsCString GetFoundD3D9BlacklistedDLL() {
if (sD3D9BlacklistingCache) {
return sD3D9BlacklistingCache->mBlacklistedDLL;
}
return nsCString();
}
class CreateDXVAManagerEvent : public Runnable {
public:
CreateDXVAManagerEvent(layers::KnowsCompositor* aKnowsCompositor,
nsCString& aFailureReason)
: Runnable("CreateDXVAManagerEvent"),
mBackend(LayersBackend::LAYERS_D3D11),
mKnowsCompositor(aKnowsCompositor),
mFailureReason(aFailureReason) {}
NS_IMETHOD Run() override {
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
const bool deblacklistingForTelemetry =
XRE_IsGPUProcess() &&
StaticPrefs::media_wmf_deblacklisting_for_telemetry_in_gpu_process();
nsACString* failureReason = &mFailureReason;
nsCString secondFailureReason;
if (mBackend == LayersBackend::LAYERS_D3D11 &&
StaticPrefs::media_wmf_dxva_d3d11_enabled() && IsWin8OrLater()) {
const nsCString& blacklistedDLL = FindD3D11BlacklistedDLL();
if (!deblacklistingForTelemetry && !blacklistedDLL.IsEmpty()) {
failureReason->AppendPrintf("D3D11 blacklisted with DLL %s",
blacklistedDLL.get());
} else {
mDXVA2Manager.reset(
DXVA2Manager::CreateD3D11DXVA(mKnowsCompositor, *failureReason));
if (mDXVA2Manager) {
return NS_OK;
}
}
// Try again with d3d9, but record the failure reason
// into a new var to avoid overwriting the d3d11 failure.
failureReason = &secondFailureReason;
mFailureReason.AppendLiteral("; ");
}
const nsCString& blacklistedDLL = FindD3D9BlacklistedDLL();
if (!deblacklistingForTelemetry && !blacklistedDLL.IsEmpty()) {
mFailureReason.AppendPrintf("D3D9 blacklisted with DLL %s",
blacklistedDLL.get());
} else {
mDXVA2Manager.reset(
DXVA2Manager::CreateD3D9DXVA(mKnowsCompositor, *failureReason));
// Make sure we include the messages from both attempts (if applicable).
mFailureReason.Append(secondFailureReason);
}
return NS_OK;
}
UniquePtr<DXVA2Manager> mDXVA2Manager;
layers::LayersBackend mBackend;
layers::KnowsCompositor* mKnowsCompositor;
nsACString& mFailureReason;
};
bool WMFVideoMFTManager::InitializeDXVA() {
// If we use DXVA but aren't running with a D3D layer manager then the
// readback of decoded video frames from GPU to CPU memory grinds painting
@ -478,18 +198,30 @@ bool WMFVideoMFTManager::InitializeDXVA() {
return false;
}
// The DXVA manager must be created on the main thread.
RefPtr<CreateDXVAManagerEvent> event =
new CreateDXVAManagerEvent(mKnowsCompositor, mDXVAFailureReason);
if (NS_IsMainThread()) {
event->Run();
} else {
// This logic needs to run on the main thread
mozilla::SyncRunnable::DispatchToThread(GetMainThreadSerialEventTarget(),
event);
if (!XRE_IsRDDProcess() && !XRE_IsGPUProcess()) {
mDXVAFailureReason.AssignLiteral(
"DXVA only supported in RDD or GPU process");
return false;
}
mDXVA2Manager = std::move(event->mDXVA2Manager);
nsACString* failureReason = &mDXVAFailureReason;
nsCString secondFailureReason;
if (StaticPrefs::media_wmf_dxva_d3d11_enabled() && IsWin8OrLater()) {
mDXVA2Manager.reset(
DXVA2Manager::CreateD3D11DXVA(mKnowsCompositor, *failureReason));
if (mDXVA2Manager) {
return true;
}
// Try again with d3d9, but record the failure reason
// into a new var to avoid overwriting the d3d11 failure.
failureReason = &secondFailureReason;
mDXVAFailureReason.AppendLiteral("; ");
}
mDXVA2Manager.reset(
DXVA2Manager::CreateD3D9DXVA(mKnowsCompositor, *failureReason));
// Make sure we include the messages from both attempts (if applicable).
mDXVAFailureReason.Append(secondFailureReason);
return mDXVA2Manager != nullptr;
}
@ -604,7 +336,7 @@ MediaResult WMFVideoMFTManager::InitInternal() {
// Either mDXVAEnabled was set to false prior the second call to
// InitInternal() due to CanUseDXVA() returning false, or
// MFT_MESSAGE_SET_D3D_MANAGER failed
DeleteOnMainThread(std::move(mDXVA2Manager));
mDXVA2Manager.reset();
}
if (mStreamType == VP9 || mStreamType == VP8) {
return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
@ -753,27 +485,6 @@ WMFVideoMFTManager::Input(MediaRawData* aSample) {
return mDecoder->Input(inputSample);
}
class SupportsConfigEvent : public Runnable {
public:
SupportsConfigEvent(DXVA2Manager* aDXVA2Manager, IMFMediaType* aMediaType,
float aFramerate)
: Runnable("SupportsConfigEvent"),
mDXVA2Manager(aDXVA2Manager),
mMediaType(aMediaType),
mFramerate(aFramerate),
mSupportsConfig(false) {}
NS_IMETHOD Run() override {
MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
mSupportsConfig = mDXVA2Manager->SupportsConfig(mMediaType, mFramerate);
return NS_OK;
}
DXVA2Manager* mDXVA2Manager;
IMFMediaType* mMediaType;
const float mFramerate;
bool mSupportsConfig;
};
// The MFTransform we use for decoding h264 video will silently fall
// back to software decoding (even if we've negotiated DXVA) if the GPU
// doesn't support decoding the given resolution. It will then upload
@ -796,20 +507,7 @@ bool WMFVideoMFTManager::CanUseDXVA(IMFMediaType* aType, float aFramerate) {
return true;
}
// The supports config check must be done on the main thread since we have
// a crash guard protecting it.
RefPtr<SupportsConfigEvent> event =
new SupportsConfigEvent(mDXVA2Manager.get(), aType, aFramerate);
if (NS_IsMainThread()) {
event->Run();
} else {
// This logic needs to run on the main thread
mozilla::SyncRunnable::DispatchToThread(GetMainThreadSerialEventTarget(),
event);
}
return event->mSupportsConfig;
return mDXVA2Manager->SupportsConfig(aType, aFramerate);
}
HRESULT
@ -1121,7 +819,7 @@ WMFVideoMFTManager::Output(int64_t aStreamOffset, RefPtr<MediaData>& aOutData) {
void WMFVideoMFTManager::Shutdown() {
mDecoder = nullptr;
DeleteOnMainThread(std::move(mDXVA2Manager));
mDXVA2Manager.reset();
}
bool WMFVideoMFTManager::IsHardwareAccelerated(

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

@ -36,8 +36,6 @@ class gfxVarReceiver;
mozilla::gfx::SurfaceFormat::X8R8G8B8_UINT32) \
_(RequiresAcceleratedGLContextForCompositorOGL, bool, false) \
_(CanUseHardwareVideoDecoding, bool, false) \
_(PDMWMFDisableD3D11Dlls, nsCString, nsCString()) \
_(PDMWMFDisableD3D9Dlls, nsCString, nsCString()) \
_(DXInterop2Blocked, bool, false) \
_(DXNV12Blocked, bool, false) \
_(DXP010Blocked, bool, false) \

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

@ -25,7 +25,7 @@ namespace gfx {
static const size_t NUM_CRASH_GUARD_TYPES = size_t(CrashGuardType::NUM_TYPES);
static const char* sCrashGuardNames[] = {
"d3d11layers", "d3d9video", "glcontext", "d3d11video", "wmfvpxvideo",
"d3d11layers", "glcontext", "wmfvpxvideo",
};
static_assert(MOZ_ARRAY_LENGTH(sCrashGuardNames) == NUM_CRASH_GUARD_TYPES,
"CrashGuardType updated without a name string");
@ -450,31 +450,6 @@ void D3D11LayersCrashGuard::RecordTelemetry(TelemetryState aState) {
sTelemetryStateRecorded = true;
}
D3D9VideoCrashGuard::D3D9VideoCrashGuard(dom::ContentParent* aContentParent)
: DriverCrashGuard(CrashGuardType::D3D9Video, aContentParent) {}
void D3D9VideoCrashGuard::LogCrashRecovery() {
gfxCriticalNote << "DXVA2D3D9 just crashed; hardware video will be disabled.";
}
void D3D9VideoCrashGuard::LogFeatureDisabled() {
gfxCriticalNote
<< "DXVA2D3D9 video decoding is disabled due to a previous crash.";
}
D3D11VideoCrashGuard::D3D11VideoCrashGuard(dom::ContentParent* aContentParent)
: DriverCrashGuard(CrashGuardType::D3D11Video, aContentParent) {}
void D3D11VideoCrashGuard::LogCrashRecovery() {
gfxCriticalNote
<< "DXVA2D3D11 just crashed; hardware video will be disabled.";
}
void D3D11VideoCrashGuard::LogFeatureDisabled() {
gfxCriticalNote
<< "DXVA2D3D11 video decoding is disabled due to a previous crash.";
}
GLContextCrashGuard::GLContextCrashGuard(dom::ContentParent* aContentParent)
: DriverCrashGuard(CrashGuardType::GLContext, aContentParent) {}

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

@ -37,9 +37,7 @@ enum class DriverInitStatus {
enum class CrashGuardType : uint32_t {
D3D11Layers,
D3D9Video,
GLContext,
D3D11Video,
WMFVPXVideo,
// Add new entries above this line, update the name array in
// DriverCrashGuard.cpp, make sure to add an entry in ContentParent.cpp,
@ -148,24 +146,6 @@ class D3D11LayersCrashGuard final : public DriverCrashGuard {
void RecordTelemetry(TelemetryState aState);
};
class D3D9VideoCrashGuard final : public DriverCrashGuard {
public:
explicit D3D9VideoCrashGuard(dom::ContentParent* aContentParent = nullptr);
protected:
void LogCrashRecovery() override;
void LogFeatureDisabled() override;
};
class D3D11VideoCrashGuard final : public DriverCrashGuard {
public:
explicit D3D11VideoCrashGuard(dom::ContentParent* aContentParent = nullptr);
protected:
void LogCrashRecovery() override;
void LogFeatureDisabled() override;
};
class GLContextCrashGuard final : public DriverCrashGuard {
public:
explicit GLContextCrashGuard(dom::ContentParent* aContentParent = nullptr);

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

@ -833,18 +833,6 @@ void gfxPlatform::Init() {
GPUProcessManager::Initialize();
RDDProcessManager::Initialize();
if (Preferences::GetBool("media.wmf.skip-blacklist")) {
gfxVars::SetPDMWMFDisableD3D11Dlls(nsCString());
gfxVars::SetPDMWMFDisableD3D9Dlls(nsCString());
} else {
nsAutoCString d3d11;
Preferences::GetCString("media.wmf.disable-d3d11-for-dlls", d3d11);
gfxVars::SetPDMWMFDisableD3D11Dlls(d3d11);
nsAutoCString d3d9;
Preferences::GetCString("media.wmf.disable-d3d9-for-dlls", d3d9);
gfxVars::SetPDMWMFDisableD3D9Dlls(d3d9);
}
nsCOMPtr<nsIFile> file;
nsresult rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(file));
if (NS_FAILED(rv)) {

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

@ -7455,11 +7455,6 @@
value: false
mirror: always
- name: media.wmf.deblacklisting-for-telemetry-in-gpu-process
type: RelaxedAtomicBool
value: true
mirror: always
- name: media.wmf.amd.highres.enabled
type: RelaxedAtomicBool
value: true

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

@ -380,8 +380,6 @@ pref("media.hardware-video-decoding.enabled", true);
#ifdef MOZ_WMF
pref("media.wmf.dxva.enabled", true);
pref("media.wmf.disable-d3d11-for-dlls", "igd11dxva64.dll: 20.19.15.4463, 20.19.15.4454, 20.19.15.4444, 20.19.15.4416, 20.19.15.4404, 20.19.15.4390, 20.19.15.4380, 20.19.15.4377, 20.19.15.4364, 20.19.15.4360, 20.19.15.4352, 20.19.15.4331, 20.19.15.4326, 20.19.15.4300; igd10iumd32.dll: 20.19.15.4444, 20.19.15.4424, 20.19.15.4409, 20.19.15.4390, 20.19.15.4380, 20.19.15.4360, 10.18.10.4358, 20.19.15.4331, 20.19.15.4312, 20.19.15.4300, 10.18.15.4281, 10.18.15.4279, 10.18.10.4276, 10.18.15.4268, 10.18.15.4256, 10.18.10.4252, 10.18.15.4248, 10.18.14.4112, 10.18.10.3958, 10.18.10.3496, 10.18.10.3431, 10.18.10.3412, 10.18.10.3355, 9.18.10.3234, 9.18.10.3071, 9.18.10.3055, 9.18.10.3006; igd10umd32.dll: 9.17.10.4229, 9.17.10.3040, 9.17.10.2884, 9.17.10.2857, 8.15.10.2274, 8.15.10.2272, 8.15.10.2246, 8.15.10.1840, 8.15.10.1808; igd10umd64.dll: 9.17.10.4229, 9.17.10.2884, 9.17.10.2857, 10.18.10.3496; isonyvideoprocessor.dll: 4.1.2247.8090, 4.1.2153.6200; tosqep.dll: 1.2.15.526, 1.1.12.201, 1.0.11.318, 1.0.11.215, 1.0.10.1224; tosqep64.dll: 1.1.12.201, 1.0.11.215; nvwgf2um.dll: 22.21.13.8253, 22.21.13.8233, 22.21.13.8205, 22.21.13.8189, 22.21.13.8178, 22.21.13.8165, 21.21.13.7892, 21.21.13.7878, 21.21.13.7866, 21.21.13.7849, 21.21.13.7654, 21.21.13.7653, 21.21.13.7633, 21.21.13.7619, 21.21.13.7563, 21.21.13.7306, 21.21.13.7290, 21.21.13.7270, 21.21.13.7254, 21.21.13.6939, 21.21.13.6926, 21.21.13.6909, 21.21.13.4201, 21.21.13.4200, 10.18.13.6881, 10.18.13.6839, 10.18.13.6510, 10.18.13.6472, 10.18.13.6143, 10.18.13.5946, 10.18.13.5923, 10.18.13.5921, 10.18.13.5891, 10.18.13.5887, 10.18.13.5582, 10.18.13.5445, 10.18.13.5382, 10.18.13.5362, 9.18.13.4788, 9.18.13.4752, 9.18.13.4725, 9.18.13.4709, 9.18.13.4195, 9.18.13.4192, 9.18.13.4144, 9.18.13.4052, 9.18.13.3788, 9.18.13.3523, 9.18.13.3235, 9.18.13.3165, 9.18.13.2723, 9.18.13.2702, 9.18.13.1422, 9.18.13.1407, 9.18.13.1106, 9.18.13.546; atidxx32.dll: 21.19.151.3, 21.19.142.257, 21.19.137.514, 21.19.137.1, 21.19.134.1, 21.19.128.7, 21.19.128.4, 20.19.0.32837, 20.19.0.32832, 8.17.10.682, 8.17.10.671, 8.17.10.661, 8.17.10.648, 8.17.10.644, 8.17.10.625, 8.17.10.605, 8.17.10.581, 8.17.10.569, 8.17.10.560, 8.17.10.545, 8.17.10.539, 8.17.10.531, 8.17.10.525, 8.17.10.520, 8.17.10.519, 8.17.10.514, 8.17.10.511, 8.17.10.494, 8.17.10.489, 8.17.10.483, 8.17.10.453, 8.17.10.451, 8.17.10.441, 8.17.10.436, 8.17.10.432, 8.17.10.425, 8.17.10.418, 8.17.10.414, 8.17.10.401, 8.17.10.395, 8.17.10.385, 8.17.10.378, 8.17.10.362, 8.17.10.355, 8.17.10.342, 8.17.10.331, 8.17.10.318, 8.17.10.310, 8.17.10.286, 8.17.10.269, 8.17.10.261, 8.17.10.247, 8.17.10.240, 8.15.10.212; atidxx64.dll: 21.19.151.3, 21.19.142.257, 21.19.137.514, 21.19.137.1, 21.19.134.1, 21.19.128.7, 21.19.128.4, 20.19.0.32832, 8.17.10.682, 8.17.10.661, 8.17.10.644, 8.17.10.625; nvumdshim.dll: 10.18.13.6822");
pref("media.wmf.disable-d3d9-for-dlls", "igdumd64.dll: 8.15.10.2189, 8.15.10.2119, 8.15.10.2104, 8.15.10.2102, 8.771.1.0; atiumd64.dll: 7.14.10.833, 7.14.10.867, 7.14.10.885, 7.14.10.903, 7.14.10.911, 8.14.10.768, 9.14.10.1001, 9.14.10.1017, 9.14.10.1080, 9.14.10.1128, 9.14.10.1162, 9.14.10.1171, 9.14.10.1183, 9.14.10.1197, 9.14.10.945, 9.14.10.972, 9.14.10.984, 9.14.10.996");
pref("media.wmf.play-stand-alone", true);
#endif
pref("media.gmp.decoder.aac", 0);

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

@ -311,8 +311,6 @@ support-blocklisted-bug = Blocklisted due to known issues: <a data-l10n-name="bu
unknown-failure = Blocklisted; failure code { $failureCode }
d3d11layers-crash-guard = D3D11 Compositor
d3d11video-crash-guard = D3D11 Video Decoder
d3d9video-crash-guard = D3D9 Video Decoder
glcontext-crash-guard = OpenGL
wmfvpxvideo-crash-guard = WMF VPX Video Decoder

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

@ -294,8 +294,7 @@ interface nsIGfxInfo : nsISupports
//
// [
// {
// // Type is one of "d3d11layers", "d3d9video", "glcontext",
// // or "d3d11video".
// // Type is one of "d3d11layers", or "glcontext".
// "type": "<identifier>",
//
// // Preference that must be deleted/reset to retrigger the guard.