Merge "hwc2: Do not reapply mode if it is the same as before"
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 6b0af2c..91879ae 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -161,7 +161,7 @@
 
   // if the mode count is 1, then only native mode is supported, so just apply matrix w/o
   // setting mode
-  if (color_mode_transform_map_.size() > 1U) {
+  if (color_mode_transform_map_.size() > 1U && current_color_mode_ != mode) {
     color_mode_transform = color_mode_transform_map_[mode][transform_hint];
     DisplayError error = display_intf_->SetColorMode(color_mode_transform);
     if (error != kErrorNone) {
@@ -169,6 +169,7 @@
       // failure to force client composition
       return HWC2::Error::Unsupported;
     }
+    DLOGI("Setting Color Mode = %d Transform Hint = %d Success", mode, hint);
   }
 
   if (use_matrix) {
@@ -183,7 +184,6 @@
   current_color_mode_ = mode;
   current_color_transform_ = hint;
   CopyColorTransformMatrix(matrix, color_matrix_);
-  DLOGI("Setting Color Mode = %d Transform Hint = %d Success", mode, hint);
 
   return HWC2::Error::None;
 }