From eb489f69db265f6cb1aab63130750d0c12c99d94 Mon Sep 17 00:00:00 2001 From: liulijun Date: Mon, 17 Oct 2022 22:02:14 +0800 Subject: Add producerId so we know when the BBQ producer has been changed. If BBQ producer changes but the SC remains the same, the frame numbers for the SC will get reset. This causes issues if there's a barrier layer set because the barrier is waiting for a particular frame number before applying the transaction. Since the frame numbers have been reset, the barrier will be greater than the incoming frame numbers. The change adds a producerId to the buffer being sent so it can check if the producerId is older than what's currently set on the Layer. If there's a barriers set from the old producer, the buffer can be released and not applied and will stop SF from waiting indefinitely. Bug: 251971691 Test: Builds, hard to repro Signed-off-by: Liu Lijun Change-Id: If37171de4693a73f36f8de43e29c129b352eb55f --- libs/gui/LayerState.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 7772a65dae..a6276e500c 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -984,6 +984,7 @@ status_t BufferData::writeToParcel(Parcel* output) const { SAFE_PARCEL(output->writeUint64, cachedBuffer.id); SAFE_PARCEL(output->writeBool, hasBarrier); SAFE_PARCEL(output->writeUint64, barrierFrameNumber); + SAFE_PARCEL(output->writeUint32, producerId); return NO_ERROR; } @@ -1022,6 +1023,7 @@ status_t BufferData::readFromParcel(const Parcel* input) { SAFE_PARCEL(input->readBool, &hasBarrier); SAFE_PARCEL(input->readUint64, &barrierFrameNumber); + SAFE_PARCEL(input->readUint32, &producerId); return NO_ERROR; } -- cgit v1.2.3-59-g8ed1b