Clears the frame number of a slot when it is freed, since it is used
to determine if a released buffer is stale.
Bug:
20445852
Change-Id: I02415e7b25a1eafe7414d6eb1cedf62ac5543cd9
(cherry picked from commit
52937cd9a543fe66696c38ae50ec141aa70ec1e4)
if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS ||
releaseFence == NULL) {
+ BQ_LOGE("releaseBuffer: slot %d out of range or fence %p NULL", slot,
+ releaseFence.get());
return BAD_VALUE;
}
mSlots[slot].mNeedsCleanupOnRelease = false;
return STALE_BUFFER_SLOT;
} else {
- BQ_LOGV("releaseBuffer: attempted to release buffer slot %d "
+ BQ_LOGE("releaseBuffer: attempted to release buffer slot %d "
"but its state was %d", slot, mSlots[slot].mBufferState);
return BAD_VALUE;
}
}
mSlots[slot].mBufferState = BufferSlot::FREE;
mSlots[slot].mAcquireCalled = false;
+ mSlots[slot].mFrameNumber = 0;
// Destroy fence as BufferQueue now takes ownership
if (mSlots[slot].mEglFence != EGL_NO_SYNC_KHR) {