diff --git a/compositor/DrmDisplayComposition.cpp b/compositor/DrmDisplayComposition.cpp
index 47f669d..c0fbba0 100644
--- a/compositor/DrmDisplayComposition.cpp
+++ b/compositor/DrmDisplayComposition.cpp
@@ -130,155 +130,4 @@
   return 0;
 }
 
-static const char *DrmCompositionTypeToString(DrmCompositionType type) {
-  switch (type) {
-    case DRM_COMPOSITION_TYPE_EMPTY:
-      return "EMPTY";
-    case DRM_COMPOSITION_TYPE_FRAME:
-      return "FRAME";
-    case DRM_COMPOSITION_TYPE_DPMS:
-      return "DPMS";
-    case DRM_COMPOSITION_TYPE_MODESET:
-      return "MODESET";
-    default:
-      return "<invalid>";
-  }
-}
-
-static const char *DPMSModeToString(uint32_t dpms_mode) {
-  switch (dpms_mode) {
-    case DRM_MODE_DPMS_ON:
-      return "ON";
-    case DRM_MODE_DPMS_OFF:
-      return "OFF";
-    default:
-      return "<invalid>";
-  }
-}
-
-static void DumpBuffer(const DrmHwcLayer &layer, std::ostringstream *out) {
-  *out << "buffer[w/h/format]=";
-  *out << layer.buffer_info.width << "/" << layer.buffer_info.height << "/"
-       << layer.buffer_info.format;
-}
-
-static void DumpTransform(uint32_t transform, std::ostringstream *out) {
-  *out << "[";
-
-  if (transform == 0)
-    *out << "IDENTITY";
-
-  bool separator = false;
-  if (transform & DrmHwcTransform::kFlipH) {
-    *out << "FLIPH";
-    separator = true;
-  }
-  if (transform & DrmHwcTransform::kFlipV) {
-    if (separator)
-      *out << "|";
-    *out << "FLIPV";
-    separator = true;
-  }
-  if (transform & DrmHwcTransform::kRotate90) {
-    if (separator)
-      *out << "|";
-    *out << "ROTATE90";
-    separator = true;
-  }
-  if (transform & DrmHwcTransform::kRotate180) {
-    if (separator)
-      *out << "|";
-    *out << "ROTATE180";
-    separator = true;
-  }
-  if (transform & DrmHwcTransform::kRotate270) {
-    if (separator)
-      *out << "|";
-    *out << "ROTATE270";
-    separator = true;
-  }
-
-  uint32_t valid_bits = DrmHwcTransform::kFlipH | DrmHwcTransform::kFlipV |
-                        DrmHwcTransform::kRotate90 |
-                        DrmHwcTransform::kRotate180 |
-                        DrmHwcTransform::kRotate270;
-  if (transform & ~valid_bits) {
-    if (separator)
-      *out << "|";
-    *out << "INVALID";
-  }
-  *out << "]";
-}
-
-static const char *BlendingToString(DrmHwcBlending blending) {
-  switch (blending) {
-    case DrmHwcBlending::kNone:
-      return "NONE";
-    case DrmHwcBlending::kPreMult:
-      return "PREMULT";
-    case DrmHwcBlending::kCoverage:
-      return "COVERAGE";
-    default:
-      return "<invalid>";
-  }
-}
-
-void DrmDisplayComposition::Dump(std::ostringstream *out) const {
-  *out << "----DrmDisplayComposition"
-       << " crtc=" << (crtc_ ? crtc_->id() : -1)
-       << " type=" << DrmCompositionTypeToString(type_);
-
-  switch (type_) {
-    case DRM_COMPOSITION_TYPE_DPMS:
-      *out << " dpms_mode=" << DPMSModeToString(dpms_mode_);
-      break;
-    case DRM_COMPOSITION_TYPE_MODESET:
-      *out << " display_mode=" << display_mode_.h_display() << "x"
-           << display_mode_.v_display();
-      break;
-    default:
-      break;
-  }
-
-  *out << "    Layers: count=" << layers_.size() << "\n";
-  for (size_t i = 0; i < layers_.size(); i++) {
-    const DrmHwcLayer &layer = layers_[i];
-    *out << "      [" << i << "] ";
-
-    DumpBuffer(layer, out);
-
-    if (layer.protected_usage())
-      *out << " protected";
-
-    *out << " transform=";
-    DumpTransform(layer.transform, out);
-    *out << " blending[a=" << (int)layer.alpha
-         << "]=" << BlendingToString(layer.blending) << "\n";
-  }
-
-  *out << "    Planes: count=" << composition_planes_.size() << "\n";
-  for (size_t i = 0; i < composition_planes_.size(); i++) {
-    const DrmCompositionPlane &comp_plane = composition_planes_[i];
-    *out << "      [" << i << "]"
-         << " plane=" << (comp_plane.plane() ? comp_plane.plane()->id() : -1)
-         << " type=";
-    switch (comp_plane.type()) {
-      case DrmCompositionPlane::Type::kDisable:
-        *out << "DISABLE";
-        break;
-      case DrmCompositionPlane::Type::kLayer:
-        *out << "LAYER";
-        break;
-      default:
-        *out << "<invalid>";
-        break;
-    }
-
-    *out << " source_layer=";
-    for (auto i : comp_plane.source_layers()) {
-      *out << i << " ";
-    }
-    *out << "\n";
-  }
-}
 }  // namespace android
diff --git a/compositor/DrmDisplayComposition.h b/compositor/DrmDisplayComposition.h
index 1738630..bbac0af 100644
--- a/compositor/DrmDisplayComposition.h
+++ b/compositor/DrmDisplayComposition.h
@@ -127,8 +127,6 @@
     return planner_;
   }
 
-  void Dump(std::ostringstream *out) const;
-
   UniqueFd out_fence_;
 
  private:
diff --git a/compositor/DrmDisplayCompositor.cpp b/compositor/DrmDisplayCompositor.cpp
index 5b16cad..4539664 100644
--- a/compositor/DrmDisplayCompositor.cpp
+++ b/compositor/DrmDisplayCompositor.cpp
@@ -45,13 +45,7 @@
       display_(-1),
       initialized_(false),
       active_(false),
-      use_hw_overlays_(true),
-      dump_frames_composited_(0),
-      dump_last_timestamp_ns_(0) {
-  struct timespec ts {};
-  if (clock_gettime(CLOCK_MONOTONIC, &ts))
-    return;
-  dump_last_timestamp_ns_ = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
+      use_hw_overlays_(true) {
 }
 
 DrmDisplayCompositor::~DrmDisplayCompositor() {
@@ -304,7 +298,6 @@
     ClearDisplay();
     return;
   }
-  ++dump_frames_composited_;
 
   active_composition_.swap(composition);
 }
@@ -356,26 +349,4 @@
   return CommitFrame(composition, true);
 }
 
-void DrmDisplayCompositor::Dump(std::ostringstream *out) const {
-  uint64_t num_frames = dump_frames_composited_;
-  dump_frames_composited_ = 0;
-
-  struct timespec ts {};
-  int ret = clock_gettime(CLOCK_MONOTONIC, &ts);
-  if (ret) {
-    return;
-  }
-
-  uint64_t cur_ts = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
-  uint64_t num_ms = (cur_ts - dump_last_timestamp_ns_) / (1000 * 1000);
-  float fps = num_ms ? static_cast<float>(num_frames) * 1000.0F /
-                           static_cast<float>(num_ms)
-                     : 0.0F;
-
-  *out << "--DrmDisplayCompositor[" << display_
-       << "]: num_frames=" << num_frames << " num_ms=" << num_ms
-       << " fps=" << fps << "\n";
-
-  dump_last_timestamp_ns_ = cur_ts;
-}
 }  // namespace android
diff --git a/compositor/DrmDisplayCompositor.h b/compositor/DrmDisplayCompositor.h
index 04c0bae..d12a7b1 100644
--- a/compositor/DrmDisplayCompositor.h
+++ b/compositor/DrmDisplayCompositor.h
@@ -45,7 +45,6 @@
   int ApplyComposition(std::unique_ptr<DrmDisplayComposition> composition);
   int TestComposition(DrmDisplayComposition *composition);
   int Composite();
-  void Dump(std::ostringstream *out) const;
   void ClearDisplay();
   UniqueFd TakeOutFence() {
     if (!active_composition_) {
@@ -91,10 +90,6 @@
 
   ModeState mode_;
 
-  // State tracking progress since our last Dump(). These are mutable since
-  // we need to reset them on every Dump() call.
-  mutable uint64_t dump_frames_composited_;
-  mutable uint64_t dump_last_timestamp_ns_;
   std::unique_ptr<Planner> planner_;
 };
 }  // namespace android
