Commit 360c9bc5 authored by behdad's avatar behdad Committed by Chromium LUCI CQ

Skipped compositor frames (over 100) would not be submitted as dropped frames

Submitting a bulk of skipped compositor frames as dropped frames can affect the normalized worst case percent dropped frames. This change stops submitting skipped frames more than the limit (100 frames).

Bug: 1157101
Change-Id: I63c6f57c9d6c7fa2021842f13f1ca86ff7c9fd48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2583008Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Behdad Bakhshinategh <behdadb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836279}
parent 33f3caa0
......@@ -489,9 +489,13 @@ void CompositorFrameReportingController::CreateReportersForDroppedFrames(
// Up to 100 frames will be reported (100 closest frames to new_args).
const uint32_t kMaxFrameCount = 100;
uint32_t index = (interval > kMaxFrameCount) ? interval - kMaxFrameCount : 1;
auto timestamp = old_args.frame_time + (old_args.interval * index);
for (uint32_t i = index; i < interval; ++i, timestamp += old_args.interval) {
// If there are more than 100 frames skipped, ignore them
if (interval > kMaxFrameCount)
return;
auto timestamp = old_args.frame_time + old_args.interval;
for (uint32_t i = 1; i < interval; ++i, timestamp += old_args.interval) {
auto args = viz::BeginFrameArgs::Create(
BEGINFRAME_FROM_HERE, old_args.frame_id.source_id,
old_args.frame_id.sequence_number + i, timestamp,
......
......@@ -1462,10 +1462,10 @@ TEST_F(CompositorFrameReportingControllerTest,
EXPECT_EQ(0u, dropped_counter.total_main_dropped());
EXPECT_EQ(0u, dropped_counter.total_compositor_dropped());
// Now skip over a 200 frames (100 skipped frames should be added)
// Now skip over a 101 frames (It should be ignored as it more than 100)
// and submit + present another frame.
const uint32_t kSkipFrames = 200;
const uint32_t kSkipFramesActual = std::min(kSkipFrames, 100u);
const uint32_t kSkipFrames = 101;
const uint32_t kSkipFramesActual = 0;
for (uint32_t i = 0; i < kSkipFrames; ++i)
IncrementCurrentId();
SimulatePresentCompositorFrame();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment