summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@quicinc.com>2019-05-29 12:58:43 -0400
committerChris Lu <luchris@google.com>2019-05-30 09:55:32 +0000
commit1b9225d8d39b4c0087b9a38872937c0813afd768 (patch)
treec24204233ac689fe2e50de2df6ffe988bd1145ed
parentde3af81f47db7fec43e6c8da7a84d6b2bc79dafe (diff)
downloadandroid_hardware_qcom_sdm845_display-1b9225d8d39b4c0087b9a38872937c0813afd768.tar.gz
android_hardware_qcom_sdm845_display-1b9225d8d39b4c0087b9a38872937c0813afd768.tar.bz2
android_hardware_qcom_sdm845_display-1b9225d8d39b4c0087b9a38872937c0813afd768.zip
hwc2: Teardown CWB before suspend
Teardown CWB before suspend. So that resume can go without any CWB. Bug: 130203599 Bug: 130512159 Test: run vts -m VtsHalGraphicsComposerV2_2Target Acked-by: Ramakant Singh <ramakant@codeaurora.org> Change-Id: I913279aafef9dc246ba9e22e74ffadc59f5c3737
-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;
};