Commit 65fc71a4 authored by Dale Curtis's avatar Dale Curtis Committed by Chromium LUCI CQ

Disable VP9 hardware decoding on Intel GPUs with hybrid decoders.

We've disabled these on Windows and ChromeOS, so it's no surprise that
we need to disable them on macOS as well.

R=zmo

Fixed: 1163111
Change-Id: I406e6ebd1d27da84964e46efb9582ce77f904dac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2613560Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841116}
parent 1916748c
......@@ -3659,6 +3659,22 @@
"features": [
"supports_two_yuv_hardware_overlays"
]
},
{
"id": 363,
"description": "VP9 decoding is too slow on Intel Broadwell, Skylake, and CherryTrail",
"cr_bugs": [616318, 1163111],
"os": {
"type": "macosx"
},
"intel_gpu_series": [
"broadwell",
"skylake",
"cherrytrail"
],
"features": [
"disable_accelerated_vp9_decode"
]
}
]
}
......@@ -74,7 +74,7 @@ gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilitiesInternal(
#endif
#elif defined(OS_MAC)
capabilities.supported_profiles =
VTVideoDecodeAccelerator::GetSupportedProfiles();
VTVideoDecodeAccelerator::GetSupportedProfiles(workarounds);
#endif
return GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeCapabilities(
......@@ -232,7 +232,8 @@ GpuVideoDecodeAcceleratorFactory::CreateVTVDA(
const gpu::GpuPreferences& gpu_preferences,
MediaLog* media_log) const {
std::unique_ptr<VideoDecodeAccelerator> decoder;
decoder.reset(new VTVideoDecodeAccelerator(gl_client_, media_log));
decoder.reset(
new VTVideoDecodeAccelerator(gl_client_, workarounds, media_log));
return decoder;
}
#endif
......
......@@ -475,8 +475,10 @@ bool VTVideoDecodeAccelerator::FrameOrder::operator()(
VTVideoDecodeAccelerator::VTVideoDecodeAccelerator(
const GpuVideoDecodeGLClient& gl_client,
const gpu::GpuDriverBugWorkarounds& workarounds,
MediaLog* media_log)
: gl_client_(gl_client),
workarounds_(workarounds),
media_log_(media_log),
gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()),
decoder_thread_("VTDecoderThread"),
......@@ -588,7 +590,7 @@ bool VTVideoDecodeAccelerator::Initialize(const Config& config,
}
static const base::NoDestructor<VideoDecodeAccelerator::SupportedProfiles>
kActualSupportedProfiles(GetSupportedProfiles());
kActualSupportedProfiles(GetSupportedProfiles(workarounds_));
if (std::find_if(kActualSupportedProfiles->begin(),
kActualSupportedProfiles->end(), [config](const auto& p) {
return p.profile == config.profile;
......@@ -1708,7 +1710,8 @@ bool VTVideoDecodeAccelerator::SupportsSharedImagePictureBuffers() const {
// static
VideoDecodeAccelerator::SupportedProfiles
VTVideoDecodeAccelerator::GetSupportedProfiles() {
VTVideoDecodeAccelerator::GetSupportedProfiles(
const gpu::GpuDriverBugWorkarounds& workarounds) {
SupportedProfiles profiles;
if (!InitializeVideoToolbox())
return profiles;
......@@ -1716,6 +1719,8 @@ VTVideoDecodeAccelerator::GetSupportedProfiles() {
for (const auto& supported_profile : kSupportedProfiles) {
if (supported_profile == VP9PROFILE_PROFILE0 ||
supported_profile == VP9PROFILE_PROFILE2) {
if (workarounds.disable_accelerated_vp9_decode)
continue;
if (!base::mac::IsAtLeastOS11())
continue;
if (!base::FeatureList::IsEnabled(kVideoToolboxVp9Decoding))
......
......@@ -17,6 +17,7 @@
#include "base/threading/thread.h"
#include "base/threading/thread_checker.h"
#include "base/trace_event/memory_dump_provider.h"
#include "gpu/config/gpu_driver_bug_workarounds.h"
#include "media/base/media_log.h"
#include "media/gpu/gpu_video_decode_accelerator_helpers.h"
#include "media/gpu/media_gpu_export.h"
......@@ -44,6 +45,7 @@ class VTVideoDecodeAccelerator : public VideoDecodeAccelerator,
public base::trace_event::MemoryDumpProvider {
public:
VTVideoDecodeAccelerator(const GpuVideoDecodeGLClient& gl_client_,
const gpu::GpuDriverBugWorkarounds& workarounds,
MediaLog* media_log);
~VTVideoDecodeAccelerator() override;
......@@ -74,7 +76,8 @@ class VTVideoDecodeAccelerator : public VideoDecodeAccelerator,
OSStatus status,
CVImageBufferRef image_buffer);
static VideoDecodeAccelerator::SupportedProfiles GetSupportedProfiles();
static VideoDecodeAccelerator::SupportedProfiles GetSupportedProfiles(
const gpu::GpuDriverBugWorkarounds& workarounds);
private:
// Logged to UMA, so never reuse values. Make sure to update
......@@ -214,6 +217,7 @@ class VTVideoDecodeAccelerator : public VideoDecodeAccelerator,
// GPU thread state.
//
const GpuVideoDecodeGLClient gl_client_;
const gpu::GpuDriverBugWorkarounds workarounds_;
MediaLog* media_log_;
VideoDecodeAccelerator::Client* client_ = nullptr;
......
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