Skip to content

Commit

Permalink
libs/gui: Release acquired buffer when createImage fails
Browse files Browse the repository at this point in the history
When EGL fails to create an KHR image for an acquired buffer,
release the buffer before returning with error. This unblocks
the dequeue buffer call waiting and may succeed in the next queue.

CRs-Fixed: 624244

Change-Id: I674807f4bb1f1253cb787daaa5a7adf351caaae7
(cherry picked from commit 9e9b12d7f37a6120a705db56a4374e7141c79a41)
  • Loading branch information
Jeykumar Sankaran authored and hyperb1iss committed Apr 28, 2014
1 parent ccb5cd9 commit df3c8be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/gui/GLConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ 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);
releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
mEglDisplay, EGL_NO_SYNC_KHR);
return UNKNOWN_ERROR;
}
mEglSlots[buf].mEglImage = image;
Expand Down

0 comments on commit df3c8be

Please sign in to comment.