summaryrefslogtreecommitdiffstats
path: root/libs/ui/GraphicBufferAllocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ui/GraphicBufferAllocator.cpp')
-rw-r--r--libs/ui/GraphicBufferAllocator.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index 2ea5696..9ad314a 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -192,6 +192,17 @@ sp<BufferLiberatorThread> BufferLiberatorThread::sThread;
status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
int usage, buffer_handle_t* handle, int32_t* stride)
{
+#ifdef QCOM_BSP
+ status_t err = alloc(w, h, format, usage, handle, stride, 0);
+ return err;
+}
+
+status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h,
+ PixelFormat format, int usage,
+ buffer_handle_t* handle,
+ int32_t* stride, uint32_t bufferSize)
+{
+#endif
ATRACE_CALL();
// make sure to not allocate a N x 0 or 0 x N buffer, since this is
// allowed from an API stand-point allocate a 1x1 buffer instead.
@@ -216,7 +227,13 @@ status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat forma
// by the android.opengl.cts.GLSurfaceViewTest CTS test.
BufferLiberatorThread::maybeWaitForLiberation();
- err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
+#ifdef QCOM_BSP
+ if (bufferSize)
+ err = mAllocDev->allocSize(mAllocDev, w, h,
+ format, usage, handle, stride, bufferSize);
+ else
+#endif
+ err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
if (err != NO_ERROR) {
ALOGW("WOW! gralloc alloc failed, waiting for pending frees!");
@@ -224,8 +241,13 @@ status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat forma
err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
}
+#ifdef QCOM_BSP
+ ALOGW_IF(err, "alloc(%u, %u, %d, %08x, %d ...) failed %d (%s)",
+ w, h, format, usage, bufferSize, err, strerror(-err));
+#else
ALOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)",
w, h, format, usage, err, strerror(-err));
+#endif
if (err == NO_ERROR) {
Mutex::Autolock _l(sLock);