summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/ClientCache.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2021-09-22 12:27:57 -0500
committer chaviw <chaviw@google.com> 2021-09-24 15:56:47 -0500
commit70aa7579ccc3284f77ad98178b6a5029a67e5999 (patch)
treeb9ba4971e5f4a63a15b55d64bb9d7b00ce1f997a /services/surfaceflinger/ClientCache.cpp
parent1cbc2ca67a12546fe7de8101c02c767254a0e4d2 (diff)
Use Transactions for RefreshRateOverlay
RefreshRateOverlay currently calls directly in Layer to update properties. This is ends up adding confusing code to RefreshRateOverlay since it needs to notify SF to handle the updates. It also creates addtional confusion since there are multiple entries to layer properties. Instead, use the SCC Transaction requests to accomplish the same behavior. This simplifies the code and also allows SF to handle the updates instead of RefreshRateOverlay invoking force updates. Test: RefreshRateOverlay works with rotation, different refresh rates Test: RefreshRateOverlayTest Bug: 200820757 Change-Id: I8503c61456c4c14ce6cbcdb2b27035a340fecbf5
Diffstat (limited to 'services/surfaceflinger/ClientCache.cpp')
-rw-r--r--services/surfaceflinger/ClientCache.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/surfaceflinger/ClientCache.cpp b/services/surfaceflinger/ClientCache.cpp
index 1ef8f78894..e7b8995703 100644
--- a/services/surfaceflinger/ClientCache.cpp
+++ b/services/surfaceflinger/ClientCache.cpp
@@ -82,10 +82,13 @@ bool ClientCache::add(const client_cache_t& cacheId, const sp<GraphicBuffer>& bu
return false;
}
- status_t err = token->linkToDeath(mDeathRecipient);
- if (err != NO_ERROR) {
- ALOGE("failed to cache buffer: could not link to death");
- return false;
+ // Only call linkToDeath if not a local binder
+ if (token->localBinder() == nullptr) {
+ status_t err = token->linkToDeath(mDeathRecipient);
+ if (err != NO_ERROR) {
+ ALOGE("failed to cache buffer: could not link to death");
+ return false;
+ }
}
auto [itr, success] =
mBuffers.emplace(processToken,