summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sdm/libs/hwc2/hwc_session.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_session.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index f795b9ce..00444fe1 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -732,10 +732,26 @@ int32_t HWCSession::PresentDisplay(hwc2_device_t *device, hwc2_display_t display
hwc_session->HandlePowerOnPending(display, *out_retire_fence);
hwc_session->HandleHotplugPending(display, *out_retire_fence);
+ hwc_session->HandlePendingRefresh();
return INT32(status);
}
+void HWCSession::HandlePendingRefresh() {
+ if (pending_refresh_.none()) {
+ return;
+ }
+
+ for (size_t i = 0; i < pending_refresh_.size(); i++) {
+ if (pending_refresh_.test(i)) {
+ Refresh(i);
+ }
+ break;
+ }
+
+ pending_refresh_.reset();
+}
+
int32_t HWCSession::RegisterCallback(hwc2_device_t *device, int32_t descriptor,
hwc2_callback_data_t callback_data,
hwc2_function_pointer_t pointer) {
@@ -978,6 +994,8 @@ int32_t HWCSession::SetPowerMode(hwc2_device_t *device, hwc2_display_t display,
// Trigger refresh for doze mode to take effect.
if (mode == HWC2::PowerMode::Doze) {
hwc_session->Refresh(display);
+ // Trigger one more refresh for PP features to take effect.
+ hwc_session->pending_refresh_.set(UINT32(display));
}
return HWC2_ERROR_NONE;