diff options
author | Rajat Yadav <quic_rajayada@quicinc.com> | 2022-05-02 12:11:01 +0530 |
---|---|---|
committer | Rajat Yadav <quic_rajayada@quicinc.com> | 2022-05-02 12:11:01 +0530 |
commit | 0cd2304dfad25401cf47174689d446aa0ecbbe33 (patch) | |
tree | f274fde92ad9a85645260df5a52d1b75d33bc24f | |
parent | 8aa2ae5a0c5255de801c25529b77574bd8661fac (diff) |
surfaceflinger: Modify dumpAll to dump on the main thread
Modify dumpAll to dump on the main thread to address the race
condition issue pertaining to dual display use case.
surfaceflinger: Modify dumpProtoFromMainThread to lock mStateLock
Modify dumpProtoFromMainThread to lock mStateLock in case there
are threads outside of main thread accessing local objects.
CRs-Fixed: 3163560
Change-Id: I13cad753f07c53585e377a4199d5cec538368914
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 6dc2c6d809..630997cd3a 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -6105,6 +6105,7 @@ status_t SurfaceFlinger::doDump(int fd, const DumpArgs& args, bool asProto) { strerror(-lock.status), lock.status); ALOGW("Dumping without lock after timeout: %s (%d)", strerror(-lock.status), lock.status); + return NO_ERROR; } if (const auto it = dumpers.find(flag); it != dumpers.end()) { @@ -6519,6 +6520,7 @@ LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const { const auto display = ON_MAIN_THREAD(getDefaultDisplayDeviceLocked()); LayersProto layersProto; + Mutex::Autolock _l(mStateLock); for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) { layer->writeToProto(layersProto, traceFlags, display.get()); } |