diff options
author | Jesse Hall <jessehall@google.com> | 2013-11-08 13:01:20 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-08 13:01:20 -0800 |
commit | 324c69b542cf051e86cead592ff6a103ce1dbb34 (patch) | |
tree | ac036a65c7597f757a1b049f4268974cb8ff4d42 /services/surfaceflinger | |
parent | ad78055746c9b1b3f0563133971800812bfed1f6 (diff) | |
parent | 1ee45c2d2d816ee912624d81ff1b0aaa98e8fa74 (diff) | |
download | frameworks_native-324c69b542cf051e86cead592ff6a103ce1dbb34.zip frameworks_native-324c69b542cf051e86cead592ff6a103ce1dbb34.tar.gz frameworks_native-324c69b542cf051e86cead592ff6a103ce1dbb34.tar.bz2 |
am 1ee45c2d: am 14e8b01a: Don\'t change the framebuffer target until we render a new one
* commit '1ee45c2d2d816ee912624d81ff1b0aaa98e8fa74':
Don't change the framebuffer target until we render a new one
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index 2bf7d21..be5cf4a 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -174,14 +174,8 @@ status_t VirtualDisplaySurface::advanceFrame() { } mDbgState = DBG_STATE_HWC; - if (mCompositionType == COMPOSITION_HWC) { - // Use the output buffer for the FB as well, though conceptually the - // FB is unused on this frame. - mFbProducerSlot = mOutputProducerSlot; - mFbFence = mOutputFence; - } - - if (mFbProducerSlot < 0 || mOutputProducerSlot < 0) { + if (mOutputProducerSlot < 0 || + (mCompositionType != COMPOSITION_HWC && mFbProducerSlot < 0)) { // Last chance bailout if something bad happened earlier. For example, // in a GLES configuration, if the sink disappears then dequeueBuffer // will fail, the GLES driver won't queue a buffer, but SurfaceFlinger @@ -191,7 +185,8 @@ status_t VirtualDisplaySurface::advanceFrame() { return NO_MEMORY; } - sp<GraphicBuffer> fbBuffer = mProducerBuffers[mFbProducerSlot]; + sp<GraphicBuffer> fbBuffer = mFbProducerSlot >= 0 ? + mProducerBuffers[mFbProducerSlot] : sp<GraphicBuffer>(NULL); sp<GraphicBuffer> outBuffer = mProducerBuffers[mOutputProducerSlot]; VDS_LOGV("advanceFrame: fb=%d(%p) out=%d(%p)", mFbProducerSlot, fbBuffer.get(), @@ -201,7 +196,12 @@ status_t VirtualDisplaySurface::advanceFrame() { // so update HWC state with it. mHwc.setOutputBuffer(mDisplayId, mOutputFence, outBuffer); - return mHwc.fbPost(mDisplayId, mFbFence, fbBuffer); + status_t result = NO_ERROR; + if (fbBuffer != NULL) { + result = mHwc.fbPost(mDisplayId, mFbFence, fbBuffer); + } + + return result; } void VirtualDisplaySurface::onFrameCommitted() { @@ -458,9 +458,7 @@ void VirtualDisplaySurface::resetPerFrameState() { mCompositionType = COMPOSITION_UNKNOWN; mSinkBufferWidth = 0; mSinkBufferHeight = 0; - mFbFence = Fence::NO_FENCE; mOutputFence = Fence::NO_FENCE; - mFbProducerSlot = -1; mOutputProducerSlot = -1; } |