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
3 files changed