summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@quicinc.com>2019-06-03 04:01:03 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-06-03 04:01:03 -0700
commitebf8040e3931696d1bb371cc1b61679a62b888fb (patch)
treec24204233ac689fe2e50de2df6ffe988bd1145ed
parentde3af81f47db7fec43e6c8da7a84d6b2bc79dafe (diff)
parent1b9225d8d39b4c0087b9a38872937c0813afd768 (diff)
downloadandroid_hardware_qcom_sdm845_display-ebf8040e3931696d1bb371cc1b61679a62b888fb.tar.gz
android_hardware_qcom_sdm845_display-ebf8040e3931696d1bb371cc1b61679a62b888fb.tar.bz2
android_hardware_qcom_sdm845_display-ebf8040e3931696d1bb371cc1b61679a62b888fb.zip
hwc2: Teardown CWB before suspend
am: 1b9225d8d3 Change-Id: Ie905821f940f3c778b0db6bf826765edce82ceca
-rw-r--r--sdm/libs/core/drm/hw_device_drm.cpp7
-rw-r--r--sdm/libs/core/drm/hw_device_drm.h6
-rw-r--r--sdm/libs/core/drm/hw_peripheral_drm.h6
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, &current_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;
};