OSDN Git Service

Fix build with Debug logs.
authorKalyan Kondapally <kalyan.kondapally@intel.com>
Fri, 22 Dec 2017 08:31:27 +0000 (00:31 -0800)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Fri, 22 Dec 2017 08:41:12 +0000 (00:41 -0800)
Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
common/utils/hwctrace.h

index a5ef7a0..731918c 100644 (file)
@@ -173,6 +173,7 @@ class TraceFunc {
 
 #ifdef ENABLE_DISPLAY_DUMP
 #define DUMP_CURRENT_COMPOSITION_PLANES()                                   \
+  static int frame_ = 0;                                                    \
   frame_++;                                                                 \
   DUMPTRACE(                                                                \
       "Dumping DisplayPlaneState of Current Composition planes "            \
@@ -185,31 +186,26 @@ class TraceFunc {
   for (DisplayPlaneState & comp_plane : current_composition_planes) {       \
     DUMPTRACE("Composition Plane State for Index: %d", plane_index);        \
     const std::vector<size_t> &source_layers = comp_plane.source_layers();  \
-    switch (comp_plane.GetCompositionState()) {                             \
-      case DisplayPlaneState::State::kRender:                               \
-        DUMPTRACE("DisplayPlane state: kRender. Total layers: %lu",         \
-                  source_layers.size());                                    \
-        DUMPTRACE("Layers Index:");                                         \
-        for (size_t primary_index : source_layers) {                        \
-          DUMPTRACE("index: %d", primary_index);                            \
-          layers.at(primary_index).Dump();                                  \
-        }                                                                   \
-        break;                                                              \
-      case DisplayPlaneState::State::kScanout:                              \
-        if (source_layers.size() > 1)                                       \
-          DUMPTRACE(                                                        \
-              "Plane has more than one layer associated when its type is "  \
-              "kScanout. This needs to be fixed.");                         \
-        DUMPTRACE("DisplayPlane State: kScanout. Total layers: %lu",        \
-                  source_layers.size());                                    \
-        DUMPTRACE("Layers Index:");                                         \
-        for (size_t overlay_index : source_layers) {                        \
-          DUMPTRACE("index: %d", overlay_index);                            \
-          layers.at(overlay_index).Dump();                                  \
-        }                                                                   \
-        break;                                                              \
-      default:                                                              \
-        break;                                                              \
+    if (comp_plane.NeedsOffScreenComposition()) {                           \
+      DUMPTRACE("DisplayPlane state: kRender. Total layers: %lu",           \
+                source_layers.size());                                      \
+      DUMPTRACE("Layers Index:");                                           \
+      for (size_t primary_index : source_layers) {                          \
+        DUMPTRACE("index: %d", primary_index);                              \
+        layers.at(primary_index).Dump();                                    \
+      }                                                                     \
+    } else if (comp_plane.Scanout()) {                                      \
+      if (source_layers.size() > 1 && !comp_plane.SurfaceRecycled())        \
+        DUMPTRACE(                                                          \
+            "Plane has more than one layer associated when its type is "    \
+            "kScanout. This needs to be fixed.");                           \
+      DUMPTRACE("DisplayPlane State: kScanout. Total layers: %lu",          \
+                source_layers.size());                                      \
+      DUMPTRACE("Layers Index:");                                           \
+      for (size_t overlay_index : source_layers) {                          \
+        DUMPTRACE("index: %d", overlay_index);                              \
+        layers.at(overlay_index).Dump();                                    \
+      }                                                                     \
     }                                                                       \
     comp_plane.plane()->Dump();                                             \
     DUMPTRACE("Composition Plane State ends for Index: %d\n", plane_index); \