summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-07-28 15:36:11 -0700
committerJohn Reck <jreck@google.com>2016-07-29 07:56:02 -0700
commit2d5b8d73929a38b019c6b6276d4a19542b990f0c (patch)
treed0224acca3391c34e4b2c33aac2bc8c685bea93b /libs/hwui/JankTracker.h
parent255ad67b2e61c5ac407c5ef539275b4de99186b4 (diff)
Teach JankTracker about new swap behaviors
Bug: 30440166 If we are using HWC2, there's a change in timing when in triple buffering with the pipelined offsets. This changes JankTracker to recognize that and silently erase that from the total duration Change-Id: Ib1fd4209070f17dbd2baed707c8cf73fb11c3cf2
Diffstat (limited to 'libs/hwui/JankTracker.h')
-rw-r--r--libs/hwui/JankTracker.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h
index 84b8c3f3f155..126025c00933 100644
--- a/libs/hwui/JankTracker.h
+++ b/libs/hwui/JankTracker.h
@@ -21,6 +21,7 @@
#include "utils/RingBuffer.h"
#include <cutils/compiler.h>
+#include <ui/DisplayInfo.h>
#include <array>
#include <memory>
@@ -56,7 +57,7 @@ struct ProfileData {
// TODO: Replace DrawProfiler with this
class JankTracker {
public:
- JankTracker(nsecs_t frameIntervalNanos);
+ JankTracker(const DisplayInfo& displayInfo);
~JankTracker();
void addFrame(const FrameInfo& frame);
@@ -79,6 +80,14 @@ private:
std::array<int64_t, NUM_BUCKETS> mThresholds;
int64_t mFrameInterval;
+ // The amount of time we will erase from the total duration to account
+ // for SF vsync offsets with HWC2 blocking dequeueBuffers.
+ // (Vsync + mDequeueBlockTolerance) is the point at which we expect
+ // SF to have released the buffer normally, so we will forgive up to that
+ // point in time by comparing to (IssueDrawCommandsStart + DequeueDuration)
+ // This is only used if we are in pipelined mode and are using HWC2,
+ // otherwise it's 0.
+ nsecs_t mDequeueTimeForgiveness = 0;
ProfileData* mData;
bool mIsMapped = false;
};