summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2014-05-09 21:39:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-09 21:39:07 +0000
commita9d49f99e69d8fc0e60b492b131322c96f47a232 (patch)
treef317098bde8b4c9ac66f77499f8b74964373404e /libs/ui
parentf60564a13e917877c76c99294194a621d872076b (diff)
parent53ec72523a4083b88eaa13e2e720976523a7ebf8 (diff)
downloadframeworks_native-a9d49f99e69d8fc0e60b492b131322c96f47a232.zip
frameworks_native-a9d49f99e69d8fc0e60b492b131322c96f47a232.tar.gz
frameworks_native-a9d49f99e69d8fc0e60b492b131322c96f47a232.tar.bz2
Merge "Revert "Use asynchronous lock/unlock API""
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/GraphicBuffer.cpp46
-rw-r--r--libs/ui/GraphicBufferMapper.cpp62
2 files changed, 0 insertions, 108 deletions
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index 708888e..c4e4efa 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -200,52 +200,6 @@ status_t GraphicBuffer::unlock()
return res;
}
-status_t GraphicBuffer::lockAsync(uint32_t usage, void** vaddr, int fenceFd)
-{
- const Rect lockBounds(width, height);
- status_t res = lockAsync(usage, lockBounds, vaddr, fenceFd);
- return res;
-}
-
-status_t GraphicBuffer::lockAsync(uint32_t usage, const Rect& rect, void** vaddr, int fenceFd)
-{
- if (rect.left < 0 || rect.right > this->width ||
- rect.top < 0 || rect.bottom > this->height) {
- ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
- rect.left, rect.top, rect.right, rect.bottom,
- this->width, this->height);
- return BAD_VALUE;
- }
- status_t res = getBufferMapper().lockAsync(handle, usage, rect, vaddr, fenceFd);
- return res;
-}
-
-status_t GraphicBuffer::lockAsyncYCbCr(uint32_t usage, android_ycbcr *ycbcr, int fenceFd)
-{
- const Rect lockBounds(width, height);
- status_t res = lockAsyncYCbCr(usage, lockBounds, ycbcr, fenceFd);
- return res;
-}
-
-status_t GraphicBuffer::lockAsyncYCbCr(uint32_t usage, const Rect& rect, android_ycbcr *ycbcr, int fenceFd)
-{
- if (rect.left < 0 || rect.right > this->width ||
- rect.top < 0 || rect.bottom > this->height) {
- ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
- rect.left, rect.top, rect.right, rect.bottom,
- this->width, this->height);
- return BAD_VALUE;
- }
- status_t res = getBufferMapper().lockAsyncYCbCr(handle, usage, rect, ycbcr, fenceFd);
- return res;
-}
-
-status_t GraphicBuffer::unlockAsync(int *fenceFd)
-{
- status_t res = getBufferMapper().unlockAsync(handle, fenceFd);
- return res;
-}
-
size_t GraphicBuffer::getFlattenedSize() const {
return (8 + (handle ? handle->numInts : 0))*sizeof(int);
}
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index 320b6c0..a4cfce2 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -20,8 +20,6 @@
#include <stdint.h>
#include <errno.h>
-#include <sync/sync.h>
-
#include <utils/Errors.h>
#include <utils/Log.h>
#include <utils/Trace.h>
@@ -111,65 +109,5 @@ status_t GraphicBufferMapper::unlock(buffer_handle_t handle)
return err;
}
-status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle,
- int usage, const Rect& bounds, void** vaddr, int fenceFd)
-{
- ATRACE_CALL();
- status_t err;
-
- if (mAllocMod->common.module_api_version >= GRALLOC_MODULE_API_VERSION_0_3) {
- err = mAllocMod->lockAsync(mAllocMod, handle, usage,
- bounds.left, bounds.top, bounds.width(), bounds.height(),
- vaddr, fenceFd);
- } else {
- sync_wait(fenceFd, -1);
- close(fenceFd);
- err = mAllocMod->lock(mAllocMod, handle, usage,
- bounds.left, bounds.top, bounds.width(), bounds.height(),
- vaddr);
- }
-
- ALOGW_IF(err, "lockAsync(...) failed %d (%s)", err, strerror(-err));
- return err;
-}
-
-status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle,
- int usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd)
-{
- ATRACE_CALL();
- status_t err;
-
- if (mAllocMod->common.module_api_version >= GRALLOC_MODULE_API_VERSION_0_3) {
- err = mAllocMod->lockAsync_ycbcr(mAllocMod, handle, usage,
- bounds.left, bounds.top, bounds.width(), bounds.height(),
- ycbcr, fenceFd);
- } else {
- sync_wait(fenceFd, -1);
- close(fenceFd);
- err = mAllocMod->lock_ycbcr(mAllocMod, handle, usage,
- bounds.left, bounds.top, bounds.width(), bounds.height(),
- ycbcr);
- }
-
- ALOGW_IF(err, "lock(...) failed %d (%s)", err, strerror(-err));
- return err;
-}
-
-status_t GraphicBufferMapper::unlockAsync(buffer_handle_t handle, int *fenceFd)
-{
- ATRACE_CALL();
- status_t err;
-
- if (mAllocMod->common.module_api_version >= GRALLOC_MODULE_API_VERSION_0_3) {
- err = mAllocMod->unlockAsync(mAllocMod, handle, fenceFd);
- } else {
- *fenceFd = -1;
- err = mAllocMod->unlock(mAllocMod, handle);
- }
-
- ALOGW_IF(err, "unlockAsync(...) failed %d (%s)", err, strerror(-err));
- return err;
-}
-
// ---------------------------------------------------------------------------
}; // namespace android