Don't send override buffer down to HWC if the layer would be skipped
Consider a set of five cached layers. Because ComposerResources' caches are scoped per-layer and does not globally track buffers, the override buffer for each layer needs to be re-imported, and a previous override buffer needs to be freed, if the new override buffer changed between frames. This causes a lot of churn in validate(), up to double CPU time in the hot path. Instead, we shouldn't override the buffer if a layer would be skipped. In the aforementioned example, this would cause 1 buffers-worth of chrun when importing, rather than 5. Bug: 190654391 Test: Perfetto trace Change-Id: I907b0c4c340fd99a0023429a8ad740ecc9208815
Showing
- services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputLayer.h 3 additions, 2 deletions...sitionEngine/include/compositionengine/impl/OutputLayer.h
- services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp 7 additions, 5 deletions...ices/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
- services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp 17 additions, 0 deletions...urfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp
Loading
Please register or sign in to comment