Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de27245f authored by Adithya Srinivasan's avatar Adithya Srinivasan
Browse files

Report deltas as 0 instead of -1 for prediction expired display frames

Since both positive and negative values are valid for the deltas,
reporting -1 for cases where we cannot provide a delta skews the
metrics. Instead, report 0 as the delta since the jank is already
reported as unknown.

Bug: 184986864
Test: libsurfaceflinger_unittest
Change-Id: I09cbb0cb7084620038b4d5ada6c196647733bbe5
parent 0de23a9e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -881,10 +881,11 @@ void FrameTimeline::DisplayFrame::setGpuComposition() {
void FrameTimeline::DisplayFrame::classifyJank(nsecs_t& deadlineDelta, nsecs_t& deltaToVsync) {
    if (mPredictionState == PredictionState::Expired ||
        mSurfaceFlingerActuals.presentTime == Fence::SIGNAL_TIME_INVALID) {
        // Cannot do jank classification with expired predictions or invalid signal times.
        // Cannot do jank classification with expired predictions or invalid signal times. Set the
        // deltas to 0 as both negative and positive deltas are used as real values.
        mJankType = JankType::Unknown;
        deadlineDelta = -1;
        deltaToVsync = -1;
        deadlineDelta = 0;
        deltaToVsync = 0;
        return;
    }

+1 −1
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ TEST_F(FrameTimelineTest, presentFenceSignaled_displayFramePredictionExpiredPres
                incrementJankyFrames(
                        TimeStats::JankyFramesInfo{refreshRate, renderRate, sUidOne, sLayerNameOne,
                                                   JankType::Unknown | JankType::AppDeadlineMissed,
                                                   -1, -1, 25}));
                                                   0, 0, 25}));
    auto presentFence1 = fenceFactory.createFenceTimeForTest(Fence::NO_FENCE);
    int64_t surfaceFrameToken1 = mTokenManager->generateTokenForPredictions({10, 20, 60});
    int64_t sfToken1 = mTokenManager->generateTokenForPredictions({82, 90, 90});