summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2022-06-23 11:17:16 -0700
committer Robert Carr <racarr@google.com> 2022-06-23 11:21:01 -0700
commitb645049d01ef72653dc8fc363b9af18f4678f1e8 (patch)
tree64700ff40f1d7f0289932838bed7f1e5ebdec077
parent33da9468354b9b530712d4157298a8e0479cf2e5 (diff)
SurfaceFlinger: Disable early release optimization
Starting a few weeks ago a crop of issues started showing up on a subset of devices, related to the early release optimization (which landed much earlier). Attempts to fix them unfortunately introduced another regression. The fact that the optimization is only triggering visible errors on a subset of devices is somewhat of a mystery. A CL is prepared which fixes all issues observed to date. Howeverthis mystery about device specific behavior implies the full implications of the optimization are not yet understood. It's better to disable the optimization for the current release and take time to fully understand what is happening. Removing the optimization may have some impact on jank, but I expect it's unlikely to be large. I only expect the optimization to reduce jank in cases where: 1. The app is backpressured 2. SurfaceFlinger is repeatedly missing frames producing long dequeues 3. The app has UI + RenderThread time >= vsync interval and is only able to achieve steady production with render ahead and pipelining. If SurfaceFlinger were to begin regular frame production again, early release could help the steady production pipeline recover faster by unblocking the app sooner. This represents a small amount of edge cases. Continued work on preventing SF from missing frames, makes this probably even a smaller amount than when the early release optimization first landed. Bug: 236120925 Bug: 234753489 Test: Existing tests pass. Verify that early release is disabled. Change-Id: I6a9a34331edb752d51c9d2d0b6826942d0545e3d
-rw-r--r--services/surfaceflinger/BufferStateLayer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp
index fecf5ae059..3875f151cb 100644
--- a/services/surfaceflinger/BufferStateLayer.cpp
+++ b/services/surfaceflinger/BufferStateLayer.cpp
@@ -34,6 +34,8 @@
#include "FrameTracer/FrameTracer.h"
#include "TimeStats/TimeStats.h"
+#define EARLY_RELEASE_ENABLED false
+
namespace android {
using PresentState = frametimeline::SurfaceFrame::PresentState;
@@ -373,7 +375,7 @@ bool BufferStateLayer::setBuffer(std::shared_ptr<renderengine::ExternalTexture>&
addSurfaceFrameDroppedForBuffer(mDrawingState.bufferSurfaceFrameTX);
mDrawingState.bufferSurfaceFrameTX.reset();
}
- } else if (mLastClientCompositionFence != nullptr) {
+ } else if (EARLY_RELEASE_ENABLED && mLastClientCompositionFence != nullptr) {
callReleaseBufferCallback(mDrawingState.releaseBufferListener,
mDrawingState.buffer->getBuffer(), mDrawingState.frameNumber,
mLastClientCompositionFence,