SurfaceFlinger: Disable early-release on multi displays
The current logic for handling multiple calls to onLayerDisplayed is
insufficient. For example if we did HWC comp followed by GL comp
on a single layer in a single compose cycle, FOLLOWING a previous
compose cycle in which we had done the same thing. The first time
we would enter the first conditional and clear the fence, but then the second
time we would enter the first conditional and keep it. We can't do this
though since the buffer was just used for HWC comp and we can't early
release it. To simplify things we only allow a single call to
onLayerDisplayed otherwise we disable the optimization. We can improve
this to re-enable the optimization with mirroring in the future
by tracking the state more carefully.
Bug: 221894151
Test: Run screenrecord and look for glitches
Change-Id: I73b5adac00d30750d4d79d0cbba9152df638d0e5
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 2b5e337..0fb16f2 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -1049,7 +1049,7 @@
mutable bool mDrawingStateModified = false;
sp<Fence> mLastClientCompositionFence;
- bool mLastClientCompositionDisplayed = false;
+ bool mAlreadyDisplayedThisCompose = false;
private:
virtual void setTransformHint(ui::Transform::RotationFlags) {}