From be1ad8d186d0db6e0a3c8885c95a354cbbfc52af Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 27 Jul 2010 20:11:35 -0700 Subject: fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot dequeue all allocated buffers at once. this situation happened when the last buffer needed to be resized (or allocated, the first time). the assumption was that the buffer was in use by SF itself as the current buffer (obviously, this assumption made no sense when the buffer had never been allocated, btw). the system would wait until some other buffer became the "front" buffer. we fix this problem by entirely removing the requirement that the buffer being resized cannot be the front buffer. instead, we just allocate a new buffer and replace the front buffer by the new one. the downside is that this uses more memory (an extra buffer) for a brief amount of time while the old buffer is being reallocated and before it has actually been replaced. Change-Id: I022e4621209474ceb1c671b23deb4188eaaa7285 --- include/private/surfaceflinger/SharedBufferStack.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include/private') diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h index 633b543..1eb178e 100644 --- a/include/private/surfaceflinger/SharedBufferStack.h +++ b/include/private/surfaceflinger/SharedBufferStack.h @@ -273,7 +273,6 @@ public: void setStatus(status_t status); status_t reallocateAll(); status_t reallocateAllExcept(int buffer); - status_t assertReallocate(int buffer); int32_t getQueuedCount() const; Region getDirtyRegion(int buffer) const; @@ -356,13 +355,6 @@ private: inline StatusUpdate(SharedBufferBase* sbb, status_t status); inline ssize_t operator()(); }; - - struct ReallocateCondition : public ConditionBase { - int buf; - inline ReallocateCondition(SharedBufferBase* sbb, int buf); - inline bool operator()() const; - inline const char* name() const { return "ReallocateCondition"; } - }; }; // =========================================================================== -- cgit v1.1