Commit b90c7c8c authored by kylechar's avatar kylechar Committed by Commit Bot

Fix GPU process fallback logic.

1. In GpuProcessHost::OnProcessCrashed() record the process crash first.
   This means the GPU mode fallback will happen before a new GPU process
   is started.
2. Don't call FallBackToNextGpuMode() if GPU process initialization
   fails for an unsandboxed GPU process. The unsandboxed GPU is only
   used for collect information and it's failure doesn't indicate a need
   to change GPU modes.

Bug: 869419
Change-Id: I8bd0a03268f0ea8809f3df8458d4e6a92db9391f
Reviewed-on: https://chromium-review.googlesource.com/1157164Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579625}
parent 13e9c43c
......@@ -1158,6 +1158,9 @@ void GpuProcessHost::OnProcessCrashed(int exit_code) {
int process_crash_exit_code = exit_code;
base::debug::Alias(&process_crash_exit_code);
// Record crash before doing anything that could start a new GPU process.
RecordProcessCrash();
// If the GPU process crashed while compiling a shader, we may have invalid
// cached binaries. Completely clear the shader cache to force shader binaries
// to be re-created.
......@@ -1173,7 +1176,6 @@ void GpuProcessHost::OnProcessCrashed(int exit_code) {
}
}
SendOutstandingReplies(EstablishChannelStatus::GPU_HOST_INVALID);
RecordProcessCrash();
ChildProcessTerminationInfo info =
process_->GetTerminationInfo(true /* known_dead */);
......@@ -1211,7 +1213,8 @@ void GpuProcessHost::DidFailInitialize() {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false);
status_ = FAILURE;
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
gpu_data_manager->FallBackToNextGpuMode();
if (kind_ == GPU_PROCESS_KIND_SANDBOXED)
gpu_data_manager->FallBackToNextGpuMode();
RunRequestGPUInfoCallbacks(gpu_data_manager->GetGPUInfo());
}
......
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