From 92b519bd796f212a50d099c08f06ce54dc6609a2 Mon Sep 17 00:00:00 2001 From: Melody Hsu Date: Wed, 5 Feb 2025 22:01:40 +0000 Subject: Calculate workload target using original frame deadline The target work duration in HWUI ADPF is sometimes incorrect, and is more often incorrect during buffer stuffing recovery due to the exposure of new jank. The issue causes CPU clock frequencies to decrease too much, and cause potential jank in subequent frames. The original frame deadline should be used instead in calculating the workload target deadline when triple buffered because even when the deadline is pushed later during buffer stuffing, the throughput requirements remain the same. Also fixes a misordering in FrameInfoNames that was inconsistent with FrameInfo and FrameMetrics. Bug: b/389939827 Test: atest JankTracker Test: presubmit, perfetto traces w/ and w/o buffer stuffing recovery Flag: com.android.graphics.hwui.flags.calc_workload_orig_deadline Change-Id: I2e3da6ee927d20fcbc9299ab5eda5732660d7246 --- libs/hwui/FrameInfo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libs/hwui/FrameInfo.cpp') diff --git a/libs/hwui/FrameInfo.cpp b/libs/hwui/FrameInfo.cpp index a958a091a830..36feabde07eb 100644 --- a/libs/hwui/FrameInfo.cpp +++ b/libs/hwui/FrameInfo.cpp @@ -32,8 +32,9 @@ const std::array FrameInfoNames{"Flags", "PerformTraversalsStart", "DrawStart", "FrameDeadline", - "FrameInterval", "FrameStartTime", + "FrameInterval", + "WorkloadTarget", "SyncQueued", "SyncStart", "IssueDrawCommandsStart", @@ -48,7 +49,7 @@ const std::array FrameInfoNames{"Flags", }; -static_assert(static_cast(FrameInfoIndex::NumIndexes) == 23, +static_assert(static_cast(FrameInfoIndex::NumIndexes) == 24, "Must update value in FrameMetrics.java#FRAME_STATS_COUNT (and here)"); void FrameInfo::importUiThreadInfo(int64_t* info) { -- cgit v1.2.3-59-g8ed1b