summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2022-06-23 11:17:16 -0700
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-28 01:27:06 +0000
commitdb06ecf8ff98d9e161b1876fb3af828fff79ae12 (patch)
tree2294ed17c4233b67ce2bdc608c03283b5832468a
parent39a40beefe484fc1a295da4b1ffebbc00e53792d (diff)
downloadnative-db06ecf8ff98d9e161b1876fb3af828fff79ae12.tar.gz
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 (cherry picked from commit b645049d01ef72653dc8fc363b9af18f4678f1e8) Merged-In: 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,