framebuffer: unlock previous buffer after current buffer submitted

Change-Id: Ib2a44966d1484b4f4e2239d8a706dc55b5beaaeb
This commit is contained in:
Harshad Bhutada 2012-08-03 09:57:22 +05:30 committed by Nikez
parent 85ff2df3a5
commit 2a44da70d2

View File

@ -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;
}