summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2014-04-07 16:58:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-07 16:58:48 +0000
commitfc9aeb859096cc02ec9241fad589d361cf9c3ddd (patch)
treeb41fd1b347cfb4633f2ffc8f19ca58e2cb113d92
parent2e1f4b5212ccc1b2091e44396e051f033929cee4 (diff)
parent4215f434187d518bf8c9807c9a18a7e0b617f7d2 (diff)
downloadframeworks_native-fc9aeb859096cc02ec9241fad589d361cf9c3ddd.zip
frameworks_native-fc9aeb859096cc02ec9241fad589d361cf9c3ddd.tar.gz
frameworks_native-fc9aeb859096cc02ec9241fad589d361cf9c3ddd.tar.bz2
am 4215f434: am 6dbcebd0: Merge "Always release a buffer" into klp-modular-dev
* commit '4215f434187d518bf8c9807c9a18a7e0b617f7d2': Always release a buffer
-rw-r--r--libs/gui/GLConsumer.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 7ee3081..3215b2f 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -350,20 +350,24 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferQueue::BufferItem& item)
{
status_t err = NO_ERROR;
+ int buf = item.mBuf;
+
if (!mAttached) {
ST_LOGE("updateAndRelease: GLConsumer is not attached to an OpenGL "
"ES context");
+ releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
+ mEglDisplay, EGL_NO_SYNC_KHR);
return INVALID_OPERATION;
}
// Confirm state.
err = checkAndUpdateEglStateLocked();
if (err != NO_ERROR) {
+ releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
+ mEglDisplay, EGL_NO_SYNC_KHR);
return err;
}
- int buf = item.mBuf;
-
// If the mEglSlot entry is empty, create an EGLImage for the gralloc
// buffer currently in the slot in ConsumerBase.
//
@@ -377,6 +381,12 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferQueue::BufferItem& item)
if (image == EGL_NO_IMAGE_KHR) {
ST_LOGW("updateAndRelease: unable to createImage on display=%p slot=%d",
mEglDisplay, buf);
+ const sp<GraphicBuffer>& gb = mSlots[buf].mGraphicBuffer;
+ ST_LOGW("buffer size=%ux%u st=%u usage=0x%x fmt=%d",
+ gb->getWidth(), gb->getHeight(), gb->getStride(),
+ gb->getUsage(), gb->getPixelFormat());
+ releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
+ mEglDisplay, EGL_NO_SYNC_KHR);
return UNKNOWN_ERROR;
}
mEglSlots[buf].mEglImage = image;