Commit b35aa1f7 authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

Trigger !synthetic_loss if driver is in a bad state

This is mostly based on the OOM detection added to SharedContextState,
but may apply to Skia detected errors as well. If we detect
|driver_needs_reset_|, we should have
|GpuChannelManager::OnContextLost(false)| called to LoseAllContexts when
context virtualization is enabled.

Change-Id: Ife7e6c4db744b24ab2ed55476bed90b05eb1aebf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363071Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: Jonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799160}
parent 90f620c2
...@@ -536,8 +536,7 @@ void SharedContextState::MarkContextLost(error::ContextLostReason reason) { ...@@ -536,8 +536,7 @@ void SharedContextState::MarkContextLost(error::ContextLostReason reason) {
gr_context_ = nullptr; gr_context_ = nullptr;
} }
UpdateSkiaOwnedMemorySize(); UpdateSkiaOwnedMemorySize();
std::move(context_lost_callback_) std::move(context_lost_callback_).Run(!device_needs_reset_);
.Run(!context_lost_by_robustness_extension);
for (auto& observer : context_lost_observers_) for (auto& observer : context_lost_observers_)
observer.OnContextLost(); observer.OnContextLost();
} }
...@@ -788,8 +787,8 @@ bool SharedContextState::CheckResetStatus(bool needs_gl) { ...@@ -788,8 +787,8 @@ bool SharedContextState::CheckResetStatus(bool needs_gl) {
LOG(ERROR) << "SharedContextState context lost via ARB/EXT_robustness. Reset " LOG(ERROR) << "SharedContextState context lost via ARB/EXT_robustness. Reset "
"status = " "status = "
<< gles2::GLES2Util::GetStringEnum(driver_status); << gles2::GLES2Util::GetStringEnum(driver_status);
context_lost_by_robustness_extension = true;
device_needs_reset_ = true;
switch (driver_status) { switch (driver_status) {
case GL_GUILTY_CONTEXT_RESET_ARB: case GL_GUILTY_CONTEXT_RESET_ARB:
MarkContextLost(error::kGuilty); MarkContextLost(error::kGuilty);
...@@ -804,7 +803,6 @@ bool SharedContextState::CheckResetStatus(bool needs_gl) { ...@@ -804,7 +803,6 @@ bool SharedContextState::CheckResetStatus(bool needs_gl) {
NOTREACHED(); NOTREACHED();
break; break;
} }
device_needs_reset_ = true;
return true; return true;
} }
......
...@@ -333,7 +333,6 @@ class GPU_GLES2_EXPORT SharedContextState ...@@ -333,7 +333,6 @@ class GPU_GLES2_EXPORT SharedContextState
base::MRUCache<void*, sk_sp<SkSurface>> sk_surface_cache_; base::MRUCache<void*, sk_sp<SkSurface>> sk_surface_cache_;
bool device_needs_reset_ = false; bool device_needs_reset_ = false;
bool context_lost_by_robustness_extension = false;
base::Time last_gl_check_graphics_reset_status_; base::Time last_gl_check_graphics_reset_status_;
bool disable_check_reset_status_throttling_for_test_ = false; bool disable_check_reset_status_throttling_for_test_ = false;
......
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