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

Commit af54781e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Implement timeout for barriers in SF" into main

parents 17637c71 ecd63753
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width,
    const bool surfaceControlChanged = !SurfaceControl::isSameSurface(mSurfaceControl, surface);
    if (surfaceControlChanged && mSurfaceControl != nullptr) {
        BQA_LOGD("Updating SurfaceControl without recreating BBQ");
        mSetBufferBarrier = false;
    }

    // Always update the native object even though they might have the same layer handle, so we can
@@ -708,8 +709,11 @@ status_t BLASTBufferQueue::acquireNextBufferLocked(
                            mName.c_str(), status);
        mAppliedLastTransaction = true;
        mLastAppliedFrameNumber = bufferItem.mFrameNumber;
        mSetBufferBarrier = true;
    } else {
        if (mSetBufferBarrier) {
          t->setBufferHasBarrier(mSurfaceControl, mLastAppliedFrameNumber);
        }
        mAppliedLastTransaction = false;
    }

+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ private:
    ui::Size mSize GUARDED_BY(mMutex);
    ui::Size mRequestedSize GUARDED_BY(mMutex);
    int32_t mFormat GUARDED_BY(mMutex);
    bool mSetBufferBarrier GUARDED_BY(mMutex) = false;

    // Keep a copy of the current picture profile handle, so it can be moved to a new
    // SurfaceControl when BBQ migrates via ::update.
+12 −2
Original line number Diff line number Diff line
@@ -4946,11 +4946,21 @@ TransactionHandler::TransactionReadiness SurfaceFlinger::transactionReadyBufferC
                                           " < %" PRId64,
                                           layer->name.c_str(), layer->barrierFrameNumber,
                                           s.bufferData->barrierFrameNumber);
                            bool timeout = std::chrono::nanoseconds(flushState.queueProcessTime -
                                                                    transaction.postTime) >
                                    std::chrono::seconds(4);
                            if (timeout) {
                                TransactionTraceWriter::getInstance()
                                .invoke("IgnoreBarrierDueToTimeout",
                                        /* overwrite= */ false);
                                SFTRACE_FORMAT("IgnoreBarrierDueToTimeout %s", layer->name.c_str());
                            } else {
                                ready = TransactionReadiness::NotReadyBarrier;
                                return TraverseBuffersReturnValues::STOP_TRAVERSAL;
                            }
                        }
                    }
                }

                // If backpressure is enabled and we already have a buffer to commit, keep
                // the transaction in the queue.
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ perfetto::protos::TransactionState TransactionProtoParser::toProto(
    for (auto& mergedTransactionId : t.mergedTransactionIds) {
        proto.mutable_merged_transaction_ids()->Add(mergedTransactionId);
    }
    proto.set_apply_token(reinterpret_cast<uint64_t>(t.applyToken.get()));

    return proto;
}