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

Commit dee22320 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: fix frame timeline timestamp

Fix a bug with setting the timestamp on a packet due to operator
precedence where unary plus takes precedence on the ternary operation

Fixes: 185346474
Test: Collect perfetto traces and observe timeline slices
Change-Id: If1a8f13e7a77dabf0c510181e5aa27aaf7cf0f56
parent 57f8e18f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -669,12 +669,12 @@ void SurfaceFrame::traceActuals(int64_t displayFrameToken, nsecs_t monoBootOffse
            // frame in the trace.
            nsecs_t endTime =
                    (mPresentState == PresentState::Dropped ? mDropTime : mActuals.endTime);
            packet->set_timestamp(static_cast<uint64_t>(endTime - kPredictionExpiredStartTimeDelta +
                                                        monoBootOffset));
            const auto timestamp = endTime - kPredictionExpiredStartTimeDelta;
            packet->set_timestamp(static_cast<uint64_t>(timestamp + monoBootOffset));
        } else {
            packet->set_timestamp(static_cast<uint64_t>(monoBootOffset + mActuals.startTime == 0
                                                                ? mPredictions.startTime
                                                                : mActuals.startTime));
            const auto timestamp =
                    mActuals.startTime == 0 ? mPredictions.startTime : mActuals.startTime;
            packet->set_timestamp(static_cast<uint64_t>(timestamp + monoBootOffset));
        }

        auto* event = packet->set_frame_timeline_event();