summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishnu Nair <vishnun@google.com>2022-07-29 21:52:53 +0000
committerVishnu Nair <vishnun@google.com>2022-07-30 01:39:07 +0000
commit3a49f0a4c5685162f430dc7fcd5c1a7967d007c8 (patch)
tree011ccae8cb15e7e6056323389fbe0f814dadb913
parent4830cd6ad9d045f6aefd134e41822c570067605d (diff)
downloadnative-3a49f0a4c5685162f430dc7fcd5c1a7967d007c8.tar.gz
CE: Pass the fence with the cached client composition buffer
Composition cache checks the buffer id with the client composition request to see if we can reuse a buffer if the request has not changed. We never bothered with a fence here because by the time the cache was accessed, we would have sent the buffer to the display at least once. With composition strategy prediction, our assumption breaks. There is a chance we fail to predict the strategy but the new strategy results in the same client composition request so we can reuse the client composition work that was submitted in the beginning of the frame. Test: Repro steps in bug Test: go/wm-smoke Bug: 239944175 Change-Id: Idbe6a9bb3bba889aa7b459b1046890ea3960982f
-rw-r--r--services/surfaceflinger/CompositionEngine/src/Output.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index c3385a8a8b..f360504070 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -1218,7 +1218,8 @@ std::optional<base::unique_fd> Output::composeSurfaces(
ATRACE_NAME("ClientCompositionCacheHit");
outputCompositionState.reusedClientComposition = true;
setExpensiveRenderingExpected(false);
- return base::unique_fd();
+ // b/239944175 pass the fence associated with the buffer.
+ return base::unique_fd(std::move(fd));
}
ATRACE_NAME("ClientCompositionCacheMiss");
mClientCompositionRequestCache->add(tex->getBuffer()->getId(), clientCompositionDisplay,