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

Commit 3ca95a0e authored by Marissa Wall's avatar Marissa Wall Committed by Gaurav Sarode
Browse files

DO NOT MERGE: SF: fix SurfaceFlinger freeze

When BufferQueueLayer errors in onFrameAvailable and
onFrameReplaced, it infinitely loops. This patch adds
a break when we get into the bad state.

Bug: 147476322
Test: verified by vendor that this fixes their bug
      and SurfaceFlinger_test

Change-Id: Ida063470edc7e688d106ec9fbac3c81bc5e00189
(cherry picked from commit 6a3e6717)
parent fe62271b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) {
            status_t result = mQueueItemCondition.waitRelative(mQueueItemLock, ms2ns(500));
            if (result != NO_ERROR) {
                ALOGE("[%s] Timed out waiting on callback", mName.string());
                break;
            }
        }

@@ -495,6 +496,7 @@ void BufferQueueLayer::onFrameReplaced(const BufferItem& item) {
            status_t result = mQueueItemCondition.waitRelative(mQueueItemLock, ms2ns(500));
            if (result != NO_ERROR) {
                ALOGE("[%s] Timed out waiting on callback", mName.string());
                break;
            }
        }