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_utils.h b/libhwcomposer/hwc_utils.h
index 9a7ef0d..7b39ae5 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -346,6 +346,13 @@
mutable Locker mBlankLock;
//Lock to protect prepare & set when detaching external disp
mutable Locker mExtLock;
+ /*Lock to set both mSecureMode and mSecuring as part
+ of binder thread without context switch to composition
+ thread. This lock is needed only for A-family targets
+ since the state of mSecureMode and mSecuring variables
+ are not checked in B-family targets.
+ */
+ mutable Locker mSecureLock;
//Drawing round when we use GPU
bool isPaddingRound;
// External Orientation