summaryrefslogtreecommitdiff
path: root/libs/hwui/ProfileDataContainer.cpp
diff options
context:
space:
mode:
author Jorim Jaggi <jjaggi@google.com> 2021-02-03 23:19:29 +0100
committer Jorim Jaggi <jjaggi@google.com> 2021-02-17 14:55:22 +0100
commit71db8892acc0c80c343141139bde8cfd3f037c4a (patch)
tree9f40ac7b2cf2d535d24d9e6eacf8c353e8dcabc8 /libs/hwui/ProfileDataContainer.cpp
parent5fdf7b8d26f3cd1a2f2fb8a441d40d33270d3b77 (diff)
Add GPU completion to FrameMetrics (1/3)
- Add SurfaceStatsCallback to TransactionCompletedListener - Register a callback in RenderProxy to be called when we have surface stats from SF via the BLAST callback. - Instead of finishing a frame for frame metrics reporting immediately, wait until BLAST callback fires, note GPU completion time and finish frame. - Expose GPU_COMPLETION in FrameMetrics - Modify TOTAL_DURATION to also include GPU_COMPLETION Test: FrameMetricsListenerTest Fixes: 171046219 Change-Id: I16fa1d80cfc4e7a5527c18fec7e885409f17ee4d
Diffstat (limited to 'libs/hwui/ProfileDataContainer.cpp')
-rw-r--r--libs/hwui/ProfileDataContainer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/ProfileDataContainer.cpp b/libs/hwui/ProfileDataContainer.cpp
index 38e0f0aa8d83..41afc0e04c8b 100644
--- a/libs/hwui/ProfileDataContainer.cpp
+++ b/libs/hwui/ProfileDataContainer.cpp
@@ -38,6 +38,8 @@ void ProfileDataContainer::freeData() {
}
void ProfileDataContainer::rotateStorage() {
+ std::lock_guard lock(mJankDataMutex);
+
// If we are mapped we want to stop using the ashmem backend and switch to malloc
// We are expecting a switchStorageToAshmem call to follow this, but it's not guaranteed
// If we aren't sitting on top of ashmem then just do a reset() as it's functionally
@@ -50,6 +52,7 @@ void ProfileDataContainer::rotateStorage() {
}
void ProfileDataContainer::switchStorageToAshmem(int ashmemfd) {
+ std::lock_guard lock(mJankDataMutex);
int regionSize = ashmem_get_size_region(ashmemfd);
if (regionSize < 0) {
int err = errno;
@@ -70,7 +73,9 @@ void ProfileDataContainer::switchStorageToAshmem(int ashmemfd) {
return;
}
- newData->mergeWith(*mData);
+ if (mData != nullptr) {
+ newData->mergeWith(*mData);
+ }
freeData();
mData = newData;
mIsMapped = true;