Loading libs/gui/SurfaceComposerClient.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ int64_t generateId() { } constexpr int64_t INVALID_VSYNC = -1; const constexpr char* LOG_SURFACE_CONTROL_REGISTRY = "SurfaceControlRegistry"; } // namespace Loading Loading @@ -873,6 +874,7 @@ status_t SurfaceComposerClient::Transaction::readFromParcel(const Parcel* parcel const bool earlyWakeupEnd = parcel->readBool(); const int64_t desiredPresentTime = parcel->readInt64(); const bool isAutoTimestamp = parcel->readBool(); const bool logCallPoints = parcel->readBool(); FrameTimelineInfo frameTimelineInfo; frameTimelineInfo.readFromParcel(parcel); Loading Loading @@ -1000,6 +1002,7 @@ status_t SurfaceComposerClient::Transaction::writeToParcel(Parcel* parcel) const parcel->writeBool(mEarlyWakeupEnd); parcel->writeInt64(mDesiredPresentTime); parcel->writeBool(mIsAutoTimestamp); parcel->writeBool(mLogCallPoints); mFrameTimelineInfo.writeToParcel(parcel); parcel->writeStrongBinder(mApplyToken); parcel->writeUint32(static_cast<uint32_t>(mDisplayStates.size())); Loading Loading @@ -1135,6 +1138,12 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr mergeFrameTimelineInfo(mFrameTimelineInfo, other.mFrameTimelineInfo); mLogCallPoints |= other.mLogCallPoints; if (mLogCallPoints) { ALOG(LOG_DEBUG, LOG_SURFACE_CONTROL_REGISTRY, "Transaction %" PRIu64 " merged with transaction %" PRIu64, other.getId(), mId); } other.clear(); return *this; } Loading @@ -1154,6 +1163,7 @@ void SurfaceComposerClient::Transaction::clear() { mFrameTimelineInfo = {}; mApplyToken = nullptr; mMergedTransactionIds.clear(); mLogCallPoints = false; } uint64_t SurfaceComposerClient::Transaction::getId() { Loading Loading @@ -1362,6 +1372,10 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay syncCallback->wait(); } if (mLogCallPoints) { ALOG(LOG_DEBUG, LOG_SURFACE_CONTROL_REGISTRY, "Transaction %" PRIu64 " applied", mId); } mStatus = NO_ERROR; return binderStatus; } Loading Loading @@ -1392,6 +1406,11 @@ status_t SurfaceComposerClient::Transaction::sendSurfaceFlushJankDataTransaction t.registerSurfaceControlForCallback(sc); return t.apply(/*sync=*/false, /* oneWay=*/true); } void SurfaceComposerClient::Transaction::enableDebugLogCallPoints() { mLogCallPoints = true; } // --------------------------------------------------------------------------- sp<IBinder> SurfaceComposerClient::createVirtualDisplay(const std::string& displayName, Loading libs/gui/include/gui/SurfaceComposerClient.h +3 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,8 @@ public: static void mergeFrameTimelineInfo(FrameTimelineInfo& t, const FrameTimelineInfo& other); // Tracks registered callbacks sp<TransactionCompletedListener> mTransactionCompletedListener = nullptr; // Prints debug logs when enabled. bool mLogCallPoints = false; protected: std::unordered_map<sp<IBinder>, ComposerState, IBinderHash> mComposerStates; Loading Loading @@ -809,6 +811,7 @@ public: static void setDefaultApplyToken(sp<IBinder> applyToken); static status_t sendSurfaceFlushJankDataTransaction(const sp<SurfaceControl>& sc); void enableDebugLogCallPoints(); }; status_t clearLayerFrameStats(const sp<IBinder>& token) const; Loading Loading
libs/gui/SurfaceComposerClient.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ int64_t generateId() { } constexpr int64_t INVALID_VSYNC = -1; const constexpr char* LOG_SURFACE_CONTROL_REGISTRY = "SurfaceControlRegistry"; } // namespace Loading Loading @@ -873,6 +874,7 @@ status_t SurfaceComposerClient::Transaction::readFromParcel(const Parcel* parcel const bool earlyWakeupEnd = parcel->readBool(); const int64_t desiredPresentTime = parcel->readInt64(); const bool isAutoTimestamp = parcel->readBool(); const bool logCallPoints = parcel->readBool(); FrameTimelineInfo frameTimelineInfo; frameTimelineInfo.readFromParcel(parcel); Loading Loading @@ -1000,6 +1002,7 @@ status_t SurfaceComposerClient::Transaction::writeToParcel(Parcel* parcel) const parcel->writeBool(mEarlyWakeupEnd); parcel->writeInt64(mDesiredPresentTime); parcel->writeBool(mIsAutoTimestamp); parcel->writeBool(mLogCallPoints); mFrameTimelineInfo.writeToParcel(parcel); parcel->writeStrongBinder(mApplyToken); parcel->writeUint32(static_cast<uint32_t>(mDisplayStates.size())); Loading Loading @@ -1135,6 +1138,12 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr mergeFrameTimelineInfo(mFrameTimelineInfo, other.mFrameTimelineInfo); mLogCallPoints |= other.mLogCallPoints; if (mLogCallPoints) { ALOG(LOG_DEBUG, LOG_SURFACE_CONTROL_REGISTRY, "Transaction %" PRIu64 " merged with transaction %" PRIu64, other.getId(), mId); } other.clear(); return *this; } Loading @@ -1154,6 +1163,7 @@ void SurfaceComposerClient::Transaction::clear() { mFrameTimelineInfo = {}; mApplyToken = nullptr; mMergedTransactionIds.clear(); mLogCallPoints = false; } uint64_t SurfaceComposerClient::Transaction::getId() { Loading Loading @@ -1362,6 +1372,10 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay syncCallback->wait(); } if (mLogCallPoints) { ALOG(LOG_DEBUG, LOG_SURFACE_CONTROL_REGISTRY, "Transaction %" PRIu64 " applied", mId); } mStatus = NO_ERROR; return binderStatus; } Loading Loading @@ -1392,6 +1406,11 @@ status_t SurfaceComposerClient::Transaction::sendSurfaceFlushJankDataTransaction t.registerSurfaceControlForCallback(sc); return t.apply(/*sync=*/false, /* oneWay=*/true); } void SurfaceComposerClient::Transaction::enableDebugLogCallPoints() { mLogCallPoints = true; } // --------------------------------------------------------------------------- sp<IBinder> SurfaceComposerClient::createVirtualDisplay(const std::string& displayName, Loading
libs/gui/include/gui/SurfaceComposerClient.h +3 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,8 @@ public: static void mergeFrameTimelineInfo(FrameTimelineInfo& t, const FrameTimelineInfo& other); // Tracks registered callbacks sp<TransactionCompletedListener> mTransactionCompletedListener = nullptr; // Prints debug logs when enabled. bool mLogCallPoints = false; protected: std::unordered_map<sp<IBinder>, ComposerState, IBinderHash> mComposerStates; Loading Loading @@ -809,6 +811,7 @@ public: static void setDefaultApplyToken(sp<IBinder> applyToken); static status_t sendSurfaceFlushJankDataTransaction(const sp<SurfaceControl>& sc); void enableDebugLogCallPoints(); }; status_t clearLayerFrameStats(const sp<IBinder>& token) const; Loading