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
This commit is contained in:
Namit Solanki
2018-02-15 19:00:17 +05:30
committed by Gerrit - the friendly Code Review server
parent 45609e11e3
commit 17cd7b8ac4
4 changed files with 13 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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);

View File

@@ -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;
};