summaryrefslogtreecommitdiff
path: root/libs/gui/ConsumerBase.cpp
diff options
context:
space:
mode:
author Jim Shargo <jshargo@google.com> 2024-11-15 01:06:41 +0000
committer Jim Shargo <jshargo@google.com> 2025-01-09 22:59:53 +0000
commitdefc49ed65bea30dde50a358f85af13ce5ababbe (patch)
tree9b8489406c053a486ba7e150044ab63ca20942ad /libs/gui/ConsumerBase.cpp
parent95c4948d177ab27c6aa1cba7319d2d8ddf3cf64d (diff)
bufferqueues: Entirely remove support for passing GL fences into BQs
There are very few if any real clients (i.e. non goldfish) that use these fences with bufferqueues. We can simplify the overall API by just removing it and doing explicit sync (which is what would happen anyway) where we would have passed them into the bufferqueue. Bug: 339705065 Flag: com.android.graphics.libgui.flags.bq_gl_fence_cleanup Test: old tests Change-Id: I1f3973c78aafe278708f203ef46a2b91b138eba7
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
-rw-r--r--libs/gui/ConsumerBase.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp
index 504509dbec..3ad0e529a5 100644
--- a/libs/gui/ConsumerBase.cpp
+++ b/libs/gui/ConsumerBase.cpp
@@ -656,9 +656,13 @@ status_t ConsumerBase::addReleaseFenceLocked(int slot,
return OK;
}
+#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_GL_FENCE_CLEANUP)
+status_t ConsumerBase::releaseBufferLocked(int slot, const sp<GraphicBuffer> graphicBuffer) {
+#else
status_t ConsumerBase::releaseBufferLocked(
int slot, const sp<GraphicBuffer> graphicBuffer,
EGLDisplay display, EGLSyncKHR eglFence) {
+#endif
if (mAbandoned) {
CB_LOGE("releaseBufferLocked: ConsumerBase is abandoned!");
return NO_INIT;
@@ -675,8 +679,12 @@ status_t ConsumerBase::releaseBufferLocked(
CB_LOGV("releaseBufferLocked: slot=%d/%" PRIu64,
slot, mSlots[slot].mFrameNumber);
+#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_GL_FENCE_CLEANUP)
+ status_t err = mConsumer->releaseBuffer(slot, mSlots[slot].mFrameNumber, mSlots[slot].mFence);
+#else
status_t err = mConsumer->releaseBuffer(slot, mSlots[slot].mFrameNumber,
display, eglFence, mSlots[slot].mFence);
+#endif
if (err == IGraphicBufferConsumer::STALE_BUFFER_SLOT) {
freeBufferLocked(slot);
}