Commit ee9dfa9f authored by Antoine Labour's avatar Antoine Labour Committed by Commit Bot

Correctly handle GPU process launch failure

GpuProcessHost::ReportProcessCrash incorrectly early-outs in case of process
launch failure, and fails to trigger fallback, causing a retry loop.
Instead, correctly track if DidFailInitialize happened (which caused a fallback)
and only early-out in that case.

Bug: 876921
Change-Id: I561de5d73ce8afddf920fa3ff141524bd5797733
Reviewed-on: https://chromium-review.googlesource.com/c/1333129Reviewed-by: default avatarVictor Miura <vmiura@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607702}
parent add4a3fc
...@@ -488,7 +488,6 @@ void GpuHostImpl::DidInitialize( ...@@ -488,7 +488,6 @@ void GpuHostImpl::DidInitialize(
const base::Optional<gpu::GpuFeatureInfo>& const base::Optional<gpu::GpuFeatureInfo>&
gpu_feature_info_for_hardware_gpu) { gpu_feature_info_for_hardware_gpu) {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", true); UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", true);
initialized_ = true;
// Set GPU driver bug workaround flags that are checked on the browser side. // Set GPU driver bug workaround flags that are checked on the browser side.
wake_up_gpu_before_drawing_ = wake_up_gpu_before_drawing_ =
......
...@@ -180,8 +180,6 @@ class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost { ...@@ -180,8 +180,6 @@ class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost {
mojom::GpuService* gpu_service(); mojom::GpuService* gpu_service();
bool initialized() const { return initialized_; }
bool wake_up_gpu_before_drawing() const { bool wake_up_gpu_before_drawing() const {
return wake_up_gpu_before_drawing_; return wake_up_gpu_before_drawing_;
} }
...@@ -248,9 +246,6 @@ class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost { ...@@ -248,9 +246,6 @@ class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost {
// List of connection error handlers for the GpuService. // List of connection error handlers for the GpuService.
std::vector<base::OnceClosure> connection_error_handlers_; std::vector<base::OnceClosure> connection_error_handlers_;
// Whether the GPU service has started successfully or not.
bool initialized_ = false;
// The following are a list of driver bug workarounds that will only be // The following are a list of driver bug workarounds that will only be
// set to true in DidInitialize(), where GPU service has started and GPU // set to true in DidInitialize(), where GPU service has started and GPU
// driver bug workarounds have been computed and sent back. // driver bug workarounds have been computed and sent back.
......
...@@ -953,6 +953,7 @@ void GpuProcessHost::DidInitialize( ...@@ -953,6 +953,7 @@ void GpuProcessHost::DidInitialize(
} }
void GpuProcessHost::DidFailInitialize() { void GpuProcessHost::DidFailInitialize() {
did_fail_initialize_ = true;
if (kind_ == GPU_PROCESS_KIND_SANDBOXED) if (kind_ == GPU_PROCESS_KIND_SANDBOXED)
GpuDataManagerImpl::GetInstance()->FallBackToNextGpuMode(); GpuDataManagerImpl::GetInstance()->FallBackToNextGpuMode();
} }
...@@ -1180,7 +1181,7 @@ void GpuProcessHost::RecordProcessCrash() { ...@@ -1180,7 +1181,7 @@ void GpuProcessHost::RecordProcessCrash() {
} }
// GPU process initialization failed and fallback already happened. // GPU process initialization failed and fallback already happened.
if (!gpu_host_ || !gpu_host_->initialized()) if (did_fail_initialize_)
return; return;
bool disable_crash_limit = base::CommandLine::ForCurrentProcess()->HasSwitch( bool disable_crash_limit = base::CommandLine::ForCurrentProcess()->HasSwitch(
......
...@@ -204,6 +204,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, ...@@ -204,6 +204,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
int connection_filter_id_; int connection_filter_id_;
// The GPU process reported failure to initialize.
bool did_fail_initialize_ = false;
// The total number of GPU process crashes. // The total number of GPU process crashes.
static base::subtle::Atomic32 gpu_crash_count_; static base::subtle::Atomic32 gpu_crash_count_;
static bool crashed_before_; static bool crashed_before_;
......
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