sdm: Add binder call support to set frame trigger mode
Add support of binder call in SDM to set frame trigger mode.
Change-Id: I1e3ac2aea26eaba7e2c42114ebe867b94f77dc93
diff --git a/sdm/libs/hwc2/hwc_display_builtin.cpp b/sdm/libs/hwc2/hwc_display_builtin.cpp
index 7a8f262..1355068 100644
--- a/sdm/libs/hwc2/hwc_display_builtin.cpp
+++ b/sdm/libs/hwc2/hwc_display_builtin.cpp
@@ -464,6 +464,26 @@
return HWC2::Error::None;
}
+HWC2::Error HWCDisplayBuiltIn::SetFrameTriggerMode(uint32_t mode) {
+ DisplayError error = kErrorNone;
+ FrameTriggerMode trigger_mode = kFrameTriggerDefault;
+
+ if (mode >= kFrameTriggerMax) {
+ DLOGE("Invalid input mode %d", mode);
+ return HWC2::Error::BadParameter;
+ }
+
+ trigger_mode = static_cast<FrameTriggerMode>(mode);
+ error = display_intf_->SetFrameTriggerMode(trigger_mode);
+ if (error)
+ return HWC2::Error::BadConfig;
+
+ callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ validated_ = false;
+
+ return HWC2::Error::None;
+}
+
int HWCDisplayBuiltIn::Perform(uint32_t operation, ...) {
va_list args;
va_start(args, operation);