diff options
author | HyunKyung Kim <hk310.kim@samsung.com> | 2021-03-11 10:37:00 +0900 |
---|---|---|
committer | Weizhung Ding <weizhungding@google.com> | 2021-03-22 22:20:16 +0800 |
commit | 1b8c110dfc34512b241eba0bab1add0fa3b26c22 (patch) | |
tree | cd45f2a19e96a5fc4d1fe601b4e807b742b18da0 | |
parent | 897269751f3c7bd3a90ed3a63d5a15dbb4b36919 (diff) |
libhwc2.1: Check power state to reserve MPP to primary type display
Bug: 162322019
Test: single/dual display boot to OS, and suspend/resume
Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com>
Change-Id: Ic2964d20be16852299e3aa63e34fc8723b31d40f
-rw-r--r-- | libhwc2.1/libresource/ExynosResourceManager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libhwc2.1/libresource/ExynosResourceManager.cpp b/libhwc2.1/libresource/ExynosResourceManager.cpp index 785db7d..95745c3 100644 --- a/libhwc2.1/libresource/ExynosResourceManager.cpp +++ b/libhwc2.1/libresource/ExynosResourceManager.cpp @@ -1888,12 +1888,16 @@ int32_t ExynosResourceManager::preAssignResources() ExynosDisplay *display = NULL; for (size_t j = 0; j < mDevice->mDisplays.size(); j++) { display = mDevice->mDisplays[j]; + if (display == nullptr) + continue; int checkBit = mOtfMPPs[i]->mPreAssignDisplayList[displayMode] & display->getDisplayPreAssignBit(); HDEBUGLOGD(eDebugResourceManager, "\t\tdisplay index(%zu), checkBit(%d)", j, checkBit); if (checkBit) { HDEBUGLOGD(eDebugResourceManager, "\t\tdisplay index(%zu), displayId(%d), display(%p)", j, display->mDisplayId, display); - if ((display != NULL) && - (display->mDisplayControl.forceReserveMPP || display->mPlugState)) { + if (display->mDisplayControl.forceReserveMPP || + (display->mPlugState && + ((display->mType != HWC_DISPLAY_PRIMARY) || + (display->mPowerModeState != HWC2_POWER_MODE_OFF)))) { HDEBUGLOGD(eDebugResourceManager, "\t\treserve to display %d", display->mDisplayId); mOtfMPPs[i]->reserveMPP(display->mDisplayId); break; |