composer: enable POMS during Doze switch based on a property

Add support to enable the POMS during Doze switch based on the
property vendor.display.enable_poms_during_doze=1.

Change-Id: Ia90ae0b38aed9e45d0729a38cab89a58c3baf66b
diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp
index b4cdbaf..95b94a7 100644
--- a/composer/hwc_display_builtin.cpp
+++ b/composer/hwc_display_builtin.cpp
@@ -127,9 +127,9 @@
   color_mode_ = new HWCColorMode(display_intf_);
   color_mode_->Init();
 
-  int optimize_refresh = 0;
-  HWCDebugHandler::Get()->GetProperty(ENABLE_OPTIMIZE_REFRESH, &optimize_refresh);
-  enable_optimize_refresh_ = (optimize_refresh == 1);
+  int value = 0;
+  HWCDebugHandler::Get()->GetProperty(ENABLE_OPTIMIZE_REFRESH, &value);
+  enable_optimize_refresh_ = (value == 1);
   if (enable_optimize_refresh_) {
     DLOGI("Drop redundant drawcycles %" PRIu64 , id_);
   }
@@ -153,6 +153,13 @@
                       &window_rect_.right, &window_rect_.bottom) != kErrorUndefined;
     DLOGI("Window rect : [%f %f %f %f]", window_rect_.left, window_rect_.top,
           window_rect_.right, window_rect_.bottom);
+
+    value = 0;
+    HWCDebugHandler::Get()->GetProperty(ENABLE_POMS_DURING_DOZE, &value);
+    enable_poms_during_doze_ = (value == 1);
+    if (enable_poms_during_doze_) {
+      DLOGI("Enable POMS during Doze mode %" PRIu64 , id_);
+    }
   }
 
   uint32_t config_index = 0;
@@ -1264,6 +1271,12 @@
 }
 
 bool HWCDisplayBuiltIn::HasSmartPanelConfig(void) {
+  if (!enable_poms_during_doze_) {
+    uint32_t config = 0;
+    GetActiveDisplayConfig(&config);
+    return IsSmartPanelConfig(config);
+  }
+
   for (auto &config : variable_config_map_) {
     if (config.second.smart_panel) {
       return true;