diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index 4779a96..e6750be 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -180,7 +180,7 @@ static int hwc_set(hwc_composer_device_t *dev, ctx->mExtDisplay->commit(); } else { ctx->mOverlay->setState(ovutils::OV_CLOSED); - ctx->qbuf->unlockAllPrevious(); + ctx->qbuf->unlockAll(); } if(!ctx->overlayInUse) diff --git a/libhwcomposer/hwc_qbuf.h b/libhwcomposer/hwc_qbuf.h index 6d75964..0e639cf 100644 --- a/libhwcomposer/hwc_qbuf.h +++ b/libhwcomposer/hwc_qbuf.h @@ -33,7 +33,10 @@ class QueuedBufferStore { } ~QueuedBufferStore() {} void lockAndAdd(private_handle_t*); + //Unlocks only previous and makes the current as previous void unlockAllPrevious(); + //Unlocks previous as well as current, useful in suspend case + void unlockAll(); private: QueuedBufferStore& operator=(const QueuedBufferStore&); @@ -70,6 +73,13 @@ inline void QueuedBufferStore::unlockAllPrevious() { clearCurrent(); } +inline void QueuedBufferStore::unlockAll() { + //Unlocks prev and moves current to prev + unlockAllPrevious(); + //Unlocks the newly populated prev if any. + unlockAllPrevious(); +} + //Clear currentbuf store inline void QueuedBufferStore::clearCurrent() { for(int i = 0; i < MAX_QUEUED_BUFS; i++)