summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sievers <sievers@chromium.org>2015-08-11 16:50:27 -0700
committerDaniel Sievers <sievers@chromium.org>2015-08-11 23:51:36 +0000
commit58394f1554f0b444d2945a8767abfbf214d5417b (patch)
tree055dd4db7af6cfa5ce1d37b3ee387289fe896bff
parent33d3923aa4f2f480347f840d09b790fb623c9f39 (diff)
downloadchromium_src-58394f1554f0b444d2945a8767abfbf214d5417b.zip
chromium_src-58394f1554f0b444d2945a8767abfbf214d5417b.tar.gz
chromium_src-58394f1554f0b444d2945a8767abfbf214d5417b.tar.bz2
gpu: Crash GPU process when context was lost through robustness
This works around both recovery problems in drivers as well as in our recovery flow (480545). Note that this is already the default behavior on Windows. BUG=458269,475676,503414,480545 Review URL: https://codereview.chromium.org/1282973004 Cr-Commit-Position: refs/heads/master@{#342928} (cherry picked from commit 751a98d265bf854b6b6d216fb7d20ef6ec1313c8) Review URL: https://codereview.chromium.org/1291593002 . Cr-Commit-Position: refs/branch-heads/2454@{#288} Cr-Branched-From: 12bfc3360892ec53cd00fc239a47e5298beb063b-refs/heads/master@{#338390}
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc42
1 files changed, 25 insertions, 17 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 3cd0ed0..181d9ed 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -1088,26 +1088,34 @@ bool GpuCommandBufferStub::CheckContextLost() {
gpu::CommandBuffer::State state = command_buffer_->GetLastState();
bool was_lost = state.error == gpu::error::kLostContext;
- // Work around issues with recovery by allowing a new GPU process to launch.
- if (was_lost &&
- context_group_->feature_info()->workarounds().exit_on_context_lost &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSingleProcess) &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kInProcessGPU)) {
- LOG(ERROR) << "Exiting GPU process because some drivers cannot recover"
- << " from problems.";
+ if (was_lost) {
+ bool was_lost_by_robustness =
+ decoder_ && decoder_->WasContextLostByRobustnessExtension();
+
+ // Work around issues with recovery by allowing a new GPU process to launch.
+ if ((was_lost_by_robustness ||
+ context_group_->feature_info()->workarounds().exit_on_context_lost) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kInProcessGPU)) {
+ LOG(ERROR) << "Exiting GPU process because some drivers cannot recover"
+ << " from problems.";
#if defined(OS_WIN)
- base::win::SetShouldCrashOnProcessDetach(false);
+ base::win::SetShouldCrashOnProcessDetach(false);
#endif
- exit(0);
+ exit(0);
+ }
+
+ // Lose all other contexts if the reset was triggered by the robustness
+ // extension instead of being synthetic.
+ if (was_lost_by_robustness &&
+ (gfx::GLContext::LosesAllContextsOnContextLost() ||
+ use_virtualized_gl_context_)) {
+ channel_->LoseAllContexts();
+ }
}
- // Lose all other contexts if the reset was triggered by the robustness
- // extension instead of being synthetic.
- if (was_lost && decoder_ && decoder_->WasContextLostByRobustnessExtension() &&
- (gfx::GLContext::LosesAllContextsOnContextLost() ||
- use_virtualized_gl_context_))
- channel_->LoseAllContexts();
+
CheckCompleteWaits();
return was_lost;
}