summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-01 23:52:29 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-01 23:52:29 +0000
commite9f0ca8b565cfba2bce76e3be60a8d19913b8174 (patch)
tree744594c86d8693ff69cc11dcb6dd32c6aaa2b048
parent03e1f7b393f9b291bac81738e1490ff7f8c71fa2 (diff)
downloadchromium_src-e9f0ca8b565cfba2bce76e3be60a8d19913b8174.zip
chromium_src-e9f0ca8b565cfba2bce76e3be60a8d19913b8174.tar.gz
chromium_src-e9f0ca8b565cfba2bce76e3be60a8d19913b8174.tar.bz2
Windows: On context lost, GPU process exits.
Some drivers cannot recover from device lost. IDirect3DDevice9::ResetEx returns an access denied error after a GPU hang. Although this results in a fallback to software, exiting the GPU process allows a newly launched GPU process to reinitialize D3D and GPU accelerated features continue to work. I have observed this with an AMD driver but suspect there are issues with Intel from crash reports. Review URL: https://chromiumcodereview.appspot.com/12617020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191705 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--gpu/command_buffer/service/feature_info.cc7
-rw-r--r--gpu/command_buffer/service/feature_info.h1
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc9
3 files changed, 17 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index cd49d08..f70debd 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -97,6 +97,7 @@ FeatureInfo::Workarounds::Workarounds()
flush_on_context_switch(false),
delete_instead_of_resize_fbo(false),
use_client_side_arrays_for_stream_buffers(false),
+ exit_on_context_lost(false),
max_texture_size(0),
max_cube_map_texture_size(0) {
}
@@ -701,6 +702,12 @@ void FeatureInfo::AddFeatures() {
// TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects")
// when available.
}
+
+#if defined(OS_WIN)
+ // Some drivers are unable to reset the D3D device in the GPU process
+ // sandbox.
+ workarounds_.exit_on_context_lost = true;
+#endif
}
void FeatureInfo::AddExtensionString(const std::string& str) {
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h
index 4efff80..3192444 100644
--- a/gpu/command_buffer/service/feature_info.h
+++ b/gpu/command_buffer/service/feature_info.h
@@ -57,6 +57,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool flush_on_context_switch;
bool delete_instead_of_resize_fbo;
bool use_client_side_arrays_for_stream_buffers;
+ bool exit_on_context_lost;
// Note: 0 here means use driver limit.
GLint max_texture_size;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index ec5b2ab..a28bb4c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2853,6 +2853,15 @@ bool GLES2DecoderImpl::MakeCurrent() {
if (WasContextLost()) {
LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent.";
+
+ // 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.";
+ exit(0);
+ }
+
return false;
}