From 44aaa94d4f81c5880f0b2e7dc55877d36d772344 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Fri, 14 Aug 2015 15:26:34 -0700 Subject: [PATCH] Backed out changeset 956b56977688 (bug 1190281) for gfx crashes --- dom/ipc/ContentParent.cpp | 3 -- gfx/gl/GLContext.cpp | 6 ---- gfx/src/DriverCrashGuard.cpp | 54 ------------------------------------ gfx/src/DriverCrashGuard.h | 12 -------- 4 files changed, 75 deletions(-) diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 474766f095c..1bef008771a 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -5196,9 +5196,6 @@ ContentParent::RecvBeginDriverCrashGuard(const uint32_t& aGuardType, bool* aOutC case gfx::CrashGuardType::D3D9Video: guard = MakeUnique(this); break; - case gfx::CrashGuardType::GLContext: - guard = MakeUnique(this); - break; default: MOZ_ASSERT_UNREACHABLE("unknown crash guard type"); return false; diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index 3bedf3bbe40..dff172ba861 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -30,7 +30,6 @@ #include "TextureGarbageBin.h" #include "gfx2DGlue.h" #include "gfxPrefs.h" -#include "DriverCrashGuard.h" #include "mozilla/IntegerPrintfMacros.h" #include "OGLShaderProgram.h" // for ShaderProgramType @@ -369,11 +368,6 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl) return true; } - GLContextCrashGuard crashGuard; - if (crashGuard.Crashed()) { - return false; - } - mWorkAroundDriverBugs = gfxPrefs::WorkAroundDriverBugs(); SymLoadStruct symbols[] = { diff --git a/gfx/src/DriverCrashGuard.cpp b/gfx/src/DriverCrashGuard.cpp index 5ea68f92d7e..a4384e113a6 100644 --- a/gfx/src/DriverCrashGuard.cpp +++ b/gfx/src/DriverCrashGuard.cpp @@ -25,7 +25,6 @@ static const size_t NUM_CRASH_GUARD_TYPES = size_t(CrashGuardType::NUM_TYPES); static const char* sCrashGuardNames[NUM_CRASH_GUARD_TYPES] = { "d3d11layers", "d3d9video", - "glcontext", }; DriverCrashGuard::DriverCrashGuard(CrashGuardType aType, dom::ContentParent* aContentParent) @@ -55,14 +54,6 @@ DriverCrashGuard::InitializeIfNeeded() void DriverCrashGuard::Initialize() { - // Using DriverCrashGuard off the main thread currently does not work. Under - // e10s it could conceivably work by dispatching the IPC calls via the main - // thread. In the parent process this would be harder. For now, we simply - // exit early instead. - if (!NS_IsMainThread()) { - return; - } - if (XRE_IsContentProcess()) { // Ask the parent whether or not activating the guard is okay. The parent // won't bother if it detected a crash. @@ -462,50 +453,5 @@ D3D9VideoCrashGuard::LogFeatureDisabled() gfxCriticalError(CriticalLog::DefaultOptions(false)) << "DXVA2D3D9 video decoding is disabled due to a previous crash."; } -GLContextCrashGuard::GLContextCrashGuard(dom::ContentParent* aContentParent) - : DriverCrashGuard(CrashGuardType::GLContext, aContentParent) -{ -} - -bool -GLContextCrashGuard::UpdateEnvironment() -{ - static bool checked = false; - static bool changed = false; - - if (checked) { - return changed; - } - - checked = true; - -#if defined(XP_WIN) - changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle-force-d3d11", - gfxPrefs::WebGLANGLEForceD3D11()); - changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle-try-d3d11", - gfxPrefs::WebGLANGLETryD3D11()); - changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle-force-warp", - gfxPrefs::WebGLANGLEForceWARP()); - changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle", - FeatureEnabled(nsIGfxInfo::FEATURE_WEBGL_ANGLE)); - changed |= CheckAndUpdateBoolPref("gfx.driver-init.direct3d11-angle", - FeatureEnabled(nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE)); -#endif - - return changed; -} - -void -GLContextCrashGuard::LogCrashRecovery() -{ - gfxCriticalError(CriticalLog::DefaultOptions(false)) << "GLContext just crashed and is now disabled."; -} - -void -GLContextCrashGuard::LogFeatureDisabled() -{ - gfxCriticalError(CriticalLog::DefaultOptions(false)) << "GLContext is disabled due to a previous crash."; -} - } // namespace gfx } // namespace mozilla diff --git a/gfx/src/DriverCrashGuard.h b/gfx/src/DriverCrashGuard.h index 3f40ac82a0c..3d48c7f3912 100644 --- a/gfx/src/DriverCrashGuard.h +++ b/gfx/src/DriverCrashGuard.h @@ -39,7 +39,6 @@ enum class CrashGuardType : uint32_t { D3D11Layers, D3D9Video, - GLContext, NUM_TYPES }; @@ -143,17 +142,6 @@ class D3D9VideoCrashGuard final : public DriverCrashGuard void LogFeatureDisabled() override; }; -class GLContextCrashGuard final : public DriverCrashGuard -{ - public: - explicit GLContextCrashGuard(dom::ContentParent* aContentParent = nullptr); - - protected: - bool UpdateEnvironment() override; - void LogCrashRecovery() override; - void LogFeatureDisabled() override; -}; - } // namespace gfx } // namespace mozilla