Loading cmds/flatland/GLHelper.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ * limitations under the License. */ #include <ui/Fence.h> #include <ui/DisplayInfo.h> #include <gui/SurfaceComposerClient.h> Loading libs/gui/BufferItemConsumer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ status_t BufferItemConsumer::acquireBuffer(BufferItem *item, bool waitForFence) return err; } if (waitForFence && item->mFence.get()) { if (waitForFence) { err = item->mFence->waitForever(1000, "BufferItemConsumer::acquireBuffer"); if (err != OK) { BI_LOGE("Failed to wait for fence of acquired buffer: %s (%d)", Loading libs/gui/BufferQueue.cpp +14 −9 Original line number Diff line number Diff line Loading @@ -372,8 +372,6 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, h = mDefaultHeight; } // buffer is now in DEQUEUED (but can also be current at the same time, // if we're in synchronous mode) mSlots[buf].mBufferState = BufferSlot::DEQUEUED; const sp<GraphicBuffer>& buffer(mSlots[buf].mGraphicBuffer); Loading @@ -387,7 +385,7 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, mSlots[buf].mGraphicBuffer = NULL; mSlots[buf].mRequestBufferCalled = false; mSlots[buf].mEglFence = EGL_NO_SYNC_KHR; mSlots[buf].mFence.clear(); mSlots[buf].mFence = Fence::NO_FENCE; mSlots[buf].mEglDisplay = EGL_NO_DISPLAY; returnFlags |= IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION; Loading @@ -397,7 +395,7 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, eglFence = mSlots[buf].mEglFence; outFence = mSlots[buf].mFence; mSlots[buf].mEglFence = EGL_NO_SYNC_KHR; mSlots[buf].mFence.clear(); mSlots[buf].mFence = Fence::NO_FENCE; } // end lock scope if (returnFlags & IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION) { Loading @@ -423,7 +421,6 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, } } if (eglFence != EGL_NO_SYNC_KHR) { EGLint result = eglClientWaitSyncKHR(dpy, eglFence, 0, 1000000000); // If something goes wrong, log the error, but return the buffer without Loading Loading @@ -488,6 +485,11 @@ status_t BufferQueue::queueBuffer(int buf, input.deflate(×tamp, &crop, &scalingMode, &transform, &fence); if (fence == NULL) { ST_LOGE("queueBuffer: fence is NULL"); return BAD_VALUE; } ST_LOGV("queueBuffer: slot=%d time=%#llx crop=[%d,%d,%d,%d] tr=%#x " "scale=%s", buf, timestamp, crop.left, crop.top, crop.right, crop.bottom, Loading Loading @@ -607,6 +609,9 @@ void BufferQueue::cancelBuffer(int buf, sp<Fence> fence) { ST_LOGE("cancelBuffer: slot %d is not owned by the client (state=%d)", buf, mSlots[buf].mBufferState); return; } else if (fence == NULL) { ST_LOGE("cancelBuffer: fence is NULL"); return; } mSlots[buf].mBufferState = BufferSlot::FREE; mSlots[buf].mFrameNumber = 0; Loading Loading @@ -785,7 +790,7 @@ void BufferQueue::freeBufferLocked(int slot) { eglDestroySyncKHR(mSlots[slot].mEglDisplay, mSlots[slot].mEglFence); mSlots[slot].mEglFence = EGL_NO_SYNC_KHR; } mSlots[slot].mFence.clear(); mSlots[slot].mFence = Fence::NO_FENCE; } void BufferQueue::freeAllBuffersLocked() { Loading Loading @@ -843,7 +848,7 @@ status_t BufferQueue::acquireBuffer(BufferItem *buffer) { mSlots[buf].mAcquireCalled = true; mSlots[buf].mNeedsCleanupOnRelease = false; mSlots[buf].mBufferState = BufferSlot::ACQUIRED; mSlots[buf].mFence.clear(); mSlots[buf].mFence = Fence::NO_FENCE; mQueue.erase(front); mDequeueCondition.broadcast(); Loading @@ -863,8 +868,8 @@ status_t BufferQueue::releaseBuffer(int buf, EGLDisplay display, Mutex::Autolock _l(mMutex); if (buf == INVALID_BUFFER_SLOT) { return -EINVAL; if (buf == INVALID_BUFFER_SLOT || fence == NULL) { return BAD_VALUE; } mSlots[buf].mEglDisplay = display; Loading libs/gui/ConsumerBase.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ ConsumerBase::~ConsumerBase() { void ConsumerBase::freeBufferLocked(int slotIndex) { CB_LOGV("freeBufferLocked: slotIndex=%d", slotIndex); mSlots[slotIndex].mGraphicBuffer = 0; mSlots[slotIndex].mFence = 0; mSlots[slotIndex].mFence = Fence::NO_FENCE; } // Used for refactoring, should not be in final interface Loading Loading @@ -228,7 +228,7 @@ status_t ConsumerBase::releaseBufferLocked(int slot, EGLDisplay display, freeBufferLocked(slot); } mSlots[slot].mFence.clear(); mSlots[slot].mFence = Fence::NO_FENCE; return err; } Loading libs/gui/GLConsumer.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ GLConsumer::GLConsumer(GLuint tex, bool allowSynchronousMode, GLenum texTarget, bool useFenceSync, const sp<BufferQueue> &bufferQueue) : ConsumerBase(bufferQueue == 0 ? new BufferQueue(allowSynchronousMode) : bufferQueue), mCurrentTransform(0), mCurrentFence(Fence::NO_FENCE), mCurrentTimestamp(0), mFilteringEnabled(true), mTexName(tex), Loading Loading @@ -823,7 +824,7 @@ status_t GLConsumer::doGLFenceWaitLocked() const { return INVALID_OPERATION; } if (mCurrentFence != NULL) { if (mCurrentFence->isValid()) { if (useWaitSync) { // Create an EGLSyncKHR from the current fence. int fenceFd = mCurrentFence->dup(); Loading Loading
cmds/flatland/GLHelper.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ * limitations under the License. */ #include <ui/Fence.h> #include <ui/DisplayInfo.h> #include <gui/SurfaceComposerClient.h> Loading
libs/gui/BufferItemConsumer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ status_t BufferItemConsumer::acquireBuffer(BufferItem *item, bool waitForFence) return err; } if (waitForFence && item->mFence.get()) { if (waitForFence) { err = item->mFence->waitForever(1000, "BufferItemConsumer::acquireBuffer"); if (err != OK) { BI_LOGE("Failed to wait for fence of acquired buffer: %s (%d)", Loading
libs/gui/BufferQueue.cpp +14 −9 Original line number Diff line number Diff line Loading @@ -372,8 +372,6 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, h = mDefaultHeight; } // buffer is now in DEQUEUED (but can also be current at the same time, // if we're in synchronous mode) mSlots[buf].mBufferState = BufferSlot::DEQUEUED; const sp<GraphicBuffer>& buffer(mSlots[buf].mGraphicBuffer); Loading @@ -387,7 +385,7 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, mSlots[buf].mGraphicBuffer = NULL; mSlots[buf].mRequestBufferCalled = false; mSlots[buf].mEglFence = EGL_NO_SYNC_KHR; mSlots[buf].mFence.clear(); mSlots[buf].mFence = Fence::NO_FENCE; mSlots[buf].mEglDisplay = EGL_NO_DISPLAY; returnFlags |= IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION; Loading @@ -397,7 +395,7 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, eglFence = mSlots[buf].mEglFence; outFence = mSlots[buf].mFence; mSlots[buf].mEglFence = EGL_NO_SYNC_KHR; mSlots[buf].mFence.clear(); mSlots[buf].mFence = Fence::NO_FENCE; } // end lock scope if (returnFlags & IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION) { Loading @@ -423,7 +421,6 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence, } } if (eglFence != EGL_NO_SYNC_KHR) { EGLint result = eglClientWaitSyncKHR(dpy, eglFence, 0, 1000000000); // If something goes wrong, log the error, but return the buffer without Loading Loading @@ -488,6 +485,11 @@ status_t BufferQueue::queueBuffer(int buf, input.deflate(×tamp, &crop, &scalingMode, &transform, &fence); if (fence == NULL) { ST_LOGE("queueBuffer: fence is NULL"); return BAD_VALUE; } ST_LOGV("queueBuffer: slot=%d time=%#llx crop=[%d,%d,%d,%d] tr=%#x " "scale=%s", buf, timestamp, crop.left, crop.top, crop.right, crop.bottom, Loading Loading @@ -607,6 +609,9 @@ void BufferQueue::cancelBuffer(int buf, sp<Fence> fence) { ST_LOGE("cancelBuffer: slot %d is not owned by the client (state=%d)", buf, mSlots[buf].mBufferState); return; } else if (fence == NULL) { ST_LOGE("cancelBuffer: fence is NULL"); return; } mSlots[buf].mBufferState = BufferSlot::FREE; mSlots[buf].mFrameNumber = 0; Loading Loading @@ -785,7 +790,7 @@ void BufferQueue::freeBufferLocked(int slot) { eglDestroySyncKHR(mSlots[slot].mEglDisplay, mSlots[slot].mEglFence); mSlots[slot].mEglFence = EGL_NO_SYNC_KHR; } mSlots[slot].mFence.clear(); mSlots[slot].mFence = Fence::NO_FENCE; } void BufferQueue::freeAllBuffersLocked() { Loading Loading @@ -843,7 +848,7 @@ status_t BufferQueue::acquireBuffer(BufferItem *buffer) { mSlots[buf].mAcquireCalled = true; mSlots[buf].mNeedsCleanupOnRelease = false; mSlots[buf].mBufferState = BufferSlot::ACQUIRED; mSlots[buf].mFence.clear(); mSlots[buf].mFence = Fence::NO_FENCE; mQueue.erase(front); mDequeueCondition.broadcast(); Loading @@ -863,8 +868,8 @@ status_t BufferQueue::releaseBuffer(int buf, EGLDisplay display, Mutex::Autolock _l(mMutex); if (buf == INVALID_BUFFER_SLOT) { return -EINVAL; if (buf == INVALID_BUFFER_SLOT || fence == NULL) { return BAD_VALUE; } mSlots[buf].mEglDisplay = display; Loading
libs/gui/ConsumerBase.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ ConsumerBase::~ConsumerBase() { void ConsumerBase::freeBufferLocked(int slotIndex) { CB_LOGV("freeBufferLocked: slotIndex=%d", slotIndex); mSlots[slotIndex].mGraphicBuffer = 0; mSlots[slotIndex].mFence = 0; mSlots[slotIndex].mFence = Fence::NO_FENCE; } // Used for refactoring, should not be in final interface Loading Loading @@ -228,7 +228,7 @@ status_t ConsumerBase::releaseBufferLocked(int slot, EGLDisplay display, freeBufferLocked(slot); } mSlots[slot].mFence.clear(); mSlots[slot].mFence = Fence::NO_FENCE; return err; } Loading
libs/gui/GLConsumer.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ GLConsumer::GLConsumer(GLuint tex, bool allowSynchronousMode, GLenum texTarget, bool useFenceSync, const sp<BufferQueue> &bufferQueue) : ConsumerBase(bufferQueue == 0 ? new BufferQueue(allowSynchronousMode) : bufferQueue), mCurrentTransform(0), mCurrentFence(Fence::NO_FENCE), mCurrentTimestamp(0), mFilteringEnabled(true), mTexName(tex), Loading Loading @@ -823,7 +824,7 @@ status_t GLConsumer::doGLFenceWaitLocked() const { return INVALID_OPERATION; } if (mCurrentFence != NULL) { if (mCurrentFence->isValid()) { if (useWaitSync) { // Create an EGLSyncKHR from the current fence. int fenceFd = mCurrentFence->dup(); Loading