display: Add support to set color mode by ID
Add a binder API to set color mode by mode ID which is present in
the calibration data XML. This is only used for debugging.
CRs-Fixed: 2044628
Change-Id: I5f71e1e7e2e170d36b64003204620b0bf3e95ba0
diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp
index a27dca1..f3404a3 100644
--- a/sdm/libs/hwc2/hwc_display_primary.cpp
+++ b/sdm/libs/hwc2/hwc_display_primary.cpp
@@ -255,6 +255,18 @@
return status;
}
+HWC2::Error HWCDisplayPrimary::SetColorModeById(int32_t color_mode_id) {
+ auto status = color_mode_->SetColorModeById(color_mode_id);
+ if (status != HWC2::Error::None) {
+ DLOGE("failed for mode = %d", color_mode_id);
+ return status;
+ }
+
+ callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+
+ return status;
+}
+
HWC2::Error HWCDisplayPrimary::SetColorTransform(const float *matrix,
android_color_transform_t hint) {
if (!matrix) {