diff options
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.cpp | 7 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.h | 6 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_peripheral_drm.h | 6 |
3 files changed, 13 insertions, 6 deletions
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp index 40e0b220..5d6dfde5 100644 --- a/sdm/libs/core/drm/hw_device_drm.cpp +++ b/sdm/libs/core/drm/hw_device_drm.cpp @@ -781,6 +781,13 @@ DisplayError HWDeviceDRM::PowerOff() { 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 */); + drm_atomic_intf_->Perform(DRMOps::CRTC_SET_MODE, token_.crtc_id, ¤t_mode); + if (cwb_config_.enabled) { + drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_CRTC, cwb_config_.token.conn_id, 0); + drm_mgr_intf_->UnregisterDisplay(cwb_config_.token); + cwb_config_.enabled = false; + registry_.Clear(); + } if (ret) { DLOGE("Failed with error: %d", ret); return kErrorHardware; diff --git a/sdm/libs/core/drm/hw_device_drm.h b/sdm/libs/core/drm/hw_device_drm.h index aaa46949..396183a0 100644 --- a/sdm/libs/core/drm/hw_device_drm.h +++ b/sdm/libs/core/drm/hw_device_drm.h @@ -51,6 +51,11 @@ namespace sdm { class HWInfoInterface; +struct CWBConfig { + bool enabled = false; + sde_drm::DRMDisplayToken token = {}; +}; + class HWDeviceDRM : public HWInterface { public: HWDeviceDRM(BufferSyncHandler *buffer_sync_handler, BufferAllocator *buffer_allocator, @@ -188,6 +193,7 @@ class HWDeviceDRM : public HWInterface { sde_drm::DRMConnectorInfo connector_info_ = {}; bool first_cycle_ = true; bool synchronous_commit_ = false; + CWBConfig cwb_config_ = {}; private: HWMixerAttributes mixer_attributes_ = {}; diff --git a/sdm/libs/core/drm/hw_peripheral_drm.h b/sdm/libs/core/drm/hw_peripheral_drm.h index 9523bd95..4c1a90fa 100644 --- a/sdm/libs/core/drm/hw_peripheral_drm.h +++ b/sdm/libs/core/drm/hw_peripheral_drm.h @@ -35,11 +35,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace sdm { -struct CWBConfig { - bool enabled = false; - sde_drm::DRMDisplayToken token = {}; -}; - class HWPeripheralDRM : public HWDeviceDRM { public: explicit HWPeripheralDRM(BufferSyncHandler *buffer_sync_handler, @@ -70,7 +65,6 @@ class HWPeripheralDRM : public HWDeviceDRM { sde_drm_dest_scaler_data sde_dest_scalar_data_ = {}; std::vector<SDEScaler> scalar_data_ = {}; - CWBConfig cwb_config_ = {}; sde_drm::DRMIdlePCState idle_pc_state_ = sde_drm::DRMIdlePCState::NONE; }; |