drm_hwcomposer: Add statistics on flattening to dump message
We need some way to verify that current composition is not failed to
compose, but instead sent to flatten on GPU.
Dump message shows current flattening state. It also displays how
often do compositor switches into flattening.
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index a4a8187..605406b 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -142,6 +142,7 @@
<< ((delta.failed_kms_present_ > 0)
? " !!! Internal failure, FIX it please\n"
: "")
+ << " Flattened frames: " << delta.frames_flattened_ << "\n"
<< " Pixel operations (free units)"
<< " : [TOTAL: " << delta.total_pixops_
<< " / GPU: " << delta.gpu_pixops_ << "]\n"
@@ -152,6 +153,8 @@
std::string DrmHwcTwo::HwcDisplay::Dump() {
auto out = (std::stringstream()
<< "- Display on: " << connector_->name() << "\n"
+ << " Flattening state: " << compositor_.GetFlatteningState()
+ << "\n"
<< "Statistics since system boot:\n"
<< DumpDelta(total_stats_) << "\n\n"
<< "Statistics since last dumpsys request:\n"
@@ -970,6 +973,7 @@
*num_types = client_size;
+ total_stats_.frames_flattened_ = compositor_.GetFlattenedFramesCount();
total_stats_.gpu_pixops_ += gpu_pixops;
total_stats_.total_pixops_ += total_pixops;