diff options
| author | 2024-02-12 20:38:20 +0000 | |
|---|---|---|
| committer | 2024-02-12 20:38:20 +0000 | |
| commit | f6fe81ab5543f98f553c193e271fd19cb804a670 (patch) | |
| tree | 5d6264859c8de84f53016be2b5dbf0ab37a8b030 | |
| parent | 88217126bf727b281e308030c9c934ac854fb6aa (diff) | |
| parent | 5e16196c597f50d390f9631e6ccca863afb66afc (diff) | |
Merge changes from topic "bug240653315" into main
* changes:
Fix a crash for skipped layers with null buffers
Revert "Skip SOLID_COLOR layers from SF Caching"
5 files changed, 3 insertions, 21 deletions
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h index d26ca9dd00..e2d17ee502 100644 --- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h +++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h @@ -147,8 +147,6 @@ public: bool hasProtectedLayers() const; - bool hasSolidColorLayers() const; - // True if any layer in this cached set has CachingHint::Disabled bool cachingHintExcludesLayers() const; diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h index 1f241b091c..dc3821ca43 100644 --- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h +++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h @@ -258,11 +258,6 @@ public: gui::CachingHint getCachingHint() const { return mCachingHint.get(); } - bool hasSolidColorCompositionType() const { - return getOutputLayer()->getLayerFE().getCompositionState()->compositionType == - aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR; - } - float getFps() const { return getOutputLayer()->getLayerFE().getCompositionState()->fps; } void dump(std::string& result) const; diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp index 7fe3369f88..091c207464 100644 --- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp @@ -394,7 +394,6 @@ void OutputLayer::writeStateToHWC(bool includeGeometry, bool skipLayer, uint32_t auto requestedCompositionType = outputIndependentState->compositionType; if (requestedCompositionType == Composition::SOLID_COLOR && state.overrideInfo.buffer) { - // this should never happen, as SOLID_COLOR is skipped from caching, b/230073351 requestedCompositionType = Composition::DEVICE; } @@ -665,6 +664,9 @@ void OutputLayer::uncacheBuffers(const std::vector<uint64_t>& bufferIdsToUncache void OutputLayer::writeBufferStateToHWC(HWC2::Layer* hwcLayer, const LayerFECompositionState& outputIndependentState, bool skipLayer) { + if (skipLayer && outputIndependentState.buffer == nullptr) { + return; + } auto supportedPerFrameMetadata = getOutput().getDisplayColorProfile()->getSupportedPerFrameMetadata(); if (auto error = hwcLayer->setPerFrameMetadata(supportedPerFrameMetadata, diff --git a/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp b/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp index 869dda61bb..1f53588412 100644 --- a/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp +++ b/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp @@ -393,12 +393,6 @@ bool CachedSet::hasProtectedLayers() const { [](const Layer& layer) { return layer.getState()->isProtected(); }); } -bool CachedSet::hasSolidColorLayers() const { - return std::any_of(mLayers.cbegin(), mLayers.cend(), [](const Layer& layer) { - return layer.getState()->hasSolidColorCompositionType(); - }); -} - bool CachedSet::cachingHintExcludesLayers() const { const bool shouldExcludeLayers = std::any_of(mLayers.cbegin(), mLayers.cend(), [](const Layer& layer) { diff --git a/services/surfaceflinger/CompositionEngine/src/planner/Flattener.cpp b/services/surfaceflinger/CompositionEngine/src/planner/Flattener.cpp index 91cfe5dd41..0a5c43a99b 100644 --- a/services/surfaceflinger/CompositionEngine/src/planner/Flattener.cpp +++ b/services/surfaceflinger/CompositionEngine/src/planner/Flattener.cpp @@ -513,13 +513,6 @@ void Flattener::buildCachedSets(time_point now) { } } - for (const CachedSet& layer : mLayers) { - if (layer.hasSolidColorLayers()) { - ATRACE_NAME("layer->hasSolidColorLayers()"); - return; - } - } - std::vector<Run> runs = findCandidateRuns(now); std::optional<Run> bestRun = findBestRun(runs); |