diff options
author | Namit Solanki <nsolanki@codeaurora.org> | 2018-02-27 11:39:05 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-03-01 22:27:35 -0800 |
commit | b7066b6bd7355eff6542b009c6fbf2e9d75efbec (patch) | |
tree | b18b0f7cf8a9514a1dbeecb019549f1e08206ed2 /sdm | |
parent | 7a44dd183167af0ccfa7a087ef961036aff11099 (diff) | |
download | android_hardware_qcom_sdm710_display-b7066b6bd7355eff6542b009c6fbf2e9d75efbec.tar.gz android_hardware_qcom_sdm710_display-b7066b6bd7355eff6542b009c6fbf2e9d75efbec.tar.bz2 android_hardware_qcom_sdm710_display-b7066b6bd7355eff6542b009c6fbf2e9d75efbec.zip |
sdm: Drop idle timeout event if refresh is in progress.
- Drop idle timeout event if it occurs between prepare()
and commit() i.e. device is not really in idle state
since a new refresh cycle has already started.
Change-Id: If66353ac38bd3a5463fb7fa002e61fb8ed7c80d8
CRs-Fixed: 2181941
Diffstat (limited to 'sdm')
-rw-r--r-- | sdm/libs/core/display_primary.cpp | 4 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display.cpp | 12 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display.h | 1 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display_primary.cpp | 3 |
4 files changed, 17 insertions, 3 deletions
diff --git a/sdm/libs/core/display_primary.cpp b/sdm/libs/core/display_primary.cpp index 9213b382..718dd1e8 100644 --- a/sdm/libs/core/display_primary.cpp +++ b/sdm/libs/core/display_primary.cpp @@ -302,7 +302,9 @@ DisplayError DisplayPrimary::VSync(int64_t timestamp) { void DisplayPrimary::IdleTimeout() { if (hw_panel_info_.mode == kModeVideo) { - event_handler_->HandleEvent(kIdleTimeout); + if (event_handler_->HandleEvent(kIdleTimeout) != kErrorNone) { + return; + } handle_idle_timeout_ = true; event_handler_->Refresh(); lock_guard<recursive_mutex> obj(recursive_mutex_); diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index e3c36da6..459cbb2f 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -1020,7 +1020,17 @@ DisplayError HWCDisplay::CECMessage(char *message) { DisplayError HWCDisplay::HandleEvent(DisplayEvent event) { switch (event) { - case kIdleTimeout: + case kIdleTimeout: { + SCOPE_LOCK(HWCSession::locker_[type_]); + if (pending_commit_) { + // If idle timeout event comes in between prepare + // and commit, drop it since device is not really + // idle. + return kErrorNotSupported; + } + validated_ = false; + break; + } case kThermalEvent: case kIdlePowerCollapse: case kPanelDeadEvent: { diff --git a/sdm/libs/hwc2/hwc_display.h b/sdm/libs/hwc2/hwc_display.h index 3977e737..f3b15658 100644 --- a/sdm/libs/hwc2/hwc_display.h +++ b/sdm/libs/hwc2/hwc_display.h @@ -306,6 +306,7 @@ class HWCDisplay : public DisplayEventHandler { int disable_hdr_handling_ = 0; // disables HDR handling. uint32_t display_config_ = 0; bool config_pending_ = false; + bool pending_commit_ = false; private: void DumpInputBuffers(void); diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp index 531f2093..6149831d 100644 --- a/sdm/libs/hwc2/hwc_display_primary.cpp +++ b/sdm/libs/hwc2/hwc_display_primary.cpp @@ -223,6 +223,7 @@ HWC2::Error HWCDisplayPrimary::Validate(uint32_t *out_num_types, uint32_t *out_n } status = PrepareLayerStack(out_num_types, out_num_requests); + pending_commit_ = true; return status; } @@ -245,7 +246,7 @@ HWC2::Error HWCDisplayPrimary::Present(int32_t *out_retire_fence) { status = HWCDisplay::PostCommitLayerStack(out_retire_fence); } } - + pending_commit_ = false; return status; } |