summaryrefslogtreecommitdiff
path: root/libhwc2.1/libresource/ExynosResourceManager.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-05-04 20:34:05 +0000
committerSteven Moreland <smoreland@google.com>2021-05-04 20:34:05 +0000
commitc7842b503313fa6459f5cfa25a62346cd2c9e9ab (patch)
tree0905c629fc3fbfbdde3cd5a7a5369240d52f30ae /libhwc2.1/libresource/ExynosResourceManager.cpp
parent81f12402a49bd289475a49f19405f7031028678b (diff)
libhwc2.1: fix double-ownership of DstBufMgrThread
This class extends (transitively) from RefBase, and it is double-owned when Thread::run is called. This is currently causing an abort on ToT. Bug: 187193336 Test: N/A Change-Id: I9dabd30f671f59bea9507ae342301c6a6ef7fa85
Diffstat (limited to 'libhwc2.1/libresource/ExynosResourceManager.cpp')
-rw-r--r--libhwc2.1/libresource/ExynosResourceManager.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libhwc2.1/libresource/ExynosResourceManager.cpp b/libhwc2.1/libresource/ExynosResourceManager.cpp
index f60850a..113a4c1 100644
--- a/libhwc2.1/libresource/ExynosResourceManager.cpp
+++ b/libhwc2.1/libresource/ExynosResourceManager.cpp
@@ -143,7 +143,7 @@ ExynosResourceManager::ExynosResourceManager(ExynosDevice *device)
hasHdrLayer(false),
hasDrmLayer(false),
mFormatRestrictionCnt(0),
- mDstBufMgrThread(this),
+ mDstBufMgrThread(sp<DstBufMgrThread>::make(this)),
mResourceReserved(0x0)
{
@@ -195,8 +195,8 @@ ExynosResourceManager::ExynosResourceManager(ExynosDevice *device)
}
}
- mDstBufMgrThread.mRunning = true;
- mDstBufMgrThread.run("DstBufMgrThread");
+ mDstBufMgrThread->mRunning = true;
+ mDstBufMgrThread->run("DstBufMgrThread");
}
ExynosResourceManager::~ExynosResourceManager()
@@ -212,8 +212,8 @@ ExynosResourceManager::~ExynosResourceManager()
}
mM2mMPPs.clear();
- mDstBufMgrThread.mRunning = false;
- mDstBufMgrThread.requestExitAndWait();
+ mDstBufMgrThread->mRunning = false;
+ mDstBufMgrThread->requestExitAndWait();
}
void ExynosResourceManager::reloadResourceForHWFC()
@@ -266,7 +266,7 @@ int32_t ExynosResourceManager::doPreProcessing()
void ExynosResourceManager::doReallocDstBufs(uint32_t Xres, uint32_t Yres)
{
HDEBUGLOGD(eDebugBuf, "M2M dst alloc call ");
- mDstBufMgrThread.reallocDstBufs(Xres, Yres);
+ mDstBufMgrThread->reallocDstBufs(Xres, Yres);
}
bool ExynosResourceManager::DstBufMgrThread::needDstRealloc(uint32_t Xres, uint32_t Yres, ExynosMPP *m2mMPP)
@@ -583,7 +583,7 @@ int32_t ExynosResourceManager::assignResourceInternal(ExynosDisplay *display)
int ret = NO_ERROR;
int retry_count = 0;
- Mutex::Autolock lock(mDstBufMgrThread.mStateMutex);
+ Mutex::Autolock lock(mDstBufMgrThread->mStateMutex);
/*
* First add layers that SF requested HWC2_COMPOSITION_CLIENT type