diff options
author | Jorim Jaggi <jjaggi@google.com> | 2021-01-19 00:08:02 +0100 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2021-04-13 15:18:27 +0000 |
commit | 10f328c580fe1e897b51a7e4b38ee4c341d970f1 (patch) | |
tree | b5719df2aa8460ef2925440e72ecec07020557b1 /libs/hwui/FrameInfo.h | |
parent | a373e1ed5a59997b2cc8ac86615963d8597e4a2b (diff) |
Change hwui jank detection to use deadline & gpu completion (1/2)
- Use GPU finish time as well as actual deadline to determine jank
rate.
- Use dynamic interval to adjust for 60/90hz switching
- Move frame metrics reporting into JankTracker to adjust the
deadline communicated to the app when in stuffing scenario.
- Adjust double-stuffing detection to be a bit more readable.
Test: GraphicsStatsValidationTest.java
Test: adb shell dumpsys gfxinfo
Test: FrameMetricsListenerTest
Test: Log output of FrameMetricsObserver
Bug: 169858044
Change-Id: I3a6b8ed163e2cf9cf2b67667110340ebe35f98a1
Diffstat (limited to 'libs/hwui/FrameInfo.h')
-rw-r--r-- | libs/hwui/FrameInfo.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h index 62ac4ca5fdad..2a134fa214e7 100644 --- a/libs/hwui/FrameInfo.h +++ b/libs/hwui/FrameInfo.h @@ -28,7 +28,7 @@ namespace android { namespace uirenderer { -static constexpr size_t UI_THREAD_FRAME_INFO_SIZE = 11; +static constexpr size_t UI_THREAD_FRAME_INFO_SIZE = 12; enum class FrameInfoIndex { Flags = 0, @@ -42,6 +42,7 @@ enum class FrameInfoIndex { DrawStart, FrameDeadline, FrameStartTime, + FrameInterval, // End of UI frame info SyncQueued, @@ -77,6 +78,9 @@ enum { class UiFrameInfoBuilder { public: static constexpr int64_t INVALID_VSYNC_ID = -1; + static constexpr int64_t UNKNOWN_DEADLINE = std::numeric_limits<int64_t>::max(); + static constexpr int64_t UNKNOWN_FRAME_INTERVAL = -1; + explicit UiFrameInfoBuilder(int64_t* buffer) : mBuffer(buffer) { memset(mBuffer, 0, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); @@ -89,7 +93,7 @@ public: } UiFrameInfoBuilder& setVsync(nsecs_t vsyncTime, nsecs_t intendedVsync, - int64_t vsyncId, int64_t frameDeadline) { + int64_t vsyncId, int64_t frameDeadline, nsecs_t frameInterval) { set(FrameInfoIndex::FrameTimelineVsyncId) = vsyncId; set(FrameInfoIndex::Vsync) = vsyncTime; set(FrameInfoIndex::IntendedVsync) = intendedVsync; @@ -100,6 +104,7 @@ public: set(FrameInfoIndex::PerformTraversalsStart) = vsyncTime; set(FrameInfoIndex::DrawStart) = vsyncTime; set(FrameInfoIndex::FrameDeadline) = frameDeadline; + set(FrameInfoIndex::FrameInterval) = frameInterval; return *this; } |