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
diff --git a/include/display_properties.h b/include/display_properties.h
index ddcde64..9af7ddd 100644
--- a/include/display_properties.h
+++ b/include/display_properties.h
@@ -107,6 +107,7 @@
#define QDCM_DISABLE_TIMEOUT_PROP PERSIST_DISPLAY_PROP("qdcm.disable_timeout")
#define QDCM_MODE_COMBINE_PROP DISPLAY_PROP("qdcm.mode_combine")
#define PREFER_MULTIRECT_PROP DISPLAY_PROP("prefer_multirect")
+#define DROP_SKEWED_VSYNC DISPLAY_PROP("drop_skewed_vsync");
#define ZERO_SWAP_INTERVAL "vendor.debug.egl.swapinterval"
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index 6d54b4e..bd238a9 100644
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -98,6 +98,7 @@
int property_value = Debug::GetMaxPipesPerMixer(display_type_);
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_;
@@ -168,6 +169,9 @@
Debug::GetProperty(DISABLE_HW_RECOVERY_DUMP_PROP, &disable_hw_recovery_dump_);
DLOGI("disable_hw_recovery_dump_ set to %d", disable_hw_recovery_dump_);
+ Debug::Get()->GetProperty("DROP_SKEWED_VSYNC", &drop_vsync);
+ drop_skewed_vsync_ = (drop_vsync == 1);
+
return kErrorNone;
CleanupOnError:
@@ -390,7 +394,10 @@
return error;
}
+ // Stop dropping vsync when first commit is received after idle fallback.
+ drop_hw_vsync_ = false;
DLOGI_IF(kTagDisplay, "Exiting commit for display: %d-%d", display_id_, display_type_);
+
return kErrorNone;
}
@@ -1051,6 +1058,10 @@
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 e4efb92..27452f4 100644
--- a/sdm/libs/core/display_base.h
+++ b/sdm/libs/core/display_base.h
@@ -211,6 +211,9 @@
bool hw_recovery_logs_captured_ = false;
int disable_hw_recovery_dump_ = 0;
HWQosData default_qos_data_;
+ bool drop_hw_vsync_ = false;
+ uint32_t current_refresh_rate_ = 0;
+ bool drop_skewed_vsync_ = false;
static Locker display_power_reset_lock_;
static bool display_power_reset_pending_;
diff --git a/sdm/libs/core/display_builtin.cpp b/sdm/libs/core/display_builtin.cpp
index e4882b8..81b2823 100644
--- a/sdm/libs/core/display_builtin.cpp
+++ b/sdm/libs/core/display_builtin.cpp
@@ -311,7 +311,7 @@
}
DisplayError DisplayBuiltIn::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_builtin.h b/sdm/libs/core/display_builtin.h
index d4295fa..599a730 100644
--- a/sdm/libs/core/display_builtin.h
+++ b/sdm/libs/core/display_builtin.h
@@ -95,7 +95,6 @@
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;
bool commit_event_enabled_ = false;
DppsInfo dpps_info_ = {};