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

Commit f0c12503 authored by Yiwei Zhang's avatar Yiwei Zhang
Browse files

systrace: forbid FrameEventHistory from stealing the fence

Previously if EGL_TIMESTAMPS_ANDROID is used, FrameEventHistory will
steal the ownership of the acquire fence after queueBuffer. The
FenceMonitor for tracing the GPU completion fence will crash in that
case.

Bug: 127781085
Test: install bouncyball.apk and do systrace without crashing
Change-Id: I6679324eb2a3b9366c957db4e9a14da5a87e98e8
parent a2b39439
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -816,7 +816,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
        // The consumer doesn't send it back to prevent us from having two
        // file descriptors of the same fence.
        mFrameEventHistory->updateAcquireFence(mNextFrameNumber,
                std::make_shared<FenceTime>(std::move(fence)));
                std::make_shared<FenceTime>(fence));

        // Cache timestamps of signaled fences so we can close their file
        // descriptors.