diff options
| author | 2025-03-13 09:49:38 -0700 | |
|---|---|---|
| committer | 2025-03-13 09:49:38 -0700 | |
| commit | 329c7f944e41f99950be0cea5d6a3e67ef358669 (patch) | |
| tree | 0cef70b9bc869d499d3eb69258fd49ffc4b902df /libs/gui/BufferQueueProducer.cpp | |
| parent | 578ac8e947c1a88913e96c7e57c4416796c7a9e2 (diff) | |
| parent | a62f051cfde464c9080e8c6b5d3a63f317a22e30 (diff) | |
Merge "BufferQueues: Always respect setMaxDequeuedBufferCount" into main
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
| -rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index 5961b41478..bcf61e45de 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -364,8 +364,10 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(FreeSlotCaller caller, // Producers are not allowed to dequeue more than // mMaxDequeuedBufferCount buffers. // This check is only done if a buffer has already been queued - if (mCore->mBufferHasBeenQueued && - dequeuedCount >= mCore->mMaxDequeuedBufferCount) { + using namespace com::android::graphics::libgui::flags; + bool flagGatedBufferHasBeenQueued = + bq_always_use_max_dequeued_buffer_count() || mCore->mBufferHasBeenQueued; + if (flagGatedBufferHasBeenQueued && dequeuedCount >= mCore->mMaxDequeuedBufferCount) { // Supress error logs when timeout is non-negative. if (mDequeueTimeout < 0) { BQ_LOGE("%s: attempting to exceed the max dequeued buffer " |