Resolve subtle but severe flickering in layer caching
Inconsistencies in composer state was arising from a layer exiting layer caching. Resolve this by: * If a layer previously had an override buffer, but now does not for the current frame, set the surface damage region to be the entire buffer. * If a layer is currently being skipped, then don't update the composition type, since the validated composition type is no longer accurate for representing the current composition type of the device. * If a layer was previously skipped, then update in HWC the new composition type every time. The inconsistencies have arised from the layer caching feature because composer implementations cache the most recent requested composition type for each layer, but SurfaceFlinger caches the most recent {requested, validated} type for each layer, whichever SurfaceFlinger sees last. So if we forced client composition, then untoggled client composition, and if hwc was device compositing the layer during validate instead of client compositing because hwc ignored the layer, then SF caches DEVICE composition, but hwc caches CLIENT composition internally. SF then doesn't update the layer's composition type because it cached DEVICE composition, but hwc never displays the layer because hwc cached CLIENT composition, and typical hwc implementations never attempt to read from client composited layers. Bug: 187193705 Test: libcompositionengine_test Test: enable layer caching and repeatedly enable and disable client composition when pip is playing Change-Id: I9b6890bcf3f0612e8f99f5f1642015e53d59f862
Loading
Please register or sign in to comment