Commit db6b7b1c authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Poke GPU watchdog a few more times during context destruction.

We still see a bit of hang at buffer_manager() destruction, which is the
beginning of ContextGroup destruction. So we add a few pokes in context
destruction before the ContextGroup destruction.

BUG=749046
TEST=crash reports go down
R=piman@chromium.org

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I4726e63f2cf4fa5c1471a25ef65f8d8ac9411c09
Reviewed-on: https://chromium-review.googlesource.com/1237114Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592923}
parent 4f9e310f
...@@ -236,6 +236,8 @@ class GPU_GLES2_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { ...@@ -236,6 +236,8 @@ class GPU_GLES2_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
const GpuFeatureInfo& gpu_feature_info() const { return gpu_feature_info_; } const GpuFeatureInfo& gpu_feature_info() const { return gpu_feature_info_; }
void ReportProgress();
private: private:
friend class base::RefCounted<ContextGroup>; friend class base::RefCounted<ContextGroup>;
~ContextGroup(); ~ContextGroup();
...@@ -245,7 +247,6 @@ class GPU_GLES2_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { ...@@ -245,7 +247,6 @@ class GPU_GLES2_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v);
bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32_t* v); bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32_t* v);
bool HaveContexts(); bool HaveContexts();
void ReportProgress();
// It's safer to make a copy of the GpuPreferences struct rather // It's safer to make a copy of the GpuPreferences struct rather
// than refer to the one passed in to the constructor. // than refer to the one passed in to the constructor.
......
...@@ -2372,6 +2372,11 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { ...@@ -2372,6 +2372,11 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
// Compiles the given shader and exits command processing early. // Compiles the given shader and exits command processing early.
void CompileShaderAndExitCommandProcessingEarly(Shader* shader); void CompileShaderAndExitCommandProcessingEarly(Shader* shader);
// Notify the watchdog thread of progress, preventing time-outs when a
// command takes a long time. May be no-op when using in-process command
// buffer.
void ReportProgress();
// Generate a member function prototype for each command in an automated and // Generate a member function prototype for each command in an automated and
// typesafe way. // typesafe way.
#define GLES2_CMD_OP(name) \ #define GLES2_CMD_OP(name) \
...@@ -5127,6 +5132,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) { ...@@ -5127,6 +5132,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
} }
deschedule_until_finished_fences_.clear(); deschedule_until_finished_fences_.clear();
ReportProgress();
// Unbind everything. // Unbind everything.
state_.vertex_attrib_manager = nullptr; state_.vertex_attrib_manager = nullptr;
state_.default_vertex_attrib_manager = nullptr; state_.default_vertex_attrib_manager = nullptr;
...@@ -5160,6 +5167,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) { ...@@ -5160,6 +5167,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
srgb_converter_.reset(); srgb_converter_.reset();
clear_framebuffer_blit_.reset(); clear_framebuffer_blit_.reset();
ReportProgress();
if (framebuffer_manager_.get()) { if (framebuffer_manager_.get()) {
framebuffer_manager_->Destroy(have_context); framebuffer_manager_->Destroy(have_context);
if (group_->texture_manager()) if (group_->texture_manager())
...@@ -5191,6 +5200,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) { ...@@ -5191,6 +5200,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
transform_feedback_manager_.reset(); transform_feedback_manager_.reset();
} }
ReportProgress();
offscreen_target_frame_buffer_.reset(); offscreen_target_frame_buffer_.reset();
offscreen_target_color_texture_.reset(); offscreen_target_color_texture_.reset();
offscreen_target_color_render_buffer_.reset(); offscreen_target_color_render_buffer_.reset();
...@@ -5209,6 +5220,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) { ...@@ -5209,6 +5220,8 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
// ShaderTranslatorCache. // ShaderTranslatorCache.
DestroyShaderTranslator(); DestroyShaderTranslator();
ReportProgress();
// Destroy the GPU Tracer which may own some in process GPU Timings. // Destroy the GPU Tracer which may own some in process GPU Timings.
if (gpu_tracer_) { if (gpu_tracer_) {
gpu_tracer_->Destroy(have_context); gpu_tracer_->Destroy(have_context);
...@@ -20026,6 +20039,11 @@ void GLES2DecoderImpl::CompileShaderAndExitCommandProcessingEarly( ...@@ -20026,6 +20039,11 @@ void GLES2DecoderImpl::CompileShaderAndExitCommandProcessingEarly(
ExitCommandProcessingEarly(); ExitCommandProcessingEarly();
} }
void GLES2DecoderImpl::ReportProgress() {
if (group_)
group_->ReportProgress();
}
// Include the auto-generated part of this file. We split this because it means // Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file // we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator. // instead of having to edit some template or the code generator.
......
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