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

Commit 5018288a authored by Dan Stoza's avatar Dan Stoza
Browse files

HWC2: Backpressure on transactions as well

Modifies the backpressure detection to skip transactions as well as
buffer updates.

Bug: 29413700
Change-Id: I97cda920e7fc1cd7151f0a4df1b00f96b84f4145
parent 41a3853c
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -913,6 +913,15 @@ void SurfaceFlinger::onMessageReceived(int32_t what) {
    ATRACE_CALL();
    switch (what) {
        case MessageQueue::INVALIDATE: {
            bool frameMissed = !mHadClientComposition &&
                    mPreviousPresentFence != Fence::NO_FENCE &&
                    mPreviousPresentFence->getSignalTime() == INT64_MAX;
            ATRACE_INT("FrameMissed", static_cast<int>(frameMissed));
            if (frameMissed) {
                signalLayerUpdate();
                break;
            }

            bool refreshNeeded = handleMessageTransaction();
            refreshNeeded |= handleMessageInvalidate();
            refreshNeeded |= mRepaintEverything;
@@ -942,14 +951,6 @@ bool SurfaceFlinger::handleMessageTransaction() {

bool SurfaceFlinger::handleMessageInvalidate() {
    ATRACE_CALL();
    bool frameMissed = !mHadClientComposition &&
            mPreviousPresentFence != Fence::NO_FENCE &&
            mPreviousPresentFence->getSignalTime() == INT64_MAX;
    ATRACE_INT("FrameMissed", static_cast<int>(frameMissed));
    if (frameMissed) {
        signalLayerUpdate();
        return false;
    }
    return handlePageFlip();
}