Commit d17c53b3 authored by Julien Isorce's avatar Julien Isorce Committed by Commit Bot

Call PreSandboxStartup after GL initialization in GpuInit

Fixes "vaInitialize failed: unknown libva error"
on Wayland with LIBVA_DRIVER_NAME=i965

VaapiWrapper relies on the GL implementation to decide
which display to use. If the GL implementation is none,
then VaapiWrapper is likely to do the wrong guess resulting
in the above error.

Bug: 1041229
Change-Id: I1255a032a5e14b3aaffe3026a886de7e6d9ff0d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2011640Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733847}
parent f10b4c84
...@@ -221,11 +221,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, ...@@ -221,11 +221,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
delayed_watchdog_enable = true; delayed_watchdog_enable = true;
#endif #endif
// PreSandbox is mainly for resource handling and not related to the GPU
// driver, it doesn't need the GPU watchdog. The loadLibrary may take long
// time that killing and restarting the GPU process will not help.
sandbox_helper_->PreSandboxStartup();
// 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
// consuming has completed, otherwise the process is liable to be aborted. // consuming has completed, otherwise the process is liable to be aborted.
if (enable_watchdog && !delayed_watchdog_enable) { if (enable_watchdog && !delayed_watchdog_enable) {
...@@ -308,6 +303,14 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, ...@@ -308,6 +303,14 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
return false; return false;
} }
// The ContentSandboxHelper is currently the only one implementation of
// gpu::GpuSandboxHelper and it has no dependency. Except on Linux where
// VaapiWrapper checks the GL implementation to determine which display
// to use. So call PreSandboxStartup after GL initialization. But make
// sure the watchdog is still in pause as loadLibrary may take a long time
// and restarting the GPU process will not help.
sandbox_helper_->PreSandboxStartup();
if (watchdog_thread_) if (watchdog_thread_)
watchdog_thread_->ResumeWatchdog(); watchdog_thread_->ResumeWatchdog();
if (gl::GetGLImplementation() != gl::kGLImplementationDisabled) { if (gl::GetGLImplementation() != gl::kGLImplementationDisabled) {
......
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