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/include/display_properties.h b/include/display_properties.h
index d0868a2..0e57f34 100644
--- a/include/display_properties.h
+++ b/include/display_properties.h
@@ -131,5 +131,6 @@
 #define DEFER_FPS_FRAME_COUNT                DISPLAY_PROP("defer_fps_frame_count")
 #define DISABLE_IDLE_TIME_VIDEO              DISPLAY_PROP("disable_idle_time_video")
 #define DISABLE_IDLE_TIME_HDR                DISPLAY_PROP("disable_idle_time_hdr")
+#define ENABLE_POMS_DURING_DOZE              DISPLAY_PROP("enable_poms_during_doze")
 
 #endif  // __DISPLAY_PROPERTIES_H__
diff --git a/sdm/libs/hwc2/hwc_display_builtin.cpp b/sdm/libs/hwc2/hwc_display_builtin.cpp
index e1543b9..a96f326 100644
--- a/sdm/libs/hwc2/hwc_display_builtin.cpp
+++ b/sdm/libs/hwc2/hwc_display_builtin.cpp
@@ -166,13 +166,20 @@
   HWCDebugHandler::Get()->GetProperty(ENABLE_DEFAULT_COLOR_MODE,
                                       &default_mode_status_);
 
-  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 %d", id_);
   }
 
+  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_);
+  }
+
   int vsyncs = 0;
   HWCDebugHandler::Get()->GetProperty(DEFER_FPS_FRAME_COUNT, &vsyncs);
   if (vsyncs > 0) {
@@ -1046,6 +1053,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;
diff --git a/sdm/libs/hwc2/hwc_display_builtin.h b/sdm/libs/hwc2/hwc_display_builtin.h
index d3b0661..232c31a 100644
--- a/sdm/libs/hwc2/hwc_display_builtin.h
+++ b/sdm/libs/hwc2/hwc_display_builtin.h
@@ -151,6 +151,7 @@
   bool pending_refresh_ = true;
   bool enable_optimize_refresh_ = false;
   bool hdr_present_ = false;
+  bool enable_poms_during_doze_ = false;
 
   // Members for 1 frame capture in a client provided buffer
   bool frame_capture_buffer_queued_ = false;