diff options
author | Jesse Hall <jessehall@google.com> | 2013-08-30 21:14:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-30 21:14:55 +0000 |
commit | 87967c186995d1500875c495cba8f04f7cff76cc (patch) | |
tree | 6d05c2e4be9321738430efe77cbaf2efd0b9c72e /services | |
parent | 19733a32799f792125913e746e8644d16f8dc223 (diff) | |
parent | 8db92553e9e6263cd41eaf1a1ebc9e3f88f92b5f (diff) | |
download | frameworks_native-87967c186995d1500875c495cba8f04f7cff76cc.zip frameworks_native-87967c186995d1500875c495cba8f04f7cff76cc.tar.gz frameworks_native-87967c186995d1500875c495cba8f04f7cff76cc.tar.bz2 |
Merge "Force async behavior for the virtual display output BufferQueue" into klp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp | 17 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index 01ca38a..43d27bb 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -175,9 +175,12 @@ void VirtualDisplaySurface::onFrameCommitted() { sp<Fence> outFence = mHwc.getLastRetireFence(mDisplayId); VDS_LOGV("onFrameCommitted: queue sink sslot=%d", sslot); status_t result = mSource[SOURCE_SINK]->queueBuffer(sslot, - QueueBufferInput(systemTime(), false, + QueueBufferInput( + systemTime(), false /* isAutoTimestamp */, Rect(mSinkBufferWidth, mSinkBufferHeight), - NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false, outFence), + NATIVE_WINDOW_SCALING_MODE_FREEZE, 0 /* transform */, + true /* async*/, + outFence), &qbo); if (result == NO_ERROR) { updateQueueBufferOutput(qbo); @@ -205,7 +208,10 @@ status_t VirtualDisplaySurface::setBufferCount(int bufferCount) { } status_t VirtualDisplaySurface::dequeueBuffer(Source source, - uint32_t format, int* sslot, sp<Fence>* fence, bool async) { + uint32_t format, int* sslot, sp<Fence>* fence) { + // Don't let a slow consumer block us + bool async = (source == SOURCE_SINK); + status_t result = mSource[source]->dequeueBuffer(sslot, fence, async, mSinkBufferWidth, mSinkBufferHeight, format, mProducerUsage); if (result < 0) @@ -244,6 +250,7 @@ status_t VirtualDisplaySurface::dequeueBuffer(int* pslot, sp<Fence>* fence, bool "Unexpected dequeueBuffer() in %s state", dbgStateStr()); mDbgState = DBG_STATE_GLES; + VDS_LOGW_IF(!async, "EGL called dequeueBuffer with !async despite eglSwapInterval(0)"); VDS_LOGV("dequeueBuffer %dx%d fmt=%d usage=%#x", w, h, format, usage); status_t result = NO_ERROR; @@ -275,7 +282,7 @@ status_t VirtualDisplaySurface::dequeueBuffer(int* pslot, sp<Fence>* fence, bool *fence = mOutputFence; } else { int sslot; - result = dequeueBuffer(source, format, &sslot, fence, async); + result = dequeueBuffer(source, format, &sslot, fence); if (result >= 0) { *pslot = mapSource2ProducerSlot(source, sslot); } @@ -391,7 +398,7 @@ status_t VirtualDisplaySurface::refreshOutputBuffer() { } int sslot; - status_t result = dequeueBuffer(SOURCE_SINK, 0, &sslot, &mOutputFence, false); + status_t result = dequeueBuffer(SOURCE_SINK, 0, &sslot, &mOutputFence); if (result < 0) return result; mOutputProducerSlot = mapSource2ProducerSlot(SOURCE_SINK, sslot); diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h index 4ab80e4..536007e 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h @@ -110,7 +110,7 @@ private: // static Source fbSourceForCompositionType(CompositionType type); status_t dequeueBuffer(Source source, uint32_t format, - int* sslot, sp<Fence>* fence, bool async); + int* sslot, sp<Fence>* fence); void updateQueueBufferOutput(const QueueBufferOutput& qbo); void resetPerFrameState(); status_t refreshOutputBuffer(); |