drm_hwcomposer: Implement Dump() for DrmCompositor

Output simple fps information from the DrmCompositor on Dump().

Change-Id: Ic1f4f922fa2cd15e1fc7c6fdb412baa33611676f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmcompositor.h b/drmcompositor.h
index 6b92a22..ad1316c 100644
--- a/drmcompositor.h
+++ b/drmcompositor.h
@@ -26,6 +26,7 @@
 
 #include <pthread.h>
 #include <queue>
+#include <sstream>
 
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer.h>
@@ -49,6 +50,7 @@
 
   virtual int QueueComposition(Composition *composition);
   virtual int Composite();
+  virtual void Dump(std::ostringstream *out) const;
 
   bool HaveQueuedComposites() const;
 
@@ -73,6 +75,11 @@
 
   // mutable since we need to acquire in HaveQueuedComposites
   mutable pthread_mutex_t lock_;
+
+  // 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_;
 };
 }