diff options
author | Saurabh Shah <saurshah@codeaurora.org> | 2012-08-16 10:19:07 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2012-08-20 16:38:16 -0700 |
commit | 83523d815791832a90cd689d1796522589ade7fe (patch) | |
tree | 8d436862d21ddeaa2001814ffe2b434e3c4aaf2b | |
parent | b45b881fe69717e010ea5ea3f5965e084f31573a (diff) | |
download | android_hardware_qcom_display-83523d815791832a90cd689d1796522589ade7fe.tar.gz android_hardware_qcom_display-83523d815791832a90cd689d1796522589ade7fe.tar.bz2 android_hardware_qcom_display-83523d815791832a90cd689d1796522589ade7fe.zip |
hwc: qbuf: Add API to unlock all
Add API to unlock all current and previous buffers.
This is essential in suspend cases.
Change-Id: I61c26db2e0e2b3e5e7f526a62a56424a8632f1d8
-rw-r--r-- | libhwcomposer/hwc.cpp | 2 | ||||
-rw-r--r-- | libhwcomposer/hwc_qbuf.h | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index 05bb61d8e..00635c592 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -195,7 +195,7 @@ static int hwc_set(hwc_composer_device_1 *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 6d75964b6..0e639cf81 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++) |