summaryrefslogtreecommitdiffstats
path: root/sdm
diff options
context:
space:
mode:
authorNamit Solanki <nsolanki@codeaurora.org>2018-02-15 19:00:17 +0530
committerNamit Solanki <nsolanki@codeaurora.org>2018-02-21 15:52:08 +0530
commit6f01c7f62d23924f05cdcf315ec4ae89c01d727f (patch)
tree78c2129fd884ba75361b2121d2cc3aeba526296c /sdm
parent67cf038fe10eb10f2d8de13db551734a2e9f0259 (diff)
downloadandroid_hardware_qcom_sdm710_display-6f01c7f62d23924f05cdcf315ec4ae89c01d727f.tar.gz
android_hardware_qcom_sdm710_display-6f01c7f62d23924f05cdcf315ec4ae89c01d727f.tar.bz2
android_hardware_qcom_sdm710_display-6f01c7f62d23924f05cdcf315ec4ae89c01d727f.zip
sdm: Drop HW VSYNC in min FPS state.
-Do not send HW VSYNC to SF in min FPS state until a commit is received. If HW VSYNC is sent to SF in min FPS state, this cause SW VSYNC in SF to first adjust to min FPS initially, and then after commit SW VSYNC again adjusts to max FPS. Change-Id: I47ec673e68c4eae643103ebfb2009fb96f6934f3 CRs-Fixed: 2192683
Diffstat (limited to 'sdm')
-rw-r--r--sdm/libs/core/display_base.cpp11
-rw-r--r--sdm/libs/core/display_base.h3
-rw-r--r--sdm/libs/core/display_primary.cpp2
-rw-r--r--sdm/libs/core/display_primary.h1
4 files changed, 13 insertions, 4 deletions
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index 0338bb78..3bb34414 100644
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -60,6 +60,7 @@ DisplayError DisplayBase::Init() {
hw_intf_->GetHWPanelInfo(&hw_panel_info_);
uint32_t active_index = 0;
+ int drop_vsync = 0;
hw_intf_->GetActiveConfig(&active_index);
hw_intf_->GetDisplayAttributes(active_index, &display_attributes_);
fb_config_ = display_attributes_;
@@ -117,7 +118,8 @@ DisplayError DisplayBase::Init() {
// TODO(user): Temporary changes, to be removed when DRM driver supports
// Partial update with Destination scaler enabled.
SetPUonDestScaler();
-
+ Debug::Get()->GetProperty("sdm.drop_skewed_vsync", &drop_vsync);
+ drop_skewed_vsync_ = (drop_vsync == 1);
return kErrorNone;
CleanupOnError:
@@ -342,7 +344,8 @@ DisplayError DisplayBase::Commit(LayerStack *layer_stack) {
if (error != kErrorNone) {
return error;
}
-
+ // Stop dropping vsync when first commit is received after idle fallback.
+ drop_hw_vsync_ = false;
DLOGI_IF(kTagDisplay, "Exiting commit for display type : %d", display_type_);
return kErrorNone;
}
@@ -1029,6 +1032,10 @@ DisplayError DisplayBase::SetVSyncState(bool enable) {
if (vsync_enable_ != enable) {
error = hw_intf_->SetVSyncState(enable);
if (error == kErrorNotSupported) {
+ if (drop_skewed_vsync_ && (hw_panel_info_.mode == kModeVideo) &&
+ enable && (current_refresh_rate_ == hw_panel_info_.min_fps)) {
+ drop_hw_vsync_ = true;
+ }
error = hw_events_intf_->SetEventState(HWEvent::VSYNC, enable);
}
if (error == kErrorNone) {
diff --git a/sdm/libs/core/display_base.h b/sdm/libs/core/display_base.h
index bd597c9c..5e697d9c 100644
--- a/sdm/libs/core/display_base.h
+++ b/sdm/libs/core/display_base.h
@@ -189,6 +189,9 @@ class DisplayBase : public DisplayInterface {
bool hdr_mode_ = false;
int disable_hdr_lut_gen_ = 0;
DisplayState last_power_mode_ = kStateOff;
+ bool drop_hw_vsync_ = false;
+ uint32_t current_refresh_rate_ = 0;
+ bool drop_skewed_vsync_ = false;
};
} // namespace sdm
diff --git a/sdm/libs/core/display_primary.cpp b/sdm/libs/core/display_primary.cpp
index d9fef336..9213b382 100644
--- a/sdm/libs/core/display_primary.cpp
+++ b/sdm/libs/core/display_primary.cpp
@@ -291,7 +291,7 @@ DisplayError DisplayPrimary::SetRefreshRate(uint32_t refresh_rate, bool final_ra
}
DisplayError DisplayPrimary::VSync(int64_t timestamp) {
- if (vsync_enable_) {
+ if (vsync_enable_ && !drop_hw_vsync_) {
DisplayEventVSync vsync;
vsync.timestamp = timestamp;
event_handler_->VSync(vsync);
diff --git a/sdm/libs/core/display_primary.h b/sdm/libs/core/display_primary.h
index e14c6d77..21ada7ca 100644
--- a/sdm/libs/core/display_primary.h
+++ b/sdm/libs/core/display_primary.h
@@ -71,7 +71,6 @@ class DisplayPrimary : public DisplayBase, HWEventHandler {
bool avr_prop_disabled_ = false;
bool switch_to_cmd_ = false;
bool handle_idle_timeout_ = false;
- uint32_t current_refresh_rate_ = 0;
bool reset_panel_ = false;
};