hwc: Define and Use mSecureLock
Define and Use mSecureLock in composition and binder
thread. This is to ensure both variables mSecureMode
and mSecuring are updated in binder thread without
any context switch to composition thread
Change-Id: Ibd701bd3363515e2f7e8a9711bbc5b66053cfa03
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 43bebac..f90420f 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -260,6 +260,7 @@
ctx->mBlankLock.lock();
//Will be unlocked at the end of set
ctx->mExtLock.lock();
+ ctx->mSecureLock.lock();
reset(ctx, numDisplays, displays);
ctx->mOverlay->configBegin();
@@ -614,6 +615,7 @@
MDPComp::resetIdleFallBack();
ctx->mVideoTransFlag = false;
//Was locked at the beginning of prepare
+ ctx->mSecureLock.unlock();
ctx->mExtLock.unlock();
ctx->mBlankLock.unlock();
return ret;