Commit 6801a071 authored by Ted Meyer's avatar Ted Meyer Committed by Commit Bot

Fix enable-accelerated-video-decode flag propagation on linux

cl https://chromium-review.googlesource.com/c/chromium/src/+/2483862
added a check for the flag, but the flag was never propagated to the gpu
process.

Change-Id: Ia01b50a0e8caf11bb4b08941fa4eead2c2b4d162
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2503818Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821589}
parent 18897fea
...@@ -130,7 +130,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper { ...@@ -130,7 +130,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper {
private: private:
// SandboxHelper: // SandboxHelper:
void PreSandboxStartup() override { void PreSandboxStartup(const gpu::GpuPreferences& gpu_prefs) override {
// Warm up resources that don't need access to GPUInfo. // Warm up resources that don't need access to GPUInfo.
{ {
TRACE_EVENT0("gpu", "Warm up rand"); TRACE_EVENT0("gpu", "Warm up rand");
...@@ -144,8 +144,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper { ...@@ -144,8 +144,7 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper {
#if BUILDFLAG(IS_ASH) #if BUILDFLAG(IS_ASH)
media::VaapiWrapper::PreSandboxInitialization(); media::VaapiWrapper::PreSandboxInitialization();
#else // For any non-ash chrome (ie: linux or lacros) that can support vaapi. #else // For any non-ash chrome (ie: linux or lacros) that can support vaapi.
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (!gpu_prefs.disable_accelerated_video_decode)
if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideoDecode))
media::VaapiWrapper::PreSandboxInitialization(); media::VaapiWrapper::PreSandboxInitialization();
#endif #endif
#endif // BUILDFLAG(USE_VAAPI) #endif // BUILDFLAG(USE_VAAPI)
......
...@@ -264,14 +264,14 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, ...@@ -264,14 +264,14 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
if (gpu_preferences_.gpu_sandbox_start_early) { if (gpu_preferences_.gpu_sandbox_start_early) {
// The sandbox will be started earlier than usual (i.e. before GL) so // The sandbox will be started earlier than usual (i.e. before GL) so
// execute the pre-sandbox steps now. // execute the pre-sandbox steps now.
sandbox_helper_->PreSandboxStartup(); sandbox_helper_->PreSandboxStartup(gpu_preferences);
} }
#else #else
// For some reasons MacOSX's VideoToolbox might crash when called after // For some reasons MacOSX's VideoToolbox might crash when called after
// initializing GL, see crbug.com/1047643 and crbug.com/871280. On other // initializing GL, see crbug.com/1047643 and crbug.com/871280. On other
// operating systems like Windows and Android the pre-sandbox steps have // operating systems like Windows and Android the pre-sandbox steps have
// always been executed before initializing GL so keep it this way. // always been executed before initializing GL so keep it this way.
sandbox_helper_->PreSandboxStartup(); sandbox_helper_->PreSandboxStartup(gpu_preferences);
#endif #endif
// Start the GPU watchdog only after anything that is expected to be time // Start the GPU watchdog only after anything that is expected to be time
...@@ -379,7 +379,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, ...@@ -379,7 +379,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
watchdog_thread_->PauseWatchdog(); watchdog_thread_->PauseWatchdog();
// The sandbox is not started yet. // The sandbox is not started yet.
sandbox_helper_->PreSandboxStartup(); sandbox_helper_->PreSandboxStartup(gpu_preferences);
if (watchdog_thread_) if (watchdog_thread_)
watchdog_thread_->ResumeWatchdog(); watchdog_thread_->ResumeWatchdog();
......
...@@ -32,7 +32,7 @@ class GPU_IPC_SERVICE_EXPORT GpuSandboxHelper { ...@@ -32,7 +32,7 @@ class GPU_IPC_SERVICE_EXPORT GpuSandboxHelper {
public: public:
virtual ~GpuSandboxHelper() = default; virtual ~GpuSandboxHelper() = default;
virtual void PreSandboxStartup() = 0; virtual void PreSandboxStartup(const GpuPreferences& gpu_prefs) = 0;
virtual bool EnsureSandboxInitialized(GpuWatchdogThread* watchdog_thread, virtual bool EnsureSandboxInitialized(GpuWatchdogThread* watchdog_thread,
const GPUInfo* gpu_info, const GPUInfo* gpu_info,
......
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