Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1149233004: Android: Enable 'crash GPU process on context lost' WAR for Mali-400 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 717c635c9b2e14ac9723740560c4160cb2cf5c6b..a14f72e11199ea51c4abdb21c359217f7eb4c6cc 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -685,6 +685,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
void SetAsyncPixelTransferManagerForTest(
AsyncPixelTransferManager* manager) override;
void SetIgnoreCachedStateForTest(bool ignore) override;
+ void SetAllowExit(bool allow_exit) override;
void ProcessFinishedAsyncTransfers();
bool GetServiceTextureId(uint32 client_texture_id,
@@ -1997,6 +1998,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
GLuint validation_fbo_multisample_;
GLuint validation_fbo_;
+ bool allow_exit_;
+
typedef gpu::gles2::GLES2Decoder::Error (GLES2DecoderImpl::*CmdHandler)(
uint32 immediate_data_size,
const void* data);
@@ -2509,7 +2512,8 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
gpu_debug_commands_(false),
validation_texture_(0),
validation_fbo_multisample_(0),
- validation_fbo_(0) {
+ validation_fbo_(0),
+ allow_exit_(false) {
DCHECK(group);
// The shader translator is used for WebGL even when running on EGL
@@ -4494,6 +4498,10 @@ void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) {
state_.SetIgnoreCachedStateForTest(ignore);
}
+void GLES2DecoderImpl::SetAllowExit(bool allow_exit) {
+ allow_exit_ = allow_exit;
+}
+
void GLES2DecoderImpl::OnFboChanged() const {
if (workarounds().restore_scissor_on_fbo_change)
state_.fbo_binding_for_scissor_workaround_dirty = true;
@@ -11326,11 +11334,10 @@ void GLES2DecoderImpl::MarkContextLost(error::ContextLostReason reason) {
current_decoder_error_ = error::kLostContext;
context_was_lost_ = true;
- // Some D3D drivers cannot recover from device lost in the GPU process
- // sandbox. Allow a new GPU process to launch.
- if (workarounds().exit_on_context_lost) {
- LOG(ERROR) << "Exiting GPU process because some drivers cannot reset"
- << " a D3D device in the Chrome GPU process sandbox.";
+ // Work around issues with recovery by allowing a new GPU process to launch.
+ if (workarounds().exit_on_context_lost && allow_exit_) {
+ LOG(ERROR) << "Exiting GPU process because some drivers cannot recover"
+ << " from problems.";
#if defined(OS_WIN)
base::win::SetShouldCrashOnProcessDetach(false);
#endif
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698