Loading services/surfaceflinger/Layer.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -790,7 +790,7 @@ void Layer::transferAvailableJankData(const std::deque<sp<CallbackHandle>>& hand // transaction // ---------------------------------------------------------------------------- uint32_t Layer::doTransaction(uint32_t flags, nsecs_t latchTime) { uint32_t Layer::doTransaction(uint32_t flags) { ATRACE_CALL(); // TODO: This is unfortunate. Loading Loading @@ -818,12 +818,12 @@ uint32_t Layer::doTransaction(uint32_t flags, nsecs_t latchTime) { mFlinger->mUpdateInputInfo = true; } commitTransaction(mDrawingState, latchTime); commitTransaction(mDrawingState); return flags; } void Layer::commitTransaction(State&, nsecs_t currentLatchTime) { void Layer::commitTransaction(State&) { // Set the present state for all bufferlessSurfaceFramesTX to Presented. The // bufferSurfaceFrameTX will be presented in latchBuffer. for (auto& [token, surfaceFrame] : mDrawingState.bufferlessSurfaceFramesTX) { Loading @@ -835,7 +835,6 @@ void Layer::commitTransaction(State&, nsecs_t currentLatchTime) { } } mDrawingState.bufferlessSurfaceFramesTX.clear(); mLastLatchTime = currentLatchTime; } uint32_t Layer::clearTransactionFlags(uint32_t mask) { Loading Loading @@ -1381,7 +1380,7 @@ void Layer::addSurfaceFramePresentedForBuffer( surfaceFrame->setAcquireFenceTime(acquireFenceTime); surfaceFrame->setPresentState(PresentState::Presented, mLastLatchTime); mFlinger->mFrameTimeline->addSurfaceFrame(surfaceFrame); mLastLatchTime = currentLatchTime; updateLastLatchTime(currentLatchTime); } std::shared_ptr<frametimeline::SurfaceFrame> Layer::createSurfaceFrameForTransaction( Loading Loading @@ -4077,6 +4076,10 @@ void Layer::setTrustedPresentationInfo(TrustedPresentationThresholds const& thre } } void Layer::updateLastLatchTime(nsecs_t latchTime) { mLastLatchTime = latchTime; } // --------------------------------------------------------------------------- std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate) { Loading services/surfaceflinger/Layer.h +3 −2 Original line number Diff line number Diff line Loading @@ -347,6 +347,7 @@ public: void useSurfaceDamage(); void useEmptyDamage(); Region getVisibleRegion(const DisplayDevice*) const; void updateLastLatchTime(nsecs_t latchtime); /* * isOpaque - true if this surface is opaque Loading Loading @@ -623,7 +624,7 @@ public: * doTransaction - process the transaction. This is a good place to figure * out which attributes of the surface have changed. */ virtual uint32_t doTransaction(uint32_t transactionFlags, nsecs_t currentLatchTime); virtual uint32_t doTransaction(uint32_t transactionFlags); /* * Remove relative z for the layer if its relative parent is not part of the Loading Loading @@ -860,7 +861,7 @@ protected: void preparePerFrameCompositionState(); void preparePerFrameBufferCompositionState(); void preparePerFrameEffectsCompositionState(); virtual void commitTransaction(State& stateToCommit, nsecs_t currentLatchTime = 0); virtual void commitTransaction(State& stateToCommit); void gatherBufferInfo(); void onSurfaceFrameCreated(const std::shared_ptr<frametimeline::SurfaceFrame>&); Loading services/surfaceflinger/SurfaceFlinger.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -3863,7 +3863,7 @@ void SurfaceFlinger::commitOffscreenLayers() { for (Layer* offscreenLayer : mOffscreenLayers) { offscreenLayer->traverse(LayerVector::StateSet::Drawing, [](Layer* layer) { if (layer->clearTransactionFlags(eTransactionNeeded)) { layer->doTransaction(0, 0); layer->doTransaction(0); layer->commitChildList(); } }); Loading Loading @@ -3899,7 +3899,7 @@ bool SurfaceFlinger::latchBuffers() { // second frame. But layer 0's second frame could be waiting on display. mDrawingState.traverse([&](Layer* layer) { if (layer->clearTransactionFlags(eTransactionNeeded) || mForceTransactionDisplayChange) { const uint32_t flags = layer->doTransaction(0, latchTime); const uint32_t flags = layer->doTransaction(0); if (flags & Layer::eVisibleRegion) { mVisibleRegionsDirty = true; } Loading @@ -3910,6 +3910,8 @@ bool SurfaceFlinger::latchBuffers() { mLayersWithQueuedFrames.emplace(sp<Layer>::fromExisting(layer)); } else { layer->useEmptyDamage(); // If the layer has frames we will update the latch time when latching the buffer. layer->updateLastLatchTime(latchTime); } }); mForceTransactionDisplayChange = false; Loading Loading
services/surfaceflinger/Layer.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -790,7 +790,7 @@ void Layer::transferAvailableJankData(const std::deque<sp<CallbackHandle>>& hand // transaction // ---------------------------------------------------------------------------- uint32_t Layer::doTransaction(uint32_t flags, nsecs_t latchTime) { uint32_t Layer::doTransaction(uint32_t flags) { ATRACE_CALL(); // TODO: This is unfortunate. Loading Loading @@ -818,12 +818,12 @@ uint32_t Layer::doTransaction(uint32_t flags, nsecs_t latchTime) { mFlinger->mUpdateInputInfo = true; } commitTransaction(mDrawingState, latchTime); commitTransaction(mDrawingState); return flags; } void Layer::commitTransaction(State&, nsecs_t currentLatchTime) { void Layer::commitTransaction(State&) { // Set the present state for all bufferlessSurfaceFramesTX to Presented. The // bufferSurfaceFrameTX will be presented in latchBuffer. for (auto& [token, surfaceFrame] : mDrawingState.bufferlessSurfaceFramesTX) { Loading @@ -835,7 +835,6 @@ void Layer::commitTransaction(State&, nsecs_t currentLatchTime) { } } mDrawingState.bufferlessSurfaceFramesTX.clear(); mLastLatchTime = currentLatchTime; } uint32_t Layer::clearTransactionFlags(uint32_t mask) { Loading Loading @@ -1381,7 +1380,7 @@ void Layer::addSurfaceFramePresentedForBuffer( surfaceFrame->setAcquireFenceTime(acquireFenceTime); surfaceFrame->setPresentState(PresentState::Presented, mLastLatchTime); mFlinger->mFrameTimeline->addSurfaceFrame(surfaceFrame); mLastLatchTime = currentLatchTime; updateLastLatchTime(currentLatchTime); } std::shared_ptr<frametimeline::SurfaceFrame> Layer::createSurfaceFrameForTransaction( Loading Loading @@ -4077,6 +4076,10 @@ void Layer::setTrustedPresentationInfo(TrustedPresentationThresholds const& thre } } void Layer::updateLastLatchTime(nsecs_t latchTime) { mLastLatchTime = latchTime; } // --------------------------------------------------------------------------- std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate) { Loading
services/surfaceflinger/Layer.h +3 −2 Original line number Diff line number Diff line Loading @@ -347,6 +347,7 @@ public: void useSurfaceDamage(); void useEmptyDamage(); Region getVisibleRegion(const DisplayDevice*) const; void updateLastLatchTime(nsecs_t latchtime); /* * isOpaque - true if this surface is opaque Loading Loading @@ -623,7 +624,7 @@ public: * doTransaction - process the transaction. This is a good place to figure * out which attributes of the surface have changed. */ virtual uint32_t doTransaction(uint32_t transactionFlags, nsecs_t currentLatchTime); virtual uint32_t doTransaction(uint32_t transactionFlags); /* * Remove relative z for the layer if its relative parent is not part of the Loading Loading @@ -860,7 +861,7 @@ protected: void preparePerFrameCompositionState(); void preparePerFrameBufferCompositionState(); void preparePerFrameEffectsCompositionState(); virtual void commitTransaction(State& stateToCommit, nsecs_t currentLatchTime = 0); virtual void commitTransaction(State& stateToCommit); void gatherBufferInfo(); void onSurfaceFrameCreated(const std::shared_ptr<frametimeline::SurfaceFrame>&); Loading
services/surfaceflinger/SurfaceFlinger.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -3863,7 +3863,7 @@ void SurfaceFlinger::commitOffscreenLayers() { for (Layer* offscreenLayer : mOffscreenLayers) { offscreenLayer->traverse(LayerVector::StateSet::Drawing, [](Layer* layer) { if (layer->clearTransactionFlags(eTransactionNeeded)) { layer->doTransaction(0, 0); layer->doTransaction(0); layer->commitChildList(); } }); Loading Loading @@ -3899,7 +3899,7 @@ bool SurfaceFlinger::latchBuffers() { // second frame. But layer 0's second frame could be waiting on display. mDrawingState.traverse([&](Layer* layer) { if (layer->clearTransactionFlags(eTransactionNeeded) || mForceTransactionDisplayChange) { const uint32_t flags = layer->doTransaction(0, latchTime); const uint32_t flags = layer->doTransaction(0); if (flags & Layer::eVisibleRegion) { mVisibleRegionsDirty = true; } Loading @@ -3910,6 +3910,8 @@ bool SurfaceFlinger::latchBuffers() { mLayersWithQueuedFrames.emplace(sp<Layer>::fromExisting(layer)); } else { layer->useEmptyDamage(); // If the layer has frames we will update the latch time when latching the buffer. layer->updateLastLatchTime(latchTime); } }); mForceTransactionDisplayChange = false; Loading