Backed out changeset 20203c94ef23 (bug 1365879)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 23 Jun 2017 12:15:21 +0200
changeset 365762 671f398507525103abbaf6eaf50a0d036e5030d6
parent 365761 1466b62da7b2512669c6bc1a3a826fd4171e41a5
child 365763 0ead1fd2e1d4a97425e4badccac5e6fc43c124a7
push id32082
push usercbook@mozilla.com
push dateFri, 23 Jun 2017 10:20:27 +0000
treeherdermozilla-central@2277b567b242 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1365879
milestone56.0a1
backs out20203c94ef235a5503e7ad8c56d95af6c0a174bd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 20203c94ef23 (bug 1365879)
gfx/ipc/GPUParent.cpp
gfx/layers/d3d11/MLGDeviceD3D11.cpp
gfx/layers/mlgpu/MemoryReportingMLGPU.cpp
gfx/layers/mlgpu/MemoryReportingMLGPU.h
gfx/layers/mlgpu/StagingBuffer.h
gfx/layers/moz.build
gfx/thebes/gfxPlatform.cpp
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -24,17 +24,16 @@
 #include "mozilla/layers/APZThreadUtils.h"
 #include "mozilla/layers/APZCTreeManager.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "mozilla/layers/CompositorManagerParent.h"
 #include "mozilla/layers/CompositorThread.h"
 #include "mozilla/layers/ImageBridgeParent.h"
 #include "mozilla/layers/LayerTreeOwnerTracker.h"
 #include "mozilla/layers/UiCompositorControllerParent.h"
-#include "mozilla/layers/MemoryReportingMLGPU.h"
 #include "mozilla/webrender/RenderThread.h"
 #include "nsDebugImpl.h"
 #include "nsExceptionHandler.h"
 #include "nsThreadManager.h"
 #include "prenv.h"
 #include "ProcessUtils.h"
 #include "VRManager.h"
 #include "VRManagerParent.h"
@@ -100,17 +99,16 @@ GPUParent::Init(base::ProcessId aParentP
 
   // Ensure gfxPrefs are initialized.
   gfxPrefs::GetSingleton();
   gfxConfig::Init();
   gfxVars::Initialize();
   gfxPlatform::InitNullMetadata();
   // Ensure our Factory is initialised, mainly for gfx logging to work.
   gfxPlatform::InitMoz2DLogging();
-  mlg::InitializeMemoryReporters();
 #if defined(XP_WIN)
   DeviceManagerDx::Init();
 #endif
 
   if (NS_FAILED(NS_InitMinimalXPCOM())) {
     return false;
   }
 
--- a/gfx/layers/d3d11/MLGDeviceD3D11.cpp
+++ b/gfx/layers/d3d11/MLGDeviceD3D11.cpp
@@ -6,17 +6,16 @@
 #include "MLGDeviceD3D11.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/WindowsVersion.h"
 #include "mozilla/gfx/GPUParent.h"
 #include "mozilla/gfx/StackArray.h"
 #include "mozilla/layers/DiagnosticsD3D11.h"
 #include "mozilla/layers/LayerMLGPU.h"
-#include "mozilla/layers/MemoryReportingMLGPU.h"
 #include "mozilla/layers/ShaderDefinitionsMLGPU.h"
 #include "mozilla/widget/CompositorWidget.h"
 #include "mozilla/widget/WinCompositorWidget.h"
 #include "MLGShaders.h"
 #include "TextureD3D11.h"
 #include "gfxPrefs.h"
 
 namespace mozilla {
@@ -35,19 +34,16 @@ static D3D11_BOX RectToBox(const gfx::In
 MLGRenderTargetD3D11::MLGRenderTargetD3D11(const gfx::IntSize& aSize, MLGRenderTargetFlags aFlags)
  : MLGRenderTarget(aFlags),
    mSize(aSize)
 {
 }
 
 MLGRenderTargetD3D11::~MLGRenderTargetD3D11()
 {
-  if (mDepthBuffer) {
-    sRenderTargetUsage -= mSize.width * mSize.height * 1;
-  }
   ForgetTexture();
 }
 
 bool
 MLGRenderTargetD3D11::Initialize(ID3D11Device* aDevice)
 {
   D3D11_TEXTURE2D_DESC desc;
   ::ZeroMemory(&desc, sizeof(desc));
@@ -118,27 +114,23 @@ MLGRenderTargetD3D11::UpdateTexture(ID3D
     if (FAILED(hr) || !view) {
       gfxCriticalNote << "Failed to create render target view: " << hexa(hr);
       return false;
     }
   }
 
   mTexture = aTexture;
   mRTView = view.forget();
-  sRenderTargetUsage += mSize.width * mSize.height * 4;
   return true;
 }
 
 void
 MLGRenderTargetD3D11::ForgetTexture()
 {
-  if (mTexture) {
-    sRenderTargetUsage -= mSize.width * mSize.height * 4;
-    mTexture = nullptr;
-  }
+  mTexture = nullptr;
   mRTView = nullptr;
   mTextureSource = nullptr;
 }
 
 bool
 MLGRenderTargetD3D11::CreateDepthBuffer(ID3D11Device* aDevice)
 {
   D3D11_TEXTURE2D_DESC desc;
@@ -169,17 +161,16 @@ MLGRenderTargetD3D11::CreateDepthBuffer(
   hr = aDevice->CreateDepthStencilView(buffer, &viewDesc, getter_AddRefs(dsv));
   if (FAILED(hr) || !dsv) {
     gfxCriticalNote << "Could not create depth-stencil view: " << hexa(hr);
     return false;
   }
 
   mDepthBuffer = buffer;
   mDepthStencilView = dsv;
-  sRenderTargetUsage += mSize.width * mSize.height * 1;
   return true;
 }
 
 ID3D11DepthStencilView*
 MLGRenderTargetD3D11::GetDSV()
 {
   return mDepthStencilView;
 }
@@ -628,36 +619,20 @@ MLGBufferD3D11::Create(ID3D11Device* aDe
   return new MLGBufferD3D11(buffer, aType, aSize);
 }
 
 MLGBufferD3D11::MLGBufferD3D11(ID3D11Buffer* aBuffer, MLGBufferType aType, size_t aSize)
  : mBuffer(aBuffer),
    mType(aType),
    mSize(aSize)
 {
-  switch (mType) {
-  case MLGBufferType::Vertex:
-    mlg::sVertexBufferUsage += mSize;
-    break;
-  case MLGBufferType::Constant:
-    mlg::sConstantBufferUsage += mSize;
-    break;
-  }
 }
 
 MLGBufferD3D11::~MLGBufferD3D11()
 {
-  switch (mType) {
-  case MLGBufferType::Vertex:
-    mlg::sVertexBufferUsage -= mSize;
-    break;
-  case MLGBufferType::Constant:
-    mlg::sConstantBufferUsage -= mSize;
-    break;
-  }
 }
 
 MLGTextureD3D11::MLGTextureD3D11(ID3D11Texture2D* aTexture)
  : mTexture(aTexture)
 {
   D3D11_TEXTURE2D_DESC desc;
   aTexture->GetDesc(&desc);
 
deleted file mode 100644
--- a/gfx/layers/mlgpu/MemoryReportingMLGPU.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "MemoryReportingMLGPU.h"
-#include "nsIMemoryReporter.h"
-
-namespace mozilla {
-namespace layers {
-namespace mlg {
-
-mozilla::Atomic<size_t> sConstantBufferUsage;
-mozilla::Atomic<size_t> sVertexBufferUsage;
-mozilla::Atomic<size_t> sRenderTargetUsage;
-
-class MemoryReportingMLGPU final : public nsIMemoryReporter
-{
-public:
-  NS_DECL_ISUPPORTS
-
-  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
-                            nsISupports* aData,
-                            bool aAnonymize) override
-  {
-    if (sConstantBufferUsage) {
-      MOZ_COLLECT_REPORT(
-        "mlgpu-constant-buffers", KIND_OTHER, UNITS_BYTES,
-        sConstantBufferUsage,
-        "Advanced Layers shader constant buffers.");
-    }
-    if (sVertexBufferUsage) {
-      MOZ_COLLECT_REPORT(
-        "mlgpu-vertex-buffers", KIND_OTHER, UNITS_BYTES,
-        sVertexBufferUsage,
-        "Advanced Layers shader vertex buffers.");
-    }
-    if (sRenderTargetUsage) {
-      MOZ_COLLECT_REPORT(
-        "mlgpu-render-targets", KIND_OTHER, UNITS_BYTES,
-        sRenderTargetUsage,
-        "Advanced Layers render target textures and depth buffers.");
-    }
-    return NS_OK;
-  }
-
-private:
-  ~MemoryReportingMLGPU() {}
-};
-
-NS_IMPL_ISUPPORTS(MemoryReportingMLGPU, nsIMemoryReporter);
-
-void
-InitializeMemoryReporters()
-{
-  RegisterStrongMemoryReporter(new MemoryReportingMLGPU());
-}
-
-} // namespace mlg
-} // namespace layers
-} // namespace mozilla
deleted file mode 100644
--- a/gfx/layers/mlgpu/MemoryReportingMLGPU.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_gfx_layers_mlgpu_MemoryReportingMLGPU_h
-#define mozilla_gfx_layers_mlgpu_MemoryReportingMLGPU_h
-
-#include "mozilla/Atomics.h"
-
-namespace mozilla {
-namespace layers {
-namespace mlg {
-
-void InitializeMemoryReporters();
-
-extern mozilla::Atomic<size_t> sConstantBufferUsage;
-extern mozilla::Atomic<size_t> sVertexBufferUsage;
-extern mozilla::Atomic<size_t> sRenderTargetUsage;
-
-} // namespace mlg
-} // namespace layers
-} // namespace mozilla
-
-#endif // mozilla_gfx_layers_mlgpu_MemoryReportingMLGPU_h
--- a/gfx/layers/mlgpu/StagingBuffer.h
+++ b/gfx/layers/mlgpu/StagingBuffer.h
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_gfx_layers_mlgpu_StagingBuffer_h
 #define mozilla_gfx_layers_mlgpu_StagingBuffer_h
 
-#include "mozilla/MathAlgorithms.h"
 #include "mozilla/UniquePtr.h"
 #include "UtilityMLGPU.h"
 #include <algorithm>
 #include <utility>
 #include <limits.h>
 
 namespace mozilla {
 namespace layers {
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -195,17 +195,16 @@ EXPORTS.mozilla.layers += [
     'ipc/VideoBridgeChild.h',
     'ipc/VideoBridgeParent.h',
     'LayerAttributes.h',
     'LayerMetricsWrapper.h',
     'LayersHelpers.h',
     'LayersTypes.h',
     'mlgpu/LayerManagerMLGPU.h',
     'mlgpu/LayerMLGPU.h',
-    'mlgpu/MemoryReportingMLGPU.h',
     'mlgpu/MLGDevice.h',
     'mlgpu/MLGDeviceTypes.h',
     'mlgpu/ShaderDefinitionsMLGPU.h',
     'mlgpu/UtilityMLGPU.h',
     'opengl/CompositingRenderTargetOGL.h',
     'opengl/CompositorOGL.h',
     'opengl/MacIOSurfaceTextureClientOGL.h',
     'opengl/MacIOSurfaceTextureHostOGL.h',
@@ -407,17 +406,16 @@ UNIFIED_SOURCES += [
     'mlgpu/BufferCache.cpp',
     'mlgpu/CanvasLayerMLGPU.cpp',
     'mlgpu/ContainerLayerMLGPU.cpp',
     'mlgpu/FrameBuilder.cpp',
     'mlgpu/ImageLayerMLGPU.cpp',
     'mlgpu/LayerManagerMLGPU.cpp',
     'mlgpu/LayerMLGPU.cpp',
     'mlgpu/MaskOperation.cpp',
-    'mlgpu/MemoryReportingMLGPU.cpp',
     'mlgpu/MLGDevice.cpp',
     'mlgpu/PaintedLayerMLGPU.cpp',
     'mlgpu/RenderPassMLGPU.cpp',
     'mlgpu/RenderViewMLGPU.cpp',
     'mlgpu/ShaderDefinitionsMLGPU.cpp',
     'mlgpu/SharedBufferMLGPU.cpp',
     'mlgpu/StagingBuffer.cpp',
     'mlgpu/TexturedLayerMLGPU.cpp',
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -132,17 +132,16 @@ class mozilla::gl::SkiaGLGlue : public G
 #include "VsyncSource.h"
 #include "SoftwareVsyncSource.h"
 #include "nscore.h" // for NS_FREE_PERMANENT_DATA
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "gfxVR.h"
 #include "VRManagerChild.h"
 #include "mozilla/gfx/GPUParent.h"
-#include "mozilla/layers/MemoryReportingMLGPU.h"
 #include "prsystem.h"
 
 namespace mozilla {
 namespace layers {
 void ShutdownTileCache();
 } // namespace layers
 } // namespace mozilla
 
@@ -793,17 +792,16 @@ gfxPlatform::Init()
 
     // Request the imgITools service, implicitly initializing ImageLib.
     nsCOMPtr<imgITools> imgTools = do_GetService("@mozilla.org/image/tools;1");
     if (!imgTools) {
       MOZ_CRASH("Could not initialize ImageLib");
     }
 
     RegisterStrongMemoryReporter(new GfxMemoryImageReporter());
-    mlg::InitializeMemoryReporters();
 
     if (XRE_IsParentProcess()) {
       if (gfxPlatform::ForceSoftwareVsync()) {
         gPlatform->mVsyncSource = (gPlatform)->gfxPlatform::CreateHardwareVsyncSource();
       } else {
         gPlatform->mVsyncSource = gPlatform->CreateHardwareVsyncSource();
       }
     }