Merge "sdm: Handle color mode setting in ApplyCurrentColorModeWithRenderIntent()" into display.lnx.5.1
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 2c6d913..a886942 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -170,6 +170,10 @@
 }
 
 HWC2::Error HWCColorMode::ApplyCurrentColorModeWithRenderIntent(bool hdr_present) {
+  // If panel does not support color modes, do not set color mode.
+  if (color_mode_map_.size() <= 1) {
+    return HWC2::Error::None;
+  }
   if (!apply_mode_) {
     if ((hdr_present && curr_dynamic_range_ == kHdrType) ||
       (!hdr_present && curr_dynamic_range_ == kSdrType))