diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-03-08 16:02:07 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-03-08 16:02:07 -0800 |
commit | af258e6e07ee239a601164acc51312e7f5815be0 (patch) | |
tree | 729a2c4519362ea0c480734073839cb7c6ba83fc /sdm/libs/core | |
parent | 7b017ba612fa89476c4c4009d525f1645c8360bc (diff) | |
parent | f5d101a6e3597e8b2a01f7a25aa24bf7b5c74d79 (diff) | |
download | display-af258e6e07ee239a601164acc51312e7f5815be0.tar.gz |
Merge "sdm: Handle disable partial update and display config change"
Diffstat (limited to 'sdm/libs/core')
-rw-r--r-- | sdm/libs/core/display_base.cpp | 4 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.cpp | 14 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.h | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp index 383bdba7..136168b9 100644 --- a/sdm/libs/core/display_base.cpp +++ b/sdm/libs/core/display_base.cpp @@ -488,9 +488,11 @@ DisplayError DisplayBase::SetDisplayState(DisplayState state) { default: DLOGE("Spurious state = %d transition requested.", state); - break; + return kErrorParameters; } + DisablePartialUpdateOneFrame(); + if (error == kErrorNone) { active_ = active; state_ = state; diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp index f1ebb762..d5bf482d 100644 --- a/sdm/libs/core/drm/hw_device_drm.cpp +++ b/sdm/libs/core/drm/hw_device_drm.cpp @@ -738,6 +738,7 @@ DisplayError HWDeviceDRM::PowerOff() { return kErrorUndefined; } + SetFullROI(); drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_POWER_MODE, token_.conn_id, DRMPowerMode::OFF); drm_atomic_intf_->Perform(DRMOps::CRTC_SET_ACTIVE, token_.crtc_id, 0); int ret = drm_atomic_intf_->Commit(true /* synchronous */, false /* retain_planes */); @@ -1559,4 +1560,17 @@ void HWDeviceDRM::SetMultiRectMode(const uint32_t flags, DRMMultiRectMode *targe } } +void HWDeviceDRM::SetFullROI() { + // Reset the CRTC ROI and connector ROI only for the panel that supports partial update + if (!hw_panel_info_.partial_update) { + return; + } + uint32_t index = current_mode_index_; + DRMRect crtc_rects = {0, 0, mixer_attributes_.width, mixer_attributes_.height}; + DRMRect conn_rects = {0, 0, display_attributes_[index].x_pixels, + display_attributes_[index].y_pixels}; + drm_atomic_intf_->Perform(DRMOps::CRTC_SET_ROI, token_.crtc_id, 1, &crtc_rects); + drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_ROI, token_.conn_id, 1, &conn_rects); +} + } // namespace sdm diff --git a/sdm/libs/core/drm/hw_device_drm.h b/sdm/libs/core/drm/hw_device_drm.h index b08c0e66..3af3b77d 100644 --- a/sdm/libs/core/drm/hw_device_drm.h +++ b/sdm/libs/core/drm/hw_device_drm.h @@ -133,6 +133,7 @@ class HWDeviceDRM : public HWInterface { bool IsResolutionSwitchEnabled() const { return resolution_switch_enabled_; } void SetTopology(sde_drm::DRMTopology drm_topology, HWTopology *hw_topology); void SetMultiRectMode(const uint32_t flags, sde_drm::DRMMultiRectMode *target); + void SetFullROI(); class Registry { public: |