summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2014-10-18 21:47:04 -0700
committerJesse Hall <jessehall@google.com>2014-10-19 04:57:10 +0000
commit5b0cbcf9464dbcda9d19ae978911222806ec8bdc (patch)
tree52d2f18eea7e28778eeb5aa66f572f67d292d222
parent60fd3feecab4336d964ca8e31c7c3220e1afb558 (diff)
downloadframeworks_native-5b0cbcf9464dbcda9d19ae978911222806ec8bdc.zip
frameworks_native-5b0cbcf9464dbcda9d19ae978911222806ec8bdc.tar.gz
frameworks_native-5b0cbcf9464dbcda9d19ae978911222806ec8bdc.tar.bz2
bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)
On one device there is a bug, not yet root-caused, that causes fence fds to not make it across binder from producer to consumer in the IGraphicBufferProducer::queueBuffer call. Rather than returning an error, which the producer typically treats as a fatal error, this change allows the buffer to be queued with no fence. This avoids an application crash at the risk of (likely single-frame) visible corruption. Bug: 17946343 Change-Id: I9ca89f94098c455e1e90f5f58d5336c936b04a9c
-rw-r--r--libs/gui/BufferQueueProducer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index a53775f..d2fd3b0 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -522,7 +522,12 @@ status_t BufferQueueProducer::queueBuffer(int slot,
if (fence == NULL) {
BQ_LOGE("queueBuffer: fence is NULL");
- return BAD_VALUE;
+ // Temporary workaround for b/17946343: soldier-on instead of returning an error. This
+ // prevents the client from dying, at the risk of visible corruption due to hwcomposer
+ // reading the buffer before the producer is done rendering it. Unless the buffer is the
+ // last frame of an animation, the corruption will be transient.
+ fence = Fence::NO_FENCE;
+ // return BAD_VALUE;
}
switch (scalingMode) {