summaryrefslogtreecommitdiffstats
path: root/libs/gui/Surface.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-08-01 15:48:40 -0700
committerMathias Agopian <mathias@google.com>2013-08-01 15:48:40 -0700
commitba93b3f8e403636b614a4a379f9421bc70dca84f (patch)
tree4df2e51cd7003803a8f7d75f1fa5896493c9da4a /libs/gui/Surface.cpp
parent87f9b877964b7d7db9b59ba45b73b4b1a779ecf8 (diff)
downloadframeworks_native-ba93b3f8e403636b614a4a379f9421bc70dca84f.zip
frameworks_native-ba93b3f8e403636b614a4a379f9421bc70dca84f.tar.gz
frameworks_native-ba93b3f8e403636b614a4a379f9421bc70dca84f.tar.bz2
log an error when dequeueBuffer gets a NULL Fence
Bug: 9858745 Change-Id: If35d6a7d770bf0a42d55bc55880a9ddb721fcfd0
Diffstat (limited to 'libs/gui/Surface.cpp')
-rw-r--r--libs/gui/Surface.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 998ea8a..fdb7d3d 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -175,8 +175,7 @@ int Surface::setSwapInterval(int interval) {
return NO_ERROR;
}
-int Surface::dequeueBuffer(android_native_buffer_t** buffer,
- int* fenceFd) {
+int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
ATRACE_CALL();
ALOGV("Surface::dequeueBuffer");
Mutex::Autolock lock(mMutex);
@@ -193,6 +192,10 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer,
return result;
}
sp<GraphicBuffer>& gbuf(mSlots[buf].buffer);
+
+ // this should never happen
+ ALOGE_IF(fence == NULL, "Surface::dequeueBuffer: received null Fence! buf=%d", buf);
+
if (result & IGraphicBufferProducer::RELEASE_ALL_BUFFERS) {
freeAllBuffers();
}
@@ -200,8 +203,7 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer,
if ((result & IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION) || gbuf == 0) {
result = mGraphicBufferProducer->requestBuffer(buf, &gbuf);
if (result != NO_ERROR) {
- ALOGE("dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: %d",
- result);
+ ALOGE("dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: %d", result);
return result;
}
}