From 2a44da70d236f8bf29ef28934878d9eb2a6a0ba0 Mon Sep 17 00:00:00 2001 From: Harshad Bhutada Date: Fri, 3 Aug 2012 09:57:22 +0530 Subject: [PATCH] framebuffer: unlock previous buffer after current buffer submitted Change-Id: Ib2a44966d1484b4f4e2239d8a706dc55b5beaaeb --- libgralloc/framebuffer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index 9d974b4..b257521 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -115,11 +115,6 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer) if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) { genlock_lock_buffer(hnd, GENLOCK_READ_LOCK, GENLOCK_MAX_TIMEOUT); - if (m->currentBuffer) { - genlock_unlock_buffer(m->currentBuffer); - m->currentBuffer = 0; - } - const size_t offset = hnd->base - m->framebuffer->base; // frame ready to be posted, signal so that hwc can update External // display @@ -136,6 +131,12 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer) genlock_unlock_buffer(hnd); return -errno; } + + if (m->currentBuffer) { + genlock_unlock_buffer(m->currentBuffer); + m->currentBuffer = 0; + } + CALC_FPS(); m->currentBuffer = hnd; }