From 6b98373e6f2b796c8c9c7f1dbe28ea22ef7f1ca4 Mon Sep 17 00:00:00 2001 From: Ramkumar Radhakrishnan Date: Wed, 28 Mar 2018 15:20:09 -0700 Subject: [PATCH 1/2] hwc2: Fix VTS failure on setActiveConfig() testcase New resolution mode being set as a part of next commit, if getActiveConfig() is called before the next commit sdm provides the old config that results in VTS failure. Hence return the pending config instead of the current config. Change-Id: I18660916dae1c9fc8b3390afed1b94d8448f5966 CRs-Fixed: 2211483 --- sdm/libs/hwc2/hwc_display.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index a296b039..a744df64 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -1993,6 +1993,10 @@ int HWCDisplay::SetActiveDisplayConfig(uint32_t config) { } int HWCDisplay::GetActiveDisplayConfig(uint32_t *config) { + if (config_pending_) { + *config = display_config_; + return 0; + } return display_intf_->GetActiveConfig(config) == kErrorNone ? 0 : -1; } From b8cce97295e4bfb36b3e1805cac872004d47217e Mon Sep 17 00:00:00 2001 From: Ramkumar Radhakrishnan Date: Wed, 28 Mar 2018 15:33:08 -0700 Subject: [PATCH 2/2] sdm: Set connector mode on power off CRTC ROI is set to full screen during power off. if SetActiveConfig() called before SetPowerMode off, CRTC ROI is set to full screen based on old resolution mode which results in failure. Hence set the new connector mode as a part of SetPowerMode to avoid this. Change-Id: Id3b16113a8f944b6fb839f23f6af8b56bba69fdc CRs-Fixed: 2211483 --- sdm/libs/core/drm/hw_device_drm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp index 14d00644..e90a782b 100644 --- a/sdm/libs/core/drm/hw_device_drm.cpp +++ b/sdm/libs/core/drm/hw_device_drm.cpp @@ -740,6 +740,8 @@ DisplayError HWDeviceDRM::PowerOff() { } SetFullROI(); + drmModeModeInfo current_mode = connector_info_.modes[current_mode_index_].mode; + drm_atomic_intf_->Perform(DRMOps::CRTC_SET_MODE, token_.crtc_id, ¤t_mode); 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 */);