diff options
Diffstat (limited to 'sdm')
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.cpp | 9 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp index 8ad31635..adb7b95d 100644 --- a/sdm/libs/core/drm/hw_device_drm.cpp +++ b/sdm/libs/core/drm/hw_device_drm.cpp @@ -719,6 +719,7 @@ DisplayError HWDeviceDRM::SetDisplayAttributes(uint32_t index) { current_mode_index_ = index; PopulateHWPanelInfo(); UpdateMixerAttributes(); + update_mode_ = true; DLOGI("Display attributes[%d]: WxH: %dx%d, DPI: %fx%f, FPS: %d, LM_SPLIT: %d, V_BACK_PORCH: %d," \ " V_FRONT_PORCH: %d, V_PULSE_WIDTH: %d, V_TOTAL: %d, H_TOTAL: %d, CLK: %dKHZ, TOPOLOGY: %d", @@ -752,6 +753,7 @@ DisplayError HWDeviceDRM::PowerOn(int *release_fence) { return kErrorNone; } + update_mode_ = true; drm_atomic_intf_->Perform(DRMOps::CRTC_SET_ACTIVE, token_.crtc_id, 1); drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_POWER_MODE, token_.conn_id, DRMPowerMode::ON); int ret = drm_atomic_intf_->Commit(true /* synchronous */, true /* retain_planes */); @@ -990,7 +992,11 @@ void HWDeviceDRM::SetupAtomic(HWLayers *hw_layers, bool validate) { drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_POWER_MODE, token_.conn_id, DRMPowerMode::ON); } - drm_atomic_intf_->Perform(DRMOps::CRTC_SET_MODE, token_.crtc_id, ¤t_mode); + // Set CRTC mode, only if display config changes + if (vrefresh_ || first_cycle_ || update_mode_) { + drm_atomic_intf_->Perform(DRMOps::CRTC_SET_MODE, token_.crtc_id, ¤t_mode); + } + drm_atomic_intf_->Perform(DRMOps::CRTC_SET_ACTIVE, token_.crtc_id, 1); if (!validate && (hw_layer_info.set_idle_time_ms >= 0)) { @@ -1169,6 +1175,7 @@ DisplayError HWDeviceDRM::AtomicCommit(HWLayers *hw_layers) { } first_cycle_ = false; + update_mode_ = false; return kErrorNone; } diff --git a/sdm/libs/core/drm/hw_device_drm.h b/sdm/libs/core/drm/hw_device_drm.h index 02389470..203b6bb6 100644 --- a/sdm/libs/core/drm/hw_device_drm.h +++ b/sdm/libs/core/drm/hw_device_drm.h @@ -186,6 +186,7 @@ class HWDeviceDRM : public HWInterface { bool resolution_switch_enabled_ = false; uint32_t vrefresh_ = 0; bool autorefresh_ = false; + bool update_mode_ = false; }; } // namespace sdm |