Commit Graph

12 Commits

Author SHA1 Message Date
Jamie Gennis a436799668 am 50f8d285: am d4e70620: am 72c3f7d8: Revert "ConsumerBase: free buffers outside the lock"
* commit '50f8d2856b6644059b31684687842bf9c1f2e814':
  Revert "ConsumerBase: free buffers outside the lock"
2012-12-07 11:09:12 -08:00
Jamie Gennis 72c3f7d881 Revert "ConsumerBase: free buffers outside the lock"
This reverts commit b21a4e3b5f.
2012-12-07 10:33:07 -08:00
Jamie Gennis b5fe96b813 am 05989772: am 3ed2736c: am b21a4e3b: ConsumerBase: free buffers outside the lock
* commit '05989772d5b46cd5328e88d546f04deef39cc3c8':
  ConsumerBase: free buffers outside the lock
2012-12-06 23:24:25 -08:00
Jamie Gennis b21a4e3b5f ConsumerBase: free buffers outside the lock
This change makes ConsumerBase::onBuffersReleased hold a reference to all its
gralloc buffers until after the mutex is unlocked.  This prevents slow
gralloc::free calls from causing lock contention with rendering threads.

Bug: 7675940
Change-Id: I0ec805d1b612afeeecfffec03f982371d27d93be
2012-12-06 18:17:35 -08:00
Igor Murashkin a4a3149a36 Change ConsumerBase's FrameAvailableListener to be a weak pointer
This prevents strong reference cycles when the listener implementation also
holds a strong pointer to the ConsumerBase

Bug: 7425644
Change-Id: I1514b13a32b18d421c902dddebec0765a989c55c
2012-11-05 13:39:02 -08:00
Jesse Hall 9504eb915c Fix race condition in ConsumerBase::addReleaseFence()
This needs the ConsumerBase mutex locked, but wasn't locking it. Two
of the four places that called it already held the lock so were fine.
Now addReleaseFence() takes the lock itself, and I added
addReleaseFenceLocked() for the two already-locked callers, since in
one of them dropping the lock would be inconvenient.

Bug: 7289269
Change-Id: I7a5628adb516f8eec782aa6c14128202f96d7b0a
2012-10-05 14:40:50 -07:00
Jamie Gennis 7aff4a5de4 ConsumerBase: make fence names meaningful
Change-Id: I3580120cb63c027c327e80ec70e68650b75395de
2012-09-24 12:25:53 -07:00
Jamie Gennis b272541546 libgui: move fence handling into ConsumerBase
This change moves some common fence handling code into the base class for
BufferQueue consumer classes.  It also makes the ConsumerBase class initialize
a buffer slot's fence with the acquire fence every time a buffer is acquired.

Change-Id: I0bd88bc269e919653b659bfb3ebfb04dd61692a0
2012-09-06 17:54:53 -07:00
Jamie Gennis 9fea3421ff SurfaceTexture: inherit from ConsumerBase (try 2)
This change makes SurfaceTexture inherit from ConsumerBase.  It removes all of
the functionality from SurfaceTexture that is now provided by the base class.
This includes fixes for two bugs that were found after checking this change in
the first time and then reverting it.

Change-Id: Ie2d9f4f27cfef26fdac341de3152e842b01a58d2
2012-08-21 16:41:03 -07:00
Jamie Gennis ce7a6c0fc9 Revert "SurfaceTexture: inherit from ConsumerBase"
This reverts commit ed059a8d75

Change-Id: I72542c2595771a40c2c88251e0d6eb54e305b99b
2012-08-20 14:28:53 -07:00
Jamie Gennis ed059a8d75 SurfaceTexture: inherit from ConsumerBase
This change makes SurfaceTexture inherit from ConsumerBase.  It removes all of
the functionality from SurfaceTexture that is now provided by the base class.

Change-Id: I4a881df42810a14ee32d4ef7c8772a8f2510f4c7
2012-08-16 18:11:02 -07:00
Jamie Gennis 1a4d883dcc surfaceflinger: refactor FrambufferSurface
This change refactors the FramebufferSurface class to inherit from the new
ConsumerBase class.

Bug: 6620200
Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
2012-08-06 18:55:01 -07:00