diff options
author | Padmanabhan Komanduru <pkomandu@codeaurora.org> | 2020-06-10 18:01:33 +0530 |
---|---|---|
committer | Bipin Kumar <bipikuma@codeaurora.org> | 2020-06-18 00:53:16 +0530 |
commit | e8ee43ec8b4ffe38d1779bb1ae66b61951d3773c (patch) | |
tree | 81d96d3a92cfc5da932118d3a0cc24a30ef913f1 /sdm/libs/hwc2/hwc_session.cpp | |
parent | 539f124562f2cf839c9de6fd1b514ba4881e93ff (diff) |
composer: populate doze mode if the panel supports command mode
Change-Id: I09956d011674410ce03cfeba31ca58e727ac12ea
Diffstat (limited to 'sdm/libs/hwc2/hwc_session.cpp')
-rw-r--r-- | sdm/libs/hwc2/hwc_session.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp index 45bce77d..8a51ea78 100644 --- a/sdm/libs/hwc2/hwc_session.cpp +++ b/sdm/libs/hwc2/hwc_session.cpp @@ -1142,9 +1142,18 @@ int32_t HWCSession::GetDozeSupport(hwc2_device_t *device, hwc2_display_t display } *out_support = 0; - uint32_t config = 0; - hwc_session->GetActiveConfigIndex(INT(display), &config); - *out_support = hwc_session->isSmartPanelConfig(UINT32(display), config) ? 1 : 0; + + if (display != qdutils::DISPLAY_PRIMARY) { + return HWC2_ERROR_NONE; + } + + SCOPE_LOCK(locker_[display]); + if (!hwc_session->hwc_display_[display]) { + DLOGE("Display %d is not created yet.", INT32(display)); + return HWC2_ERROR_NONE; + } + + *out_support = hwc_session->hwc_display_[display]->HasSmartPanelConfig() ? 1 : 0; return HWC2_ERROR_NONE; } |