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

Commit 3dfefdc9 authored by Vishnu Nair's avatar Vishnu Nair Committed by Automerger Merge Worker
Browse files

Merge "Check for buffer changes explicitly instead of relying on acquire fence...

Merge "Check for buffer changes explicitly instead of relying on acquire fence changes" into sc-dev am: 1592f2b1

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

Change-Id: I4282194ab812eb268e53473c11124a4001dfe99a
parents 07c5913a 1592f2b1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -564,6 +564,10 @@ void layer_state_t::merge(const layer_state_t& other) {
    }
}

bool layer_state_t::hasBufferChanges() const {
    return (what & layer_state_t::eBufferChanged) || (what & layer_state_t::eCachedBufferChanged);
}

status_t layer_state_t::matrix22_t::write(Parcel& output) const {
    SAFE_PARCEL(output.writeFloat, dsdx);
    SAFE_PARCEL(output.writeFloat, dtdx);
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ struct layer_state_t {
    void merge(const layer_state_t& other);
    status_t write(Parcel& output) const;
    status_t read(const Parcel& input);
    bool hasBufferChanges() const;

    struct matrix22_t {
        float dsdx{0};
+3 −3
Original line number Diff line number Diff line
@@ -3457,7 +3457,7 @@ bool SurfaceFlinger::transactionIsReadyToBeApplied(
        sp<Layer> layer = nullptr;
        if (s.surface) {
            layer = fromHandleLocked(s.surface).promote();
        } else if (acquireFenceChanged) {
        } else if (s.hasBufferChanges()) {
            ALOGW("Transaction with buffer, but no Layer?");
            continue;
        }
@@ -3467,7 +3467,7 @@ bool SurfaceFlinger::transactionIsReadyToBeApplied(

        ATRACE_NAME(layer->getName().c_str());

        if (acquireFenceChanged) {
        if (s.hasBufferChanges()) {
            // If backpressure is enabled and we already have a buffer to commit, keep the
            // transaction in the queue.
            const bool hasPendingBuffer = pendingBuffers.find(s.surface) != pendingBuffers.end();
@@ -3550,7 +3550,7 @@ status_t SurfaceFlinger::setTransactionState(

    // Check for incoming buffer updates and increment the pending buffer count.
    for (const auto& state : states) {
        if ((state.state.what & layer_state_t::eAcquireFenceChanged) && (state.state.surface)) {
        if (state.state.hasBufferChanges() && (state.state.surface)) {
            mBufferCountTracker.increment(state.state.surface->localBinder());
        }
    }