From 0a2352aee52785ba8772f61005a814182e07725a Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Thu, 23 Aug 2012 08:41:05 -0700 Subject: [PATCH] hwc: Unlock prev. buffers in N+1th draw round. Unlock previously locked overlay buferrs in N+1th draw round, rather than N+2th. This is now possible because of wait for PAN. Provides an opportunity to improve genlock behavior and makes it more ICS like. (cherry picked from commit b3a4cd7944397565388b4e940fb41d2af8882687) Change-Id: I48f937b77d59b31f3bf04c5a2eb35500bd5d76d6 --- libhwcomposer/hwc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index c6f4faf..2d25c3a 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -83,9 +83,6 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) if(ctx->mExtDisplay->getExternalDisplay()) ovutils::setExtType(ctx->mExtDisplay->getExternalDisplay()); - //Prepare is called after a vsync, so unlock previous buffers here. - ctx->qbuf->unlockAllPrevious(); - if (LIKELY(list)) { //reset for this draw round VideoOverlay::reset(); @@ -194,6 +191,7 @@ static int hwc_set(hwc_composer_device_t *dev, if(!ctx->overlayInUse) ctx->mOverlay->setState(ovutils::OV_CLOSED); + ctx->qbuf->unlockAllPrevious(); return ret; }