Merge "composer: Modify validation of the length in QtiComposerClient"
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp
old mode 100644
new mode 100755
index 1db3c93..40dc579
--- a/composer/hwc_display.cpp
+++ b/composer/hwc_display.cpp
@@ -2020,13 +2020,16 @@
         reinterpret_cast<const native_handle_t *>(layer->input_buffer.buffer_id);
     Fence::Wait(layer->input_buffer.acquire_fence);
 
-    DLOGI("Dump layer[%d] of %lu handle %p", i, layer_stack_.layers.size(), handle);
 
     if (!handle) {
-      DLOGE("Buffer handle is null");
+      DLOGW("Buffer handle is detected as null for layer: %s(%d) out of %lu layers with layer "
+            "flag value: %u", layer->layer_name.c_str(), layer->layer_id,
+            layer_stack_.layers.size(), layer->flags);
       continue;
     }
 
+    DLOGI("Dump layer[%d] of %lu handle %p", i, layer_stack_.layers.size(), handle);
+
     void *base_ptr = NULL;
     int error = buffer_allocator_->MapBuffer(handle, nullptr, &base_ptr);
     if (error != kErrorNone) {
@@ -2866,7 +2869,7 @@
                                 vsync_period_change_constraints->desiredTimeNanos);
 
   out_timeline->refreshRequired = true;
-  if (info.x_pixels != fb_width_ || info.y_pixels != fb_height_) {
+  if (is_client_up_ && (info.x_pixels != fb_width_ || info.y_pixels != fb_height_)) {
     out_timeline->refreshRequired = false;
     fb_width_ = info.x_pixels;
     fb_height_ = info.y_pixels;
@@ -3698,4 +3701,7 @@
   display_intf_->Abort();
 }
 
-} //namespace sdm
+void HWCDisplay::MarkClientActive(bool is_client_up) {
+  is_client_up_ = is_client_up ;
+}
+}  // namespace sdm
diff --git a/composer/hwc_display.h b/composer/hwc_display.h
index c38859e..017c41e 100644
--- a/composer/hwc_display.h
+++ b/composer/hwc_display.h
@@ -523,6 +523,7 @@
   virtual void SetConfigInfo(std::map<uint32_t, DisplayConfigVariableInfo>& variable_config_map,
                              int active_config_index, uint32_t num_configs) {};
   virtual void Abort();
+  virtual void MarkClientActive(bool is_client_up);
 
  protected:
   static uint32_t throttling_refresh_rate_;
@@ -703,6 +704,7 @@
   bool draw_method_set_ = false;
   bool validate_done_ = false;
   bool client_target_3_1_set_ = false;
+  bool is_client_up_ = false;
 };
 
 inline int HWCDisplay::Perform(uint32_t operation, ...) {
diff --git a/composer/hwc_session.cpp b/composer/hwc_session.cpp
index 75144f7..c5b47e0 100644
--- a/composer/hwc_session.cpp
+++ b/composer/hwc_session.cpp
@@ -1099,10 +1099,11 @@
   }
 
   // On SF stop, disable the idle time.
-  if (!pointer && is_idle_time_up_ && hwc_display_[HWC_DISPLAY_PRIMARY]) { // De-registering…
+  if (!pointer && is_client_up_ && hwc_display_[HWC_DISPLAY_PRIMARY]) { // De-registering…
     DLOGI("disable idle time");
     hwc_display_[HWC_DISPLAY_PRIMARY]->SetIdleTimeoutMs(0,0);
-    is_idle_time_up_ = false;
+    is_client_up_ = false;
+    hwc_display_[HWC_DISPLAY_PRIMARY]->MarkClientActive(false);
   }
 }
 
diff --git a/composer/hwc_session.h b/composer/hwc_session.h
index 96bd91c..b568225 100644
--- a/composer/hwc_session.h
+++ b/composer/hwc_session.h
@@ -723,7 +723,7 @@
   bool tui_state_transition_[HWCCallbacks::kNumDisplays] = {};
   std::bitset<HWCCallbacks::kNumDisplays> display_ready_;
   bool secure_session_active_ = false;
-  bool is_idle_time_up_ = false;
+  bool is_client_up_ = false;
   std::shared_ptr<IPCIntf> ipc_intf_ = nullptr;
   bool primary_pending_ = true;
   Locker primary_display_lock_;
diff --git a/composer/hwc_session_services.cpp b/composer/hwc_session_services.cpp
index 12ad1ad..9ce8cd9 100644
--- a/composer/hwc_session_services.cpp
+++ b/composer/hwc_session_services.cpp
@@ -1567,7 +1567,8 @@
   if (hwc_session_->hwc_display_[HWC_DISPLAY_PRIMARY]) {
     DLOGI("enable idle time active_ms:%d inactive_ms:%d",active_ms,inactive_ms);
     hwc_session_->hwc_display_[HWC_DISPLAY_PRIMARY]->SetIdleTimeoutMs(active_ms, inactive_ms);
-    hwc_session_->is_idle_time_up_ = true;
+    hwc_session_->is_client_up_ = true;
+    hwc_session_->hwc_display_[HWC_DISPLAY_PRIMARY]->MarkClientActive(true);
     hwc_session_->idle_time_inactive_ms_ = inactive_ms;
     hwc_session_->idle_time_active_ms_ = active_ms;
     return 0;
diff --git a/sdm/libs/dal/hw_device_drm.cpp b/sdm/libs/dal/hw_device_drm.cpp
index 7c704e1..088150d 100644
--- a/sdm/libs/dal/hw_device_drm.cpp
+++ b/sdm/libs/dal/hw_device_drm.cpp
@@ -1967,6 +1967,9 @@
   sync_commit = true;
 #endif
 
+  // dpps commit feature ops doesn't use the obj id, set it as -1
+  drm_atomic_intf_->Perform(DRMOps::DPPS_COMMIT_FEATURE, -1);
+
   int ret = NullCommit(sync_commit /* synchronous */, false /* retain_planes*/);
   if (ret) {
     DLOGE("failed with error %d", ret);