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

Commit 63f8a793 authored by Sally Qi's avatar Sally Qi Committed by Android (Google) Code Review
Browse files

Merge "Fix flicker issue on external display."

parents e9dde7e6 4b9e7c46
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -137,7 +137,6 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
            sp<Fence> currentFence = future.get().value_or(Fence::NO_FENCE);
            sp<Fence> currentFence = future.get().value_or(Fence::NO_FENCE);
            if (prevFence == nullptr && currentFence->getStatus() != Fence::Status::Invalid) {
            if (prevFence == nullptr && currentFence->getStatus() != Fence::Status::Invalid) {
                prevFence = std::move(currentFence);
                prevFence = std::move(currentFence);
                handle->previousReleaseFence = prevFence;
            } else if (prevFence != nullptr) {
            } else if (prevFence != nullptr) {
                // If both fences are signaled or both are unsignaled, we need to merge
                // If both fences are signaled or both are unsignaled, we need to merge
                // them to get an accurate timestamp.
                // them to get an accurate timestamp.
@@ -147,8 +146,7 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
                    snprintf(fenceName, 32, "%.28s", handle->name.c_str());
                    snprintf(fenceName, 32, "%.28s", handle->name.c_str());
                    sp<Fence> mergedFence = Fence::merge(fenceName, prevFence, currentFence);
                    sp<Fence> mergedFence = Fence::merge(fenceName, prevFence, currentFence);
                    if (mergedFence->isValid()) {
                    if (mergedFence->isValid()) {
                        handle->previousReleaseFence = std::move(mergedFence);
                        prevFence = std::move(mergedFence);
                        prevFence = handle->previousReleaseFence;
                    }
                    }
                } else if (currentFence->getStatus() == Fence::Status::Unsignaled) {
                } else if (currentFence->getStatus() == Fence::Status::Unsignaled) {
                    // If one fence has signaled and the other hasn't, the unsignaled
                    // If one fence has signaled and the other hasn't, the unsignaled
@@ -158,10 +156,11 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
                    // by this point, they will have both signaled and only the timestamp
                    // by this point, they will have both signaled and only the timestamp
                    // will be slightly off; any dependencies after this point will
                    // will be slightly off; any dependencies after this point will
                    // already have been met.
                    // already have been met.
                    handle->previousReleaseFence = std::move(currentFence);
                    prevFence = std::move(currentFence);
                }
                }
            }
            }
        }
        }
        handle->previousReleaseFence = prevFence;
        handle->previousReleaseFences.clear();
        handle->previousReleaseFences.clear();


        FrameEventHistoryStats eventStats(handle->frameNumber,
        FrameEventHistoryStats eventStats(handle->frameNumber,