diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-07 16:32:45 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-09-07 16:32:45 -0700 |
commit | 9779b221e999583ff89e0dfc40e56398737adbb3 (patch) | |
tree | 76b185d252b95b05e8d74e7a1644b843f8839725 /libs/surfaceflinger/SurfaceFlinger.h | |
parent | a4eb91da03bd785bc91bed0d25a9efaa9baba1c1 (diff) | |
download | frameworks_base-9779b221e999583ff89e0dfc40e56398737adbb3.zip frameworks_base-9779b221e999583ff89e0dfc40e56398737adbb3.tar.gz frameworks_base-9779b221e999583ff89e0dfc40e56398737adbb3.tar.bz2 |
fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.
The main new feature is to be able to dequeue all buffers at once (very important when there are only two).
A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.
The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.
eg. Allowed sequence: DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
Diffstat (limited to 'libs/surfaceflinger/SurfaceFlinger.h')
-rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libs/surfaceflinger/SurfaceFlinger.h b/libs/surfaceflinger/SurfaceFlinger.h index 69e2f2e..f207f85 100644 --- a/libs/surfaceflinger/SurfaceFlinger.h +++ b/libs/surfaceflinger/SurfaceFlinger.h @@ -34,7 +34,7 @@ #include <ui/ISurfaceComposer.h> #include <ui/ISurfaceFlingerClient.h> -#include <private/ui/SharedState.h> +#include <private/ui/SharedBufferStack.h> #include <private/ui/LayerState.h> #include "Barrier.h" @@ -87,7 +87,7 @@ public: } // pointer to this client's control block - per_client_cblk_t* ctrlblk; + SharedClient* ctrlblk; ClientID cid; @@ -268,8 +268,6 @@ private: bool lockPageFlip(const LayerVector& currentLayers); void unlockPageFlip(const LayerVector& currentLayers); void handleRepaint(); - void scheduleBroadcast(const sp<Client>& client); - void executeScheduledBroadcasts(); void postFramebuffer(); void composeSurfaces(const Region& dirty); void unlockClients(); @@ -313,6 +311,7 @@ private: volatile int32_t mTransactionFlags; volatile int32_t mTransactionCount; Condition mTransactionCV; + bool mResizeTransationPending; // protected by mStateLock (but we could use another lock) Tokenizer mTokens; @@ -337,8 +336,6 @@ private: Region mDirtyRegionRemovedLayer; Region mInvalidRegion; Region mWormholeRegion; - wp<Client> mLastScheduledBroadcast; - SortedVector< wp<Client> > mScheduledBroadcasts; bool mVisibleRegionsDirty; bool mDeferReleaseConsole; bool mFreezeDisplay; |