From dcd4cc418b2e6980a9c6eaa4d10b704194e99eb8 Mon Sep 17 00:00:00 2001 From: sotaro Date: Thu, 17 Nov 2022 00:56:22 +0000 Subject: [PATCH] Bug 1798052 - Disable D3D9DXVA2Manager on AMD pre UVD4 r=media-playback-reviewers,alwu With AMD pre UVD4 GPU, hardware video decoding with D3D9DXVA2Manager outputs garbage for some videos. D3D9DXVA2Manager is used only for fallback from D3D11DXVA2Manager. A new gpu driver normally does not use D3D9DXVA2Manager . Differential Revision: https://phabricator.services.mozilla.com/D161976 --- dom/media/platforms/wmf/DXVA2Manager.cpp | 6 ++++++ modules/libpref/init/StaticPrefList.yaml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/dom/media/platforms/wmf/DXVA2Manager.cpp b/dom/media/platforms/wmf/DXVA2Manager.cpp index 972cda21bf83..2440afb84a87 100644 --- a/dom/media/platforms/wmf/DXVA2Manager.cpp +++ b/dom/media/platforms/wmf/DXVA2Manager.cpp @@ -482,6 +482,12 @@ D3D9DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor, break; } } + if (StaticPrefs::media_wmf_dxva_d3d9_amd_pre_uvd4_disabled() && + mIsAMDPreUVD4) { + aFailureReason.AssignLiteral( + "D3D9DXVA2Manager is disabled on AMDPreUVD4"); + return E_FAIL; + } } RefPtr syncSurf; diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 3e61193e4e8c..8f0162b71b01 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -9803,6 +9803,11 @@ value: 8 mirror: always +- name: media.wmf.dxva.d3d9.amd-pre-uvd4.disabled + type: RelaxedAtomicBool + value: true + mirror: always + - name: media.wmf.use-nv12-format type: RelaxedAtomicBool value: true