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

Commit d10323e0 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Automerger Merge Worker
Browse files

Merge "Use SwapBuffersCompleted as frame end time" into sc-dev am: 19cefb4d am: ff7d4668

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14500981

Change-Id: I75aeca1145284be8358a0e203d85b544fe81967b
parents 90e5747e ff7d4668
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -677,20 +677,8 @@ void CanvasContext::onSurfaceStatsAvailable(void* context, ASurfaceControl* cont
    }

    if (frameInfo != nullptr) {
        if (gpuCompleteTime == -1) {
            gpuCompleteTime = frameInfo->get(FrameInfoIndex::SwapBuffersCompleted);
        }
        if (gpuCompleteTime < frameInfo->get(FrameInfoIndex::IssueDrawCommandsStart)) {
            // On Vulkan the GPU commands are flushed to the GPU during IssueDrawCommands rather
            // than after SwapBuffers. So if the GPU signals before issue draw commands, then
            // something probably went wrong. Anything after that could just be expected
            // pipeline differences
            ALOGW("Impossible GPU complete time issueCommandsStart=%" PRIi64
                  " gpuComplete=%" PRIi64,
                  frameInfo->get(FrameInfoIndex::IssueDrawCommandsStart), gpuCompleteTime);
            gpuCompleteTime = frameInfo->get(FrameInfoIndex::SwapBuffersCompleted);
        }
        frameInfo->set(FrameInfoIndex::FrameCompleted) = gpuCompleteTime;
        frameInfo->set(FrameInfoIndex::FrameCompleted) = std::max(gpuCompleteTime,
                frameInfo->get(FrameInfoIndex::SwapBuffersCompleted));
        frameInfo->set(FrameInfoIndex::GpuCompleted) = gpuCompleteTime;
        instance->mJankTracker.finishFrame(*frameInfo, instance->mFrameMetricsReporter);
    }