hwc2: Do not reapply mode if it is the same as before
Bug: 63111041
CRs-Fixed: 2071819
Change-Id: Ib5ebc35f81f977bf1f096ecf1b31849f2ece4639
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 69b0acd..fd9b0e0 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -162,7 +162,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) {
@@ -170,6 +170,7 @@
// failure to force client composition
return HWC2::Error::Unsupported;
}
+ DLOGI("Setting Color Mode = %d Transform Hint = %d Success", mode, hint);
}
if (use_matrix) {
@@ -184,7 +185,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;
}