summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-06-28 14:27:53 -0700
committerJesse Hall <jessehall@google.com>2012-06-30 21:38:51 -0700
commitb42b1ac1587aebda5e2f334d95b620271fafba4e (patch)
tree5852fb46f80587194d109b3baa04a91af443181b /services/surfaceflinger
parentc777b0b3b9b0ea5d8e378fccde6935765e28e329 (diff)
downloadframeworks_native-b42b1ac1587aebda5e2f334d95b620271fafba4e.zip
frameworks_native-b42b1ac1587aebda5e2f334d95b620271fafba4e.tar.gz
frameworks_native-b42b1ac1587aebda5e2f334d95b620271fafba4e.tar.bz2
Return fence from acquireBuffer
Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
index 02d2b10..6cfb190 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
@@ -106,6 +106,16 @@ void FramebufferSurface::onFirstRef() {
if (item.mGraphicBuffer != 0) {
self->mBuffers[item.mBuf] = item.mGraphicBuffer;
}
+ if (item.mFence.get()) {
+ err = item.mFence->wait(Fence::TIMEOUT_NEVER);
+ if (err) {
+ ALOGE("failed waiting for buffer's fence: %d", err);
+ self->mBufferQueue->releaseBuffer(item.mBuf,
+ EGL_NO_DISPLAY, EGL_NO_SYNC_KHR,
+ item.mFence);
+ return;
+ }
+ }
self->fbDev->post(self->fbDev, self->mBuffers[item.mBuf]->handle);
if (self->mCurrentBufferIndex >= 0) {
self->mBufferQueue->releaseBuffer(self->mCurrentBufferIndex,