OSDN Git Service

drm_hwcomposer: Print fps as float in dump()
authorStéphane Marchesin <marcheu@chromium.org>
Mon, 13 Jul 2015 19:35:41 +0000 (12:35 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Mon, 13 Jul 2015 22:18:30 +0000 (15:18 -0700)
This is more accurate than using ints which helps with profiling work.

Change-Id: I9ba8cc8a2b0e9c1fa02bc217444d4001f0e19009

drmdisplaycompositor.cpp

index 80b71f5..f52a693 100644 (file)
@@ -303,7 +303,7 @@ void DrmDisplayCompositor::Dump(std::ostringstream *out) const {
 
   cur_ts = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
   uint64_t num_ms = (cur_ts - dump_last_timestamp_ns_) / (1000 * 1000);
-  unsigned fps = num_ms ? (num_frames * 1000) / (num_ms) : 0;
+  float fps = num_ms ? (num_frames * 1000.0f) / (num_ms) : 0.0f;
 
   *out << "--DrmDisplayCompositor[" << display_
        << "]: num_frames=" << num_frames << " num_ms=" << num_ms