summaryrefslogtreecommitdiffstats
path: root/sdm
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-03-07 19:21:17 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-03-07 19:21:17 -0800
commit07bf27fe83daaaec4edb83c0e556d9c229b6b9d3 (patch)
treee9f396d8e09aba9c87508ef5ef0d31584270a1fc /sdm
parentb98e64543c68321086835bcd1e281ccda067305b (diff)
parentb7066b6bd7355eff6542b009c6fbf2e9d75efbec (diff)
downloadandroid_hardware_qcom_sdm710_display-07bf27fe83daaaec4edb83c0e556d9c229b6b9d3.tar.gz
android_hardware_qcom_sdm710_display-07bf27fe83daaaec4edb83c0e556d9c229b6b9d3.tar.bz2
android_hardware_qcom_sdm710_display-07bf27fe83daaaec4edb83c0e556d9c229b6b9d3.zip
Merge "sdm: Drop idle timeout event if refresh is in progress."
Diffstat (limited to 'sdm')
-rw-r--r--sdm/libs/core/display_primary.cpp4
-rw-r--r--sdm/libs/hwc2/hwc_display.cpp12
-rw-r--r--sdm/libs/hwc2/hwc_display.h1
-rw-r--r--sdm/libs/hwc2/hwc_display_primary.cpp3
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;
}