summaryrefslogtreecommitdiffstats
path: root/sdm/libs/hwc2/hwc_session_services.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sdm/libs/hwc2/hwc_session_services.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_session_services.cpp49
1 files changed, 48 insertions, 1 deletions
diff --git a/sdm/libs/hwc2/hwc_session_services.cpp b/sdm/libs/hwc2/hwc_session_services.cpp
index 57a5dac1..90ed00b4 100644
--- a/sdm/libs/hwc2/hwc_session_services.cpp
+++ b/sdm/libs/hwc2/hwc_session_services.cpp
@@ -357,7 +357,7 @@ int32_t HWCSession::ControlPartialUpdate(int disp_id, bool enable) {
Refresh(HWC_DISPLAY_PRIMARY);
// Wait until partial update control is complete
- int32_t error = locker_[disp_id].WaitFinite(kPartialUpdateControlTimeoutMs);
+ int32_t error = locker_[disp_id].WaitFinite(kCommitDoneTimeoutMs);
return error;
}
@@ -507,5 +507,52 @@ Return<void> HWCSession::displayBWTransactionPending(displayBWTransactionPending
return Void();
}
+#ifdef DISPLAY_CONFIG_1_1
+// Methods from ::vendor::hardware::display::config::V1_1::IDisplayConfig follow.
+Return<int32_t> HWCSession::setDisplayAnimating(uint64_t display_id, bool animating ) {
+ return CallDisplayFunction(static_cast<hwc2_device_t *>(this), display_id,
+ &HWCDisplay::SetDisplayAnimating, animating);
+}
+#endif
+
+#ifdef DISPLAY_CONFIG_1_3
+Return<int32_t> HWCSession::controlIdlePowerCollapse(bool enable, bool synchronous) {
+ SEQUENCE_WAIT_SCOPE_LOCK(locker_[HWC_DISPLAY_PRIMARY]);
+
+ if (hwc_display_[HWC_DISPLAY_PRIMARY]) {
+ if (!enable) {
+ if (!idle_pc_ref_cnt_) {
+ HWC2::Error err =
+ hwc_display_[HWC_DISPLAY_PRIMARY]->ControlIdlePowerCollapse(enable, synchronous);
+ if (err == HWC2::Error::Unsupported) {
+ return 0;
+ }
+ Refresh(HWC_DISPLAY_PRIMARY);
+ int32_t error = locker_[HWC_DISPLAY_PRIMARY].WaitFinite(kCommitDoneTimeoutMs);
+ if (error == ETIMEDOUT) {
+ DLOGE("Timed out!! Next frame commit done event not received!!");
+ return error;
+ }
+ DLOGI("Idle PC disabled!!");
+ }
+ idle_pc_ref_cnt_++;
+ } else if (idle_pc_ref_cnt_ > 0) {
+ if (!(idle_pc_ref_cnt_ - 1)) {
+ HWC2::Error err =
+ hwc_display_[HWC_DISPLAY_PRIMARY]->ControlIdlePowerCollapse(enable, synchronous);
+ if (err == HWC2::Error::Unsupported) {
+ return 0;
+ }
+ DLOGI("Idle PC enabled!!");
+ }
+ idle_pc_ref_cnt_--;
+ }
+ return 0;
+ }
+
+ DLOGW("Display = %d is not connected.", HWC_DISPLAY_PRIMARY);
+ return -ENODEV;
+}
+#endif // DISPLAY_CONFIG_1_3
} // namespace sdm