diff options
author | linpeter <linpeter@google.com> | 2022-12-12 23:12:34 +0800 |
---|---|---|
committer | linpeter <linpeter@google.com> | 2023-01-12 15:17:16 +0800 |
commit | 1bf8eefd90f7afe7da7e03da851cfdaf8bb13c03 (patch) | |
tree | 28dc7334cd205663351209cac13a235e31e7a9c5 /libhwc2.1/libresource/ExynosResourceManager.cpp | |
parent | 7c10792f83fea576d0b6044831cbf83d61cd8c74 (diff) |
libhwc2.1: update resource manager/HWC service for multi displays
Checked primary displays in preAssignWindows.
Checked destination scale for all primary display in validateLayer.
Added display id as input in setDDIScale.
Bug: 257422563
test: check boot to home
Change-Id: I18813fde26ac94c8dbb685aebdf38561bc4973ce
Diffstat (limited to 'libhwc2.1/libresource/ExynosResourceManager.cpp')
-rw-r--r-- | libhwc2.1/libresource/ExynosResourceManager.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/libhwc2.1/libresource/ExynosResourceManager.cpp b/libhwc2.1/libresource/ExynosResourceManager.cpp index 3c94c2f..ba30526 100644 --- a/libhwc2.1/libresource/ExynosResourceManager.cpp +++ b/libhwc2.1/libresource/ExynosResourceManager.cpp @@ -326,6 +326,8 @@ bool ExynosResourceManager::DstBufMgrThread::threadLoop() ExynosDevice *device = mExynosResourceManager->mDevice; if (device == NULL) return false; + + /* TODO(b/265244856): to clarify which display size to alloc */ ExynosDisplay *display = device->getDisplay(getDisplayId(HWC_DISPLAY_PRIMARY, 0)); if (display == NULL) return false; @@ -447,7 +449,7 @@ int32_t ExynosResourceManager::assignResource(ExynosDisplay *display) __func__, ret); return ret; } - preAssignWindows(); + preAssignWindows(display); } @@ -1083,7 +1085,7 @@ int32_t ExynosResourceManager::validateLayer(uint32_t index, ExynosDisplay *disp return eDynamicRecomposition; if ((layer->mLayerBuffer != NULL) && - (display->mDisplayId == getDisplayId(HWC_DISPLAY_PRIMARY, 0)) && + (display->mType == HWC_DISPLAY_PRIMARY) && (mForceReallocState != DST_REALLOC_DONE)) { ALOGI("Device type assign skipping by dst reallocation...... "); return eReallocOnGoingForDDI; @@ -2007,18 +2009,22 @@ int32_t ExynosResourceManager::preAssignResources() return NO_ERROR; } -void ExynosResourceManager::preAssignWindows() -{ - ExynosDisplay *display = NULL; - ExynosPrimaryDisplayModule *primaryDisplay = - (ExynosPrimaryDisplayModule *)mDevice->getDisplay(getDisplayId(HWC_DISPLAY_PRIMARY, 0)); +void ExynosResourceManager::preAssignWindows(ExynosDisplay *display) { + ExynosPrimaryDisplayModule *primaryDisplay = NULL; + + if (display->mType == HWC_DISPLAY_PRIMARY) { + primaryDisplay = (ExynosPrimaryDisplayModule *)display; + } else { + primaryDisplay = (ExynosPrimaryDisplayModule *)mDevice->getDisplay( + getDisplayId(HWC_DISPLAY_PRIMARY, 0)); + } + primaryDisplay->usePreDefinedWindow(false); for (size_t i = 1; i < mDevice->mDisplays.size(); i++) { - display = mDevice->mDisplays[i]; - if ((display == NULL) || (display->mType != HWC_DISPLAY_EXTERNAL)) - continue; - if (display->mPlugState == true) { + ExynosDisplay *disp = mDevice->mDisplays[i]; + if ((disp == NULL) || (display->mType != HWC_DISPLAY_EXTERNAL)) continue; + if (disp->mPlugState == true) { primaryDisplay->usePreDefinedWindow(true); } } @@ -2359,7 +2365,7 @@ int32_t ExynosResourceManager::initResourcesState(ExynosDisplay *display) __func__, ret); return ret; } - preAssignWindows(); + preAssignWindows(display); } |