diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp index 82d14d90..936c3985 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 014ea112..514f09d4 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 8466f8bf..8d9c2540 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 a4dd4b84..621906b3 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; };