summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2
diff options
context:
space:
mode:
authorAnjaneya Prasad Musunuri <aprasad@codeaurora.org>2017-05-18 19:11:28 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-25 06:42:12 -0700
commit4d65df7ae4320814dbc643b79c65ed6d59152e2f (patch)
tree7d1f29d87bd4133c7a6a06f689a4d0ba587e400a /sdm/libs/hwc2
parent61f6095acb7d0c4e22059605465ae8002bd63673 (diff)
downloaddisplay-4d65df7ae4320814dbc643b79c65ed6d59152e2f.tar.gz
sdm: Decouple refresh and idle fall back handling
Refresh can be called from SDM for multiple events. Refresh should not be coupled with idle fall back. CRs-Fixed: 2050936 Change-Id: I1d88f93ce81ef190dce396819896a249e5bad847
Diffstat (limited to 'sdm/libs/hwc2')
-rw-r--r--sdm/libs/hwc2/hwc_display_external.cpp2
-rw-r--r--sdm/libs/hwc2/hwc_display_primary.cpp13
-rw-r--r--sdm/libs/hwc2/hwc_display_primary.h1
3 files changed, 4 insertions, 12 deletions
diff --git a/sdm/libs/hwc2/hwc_display_external.cpp b/sdm/libs/hwc2/hwc_display_external.cpp
index 39d46712..a8f8480f 100644
--- a/sdm/libs/hwc2/hwc_display_external.cpp
+++ b/sdm/libs/hwc2/hwc_display_external.cpp
@@ -121,6 +121,8 @@ HWC2::Error HWCDisplayExternal::Validate(uint32_t *out_num_types, uint32_t *out_
return status;
}
+ // TODO(user): SetRefreshRate need to follow new interface when added.
+
status = PrepareLayerStack(out_num_types, out_num_requests);
return status;
}
diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp
index d78207b2..2fcf2a98 100644
--- a/sdm/libs/hwc2/hwc_display_primary.cpp
+++ b/sdm/libs/hwc2/hwc_display_primary.cpp
@@ -188,19 +188,13 @@ HWC2::Error HWCDisplayPrimary::Validate(uint32_t *out_num_types, uint32_t *out_n
ToggleCPUHint(one_updating_layer);
uint32_t refresh_rate = GetOptimalRefreshRate(one_updating_layer);
- if (current_refresh_rate_ != refresh_rate) {
- error = display_intf_->SetRefreshRate(refresh_rate);
- }
-
+ bool final_rate = force_refresh_rate_ ? true : false;
+ error = display_intf_->SetRefreshRate(refresh_rate, final_rate);
if (error == kErrorNone) {
// On success, set current refresh rate to new refresh rate
current_refresh_rate_ = refresh_rate;
}
- if (handle_idle_timeout_) {
- handle_idle_timeout_ = false;
- }
-
if (layer_set_.empty()) {
flush_ = true;
return status;
@@ -393,8 +387,6 @@ void HWCDisplayPrimary::ForceRefreshRate(uint32_t refresh_rate) {
uint32_t HWCDisplayPrimary::GetOptimalRefreshRate(bool one_updating_layer) {
if (force_refresh_rate_) {
return force_refresh_rate_;
- } else if (handle_idle_timeout_) {
- return min_refresh_rate_;
} else if (use_metadata_refresh_rate_ && one_updating_layer && metadata_refresh_rate_) {
return metadata_refresh_rate_;
}
@@ -406,7 +398,6 @@ DisplayError HWCDisplayPrimary::Refresh() {
DisplayError error = kErrorNone;
callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
- handle_idle_timeout_ = true;
return error;
}
diff --git a/sdm/libs/hwc2/hwc_display_primary.h b/sdm/libs/hwc2/hwc_display_primary.h
index b98de2bc..4df65b30 100644
--- a/sdm/libs/hwc2/hwc_display_primary.h
+++ b/sdm/libs/hwc2/hwc_display_primary.h
@@ -88,7 +88,6 @@ class HWCDisplayPrimary : public HWCDisplay {
BufferAllocator *buffer_allocator_ = nullptr;
CPUHint *cpu_hint_ = nullptr;
- bool handle_idle_timeout_ = false;
// Primary output buffer configuration
LayerBuffer output_buffer_ = {};