Commit 7d9c3e2f authored by Frank Liberato's avatar Frank Liberato Committed by Commit Bot

Workaround to turn off DXVA video decoder on some AMD devices.

This CL adds |disable_dxva_video_decoder|, which turns off the
DXVA VDA.  In addition to refusing to instantiate one if the
workaround is enabled, it also removes it from SupportedConfigs
so that the renderer shouldn't bother to try.

This CL also makes the D3D11VideoDecoder SupportedConfigs only
show up if the decoder is enabled, so that the renderer doesn't
try to instaniate one that will fail anyway.

Bug: 625785
Change-Id: Ie9323049ce4263ea450127557e7ce20fec8e5625
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106892Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751900}
parent b5fd777e
...@@ -3571,14 +3571,37 @@ ...@@ -3571,14 +3571,37 @@
{ {
"id": 336, "id": 336,
"cr_bugs": [625785], "cr_bugs": [625785],
"description": "Hardware overlays caused crash spike on certain AMD GPUs", "description": "DXVA video decoder crashes on some AMD GPUs",
"os": { "os": {
"type": "win" "type": "win"
}, },
"vendor_id": "0x1002", "vendor_id": "0x1002",
"device_id": ["0x15d8", "0x15dd"], "device_id": ["0x15d8", "0x15dd"],
"exceptions": [
{
"driver_version": {
"op": "between",
"value": "26.20.11030.2",
"value2": "26.20.11999.99999"
},
"driver_version": {
"op": "between",
"value": "26.20.12020.15",
"value2": "26.20.12999.99999"
},
"driver_version": {
"op": "between",
"value": "26.20.13001.27002",
"value2": "26.20.13999.99999"
},
"driver_version": {
"op": ">=",
"value": "26.20.14001.7001"
}
}
],
"features": [ "features": [
"disable_direct_composition_video_overlays" "disable_dxva_video_decoder"
] ]
} }
] ]
......
...@@ -26,6 +26,7 @@ disable_direct_composition_video_overlays ...@@ -26,6 +26,7 @@ disable_direct_composition_video_overlays
disable_discard_framebuffer disable_discard_framebuffer
disable_dual_source_blending_support disable_dual_source_blending_support
disable_dxgi_zero_copy_video disable_dxgi_zero_copy_video
disable_dxva_video_decoder
disable_es3_gl_context disable_es3_gl_context
disable_es3_gl_context_for_testing disable_es3_gl_context_for_testing
disable_ext_draw_buffers disable_ext_draw_buffers
......
...@@ -156,13 +156,16 @@ GpuMojoMediaClient::GetSupportedVideoDecoderConfigs() { ...@@ -156,13 +156,16 @@ GpuMojoMediaClient::GetSupportedVideoDecoderConfigs() {
#if defined(OS_WIN) #if defined(OS_WIN)
// Start with the configurations supported by D3D11VideoDecoder. // Start with the configurations supported by D3D11VideoDecoder.
// VdaVideoDecoder is still used as a fallback. // VdaVideoDecoder is still used as a fallback.
if (!d3d11_supported_configs_) {
d3d11_supported_configs_ = if (base::FeatureList::IsEnabled(kD3D11VideoDecoder)) {
D3D11VideoDecoder::GetSupportedVideoDecoderConfigs( if (!d3d11_supported_configs_) {
gpu_preferences_, gpu_workarounds_, GetD3D11DeviceCallback()); d3d11_supported_configs_ =
D3D11VideoDecoder::GetSupportedVideoDecoderConfigs(
gpu_preferences_, gpu_workarounds_, GetD3D11DeviceCallback());
}
supported_config_map[VideoDecoderImplementation::kAlternate] =
*d3d11_supported_configs_;
} }
supported_config_map[VideoDecoderImplementation::kAlternate] =
*d3d11_supported_configs_;
#elif BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) #elif BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
if (IsNewAcceleratedVideoDecoderUsed(gpu_preferences_)) { if (IsNewAcceleratedVideoDecoderUsed(gpu_preferences_)) {
...@@ -176,6 +179,14 @@ GpuMojoMediaClient::GetSupportedVideoDecoderConfigs() { ...@@ -176,6 +179,14 @@ GpuMojoMediaClient::GetSupportedVideoDecoderConfigs() {
} }
#endif #endif
#if defined(OS_WIN)
if (gpu_workarounds_.disable_dxva_video_decoder) {
// If DXVA isn't supported, then return without any supported configs for
// the |kDefault| decoder.
return supported_config_map;
}
#endif // defined(OS_WIN)
auto& default_configs = auto& default_configs =
supported_config_map[VideoDecoderImplementation::kDefault]; supported_config_map[VideoDecoderImplementation::kDefault];
...@@ -269,6 +280,11 @@ std::unique_ptr<VideoDecoder> GpuMojoMediaClient::CreateVideoDecoder( ...@@ -269,6 +280,11 @@ std::unique_ptr<VideoDecoder> GpuMojoMediaClient::CreateVideoDecoder(
} }
#elif defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) #elif defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX)
#if defined(OS_WIN)
// Don't instantiate the DXVA decoder if it's not supported.
if (gpu_workarounds_.disable_dxva_video_decoder)
return nullptr;
#endif // defined(OS_WIN)
video_decoder = VdaVideoDecoder::Create( video_decoder = VdaVideoDecoder::Create(
task_runner, gpu_task_runner_, media_log->Clone(), target_color_space, task_runner, gpu_task_runner_, media_log->Clone(), target_color_space,
gpu_preferences_, gpu_workarounds_, gpu_preferences_, gpu_workarounds_,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment